********************************************************************** * README.CNV Jan/10/94 * * From: Richard Soja, Motorola, Austin, Texas * ********************************************************************** This file provides information on the use of the utility program TPUCNV.EXE and should be read before executing the utility. TPUCNV.EXE should execute on any MSDOS compatible PC. If you observe any problems, please contact me. The program converts TPU source code which would normally be assembled by TPUASM.EXE into TPU source code to be assembled by TPUMASM.EXE If the program is invoked without any parameters, then a help screen is displayed. To convert any file, for example TEST.ASC, use the following syntax: TPUCNV TEST.ASC To convert multiple files, just specify all the file names after the MSDOS command: e.g. TPUCNV TEST.ASC ITC QOM Each file is converted in turn. Note that no file extension is assumed, and any file extension may be used. Once the program starts, with the above example, the following messages should appear on the screen: Converting TEST.ASC Created converted file : TEST.UC Created report file : TEST.REP Converting ITC Created converted file : ITC.UC Created report file : ITC.REP Converting QOM Created converted file : QOM.UC Created report file : QOM.REP The converted file extension is .UC and the files should be compatible with TPUMASM, but see notes below for exceptions. A header is attached to the converted file. Line numbers may be included in the converted file using the MSDOS command line option switch /p. The line numbers are enclosed in comments, start at 2, and provide a reference for the information given in the report file. Report files (with extension .REP) are created for each source file. These contains a detailed list of all conversions carried out by TPUCNV The format of the report is: L1 - L2: Where L1 - L2 is the range of line numbers over which a TPU command extends. and is a description of the type of conversion carried out. Some important points to note when using TPUCNV: ------------------------------------------------ 1. Comments in the original source code are not ignored. Any keyword or other notation which requires conversion is converted regardless of its context. i.e Whether it is a valid command, subcommand, subcommand field, directive or comment. The converter reports the fact that a conversion might have taken place out of context. For example, if the original comment were: (* plow contains ratio parameter *) The converted comment becomes: (* p_low contains ratio parameter *) and the report file contains the message: L1 - L2: plow replaced by p_low L1 - L2: p_low might not be in valid context 2. Numbers are converted according to the following rules: a. Hexadecimal and binary radices are converted as required. b. The octal radix is not converted as it is unsupported by TPUMASM. A message to that effect is printed in the report file. c. If the number evaluates to greater than 1 and it is not used in the context of a RAM operation, the immediate (#) character is inserted. d. If the number evaluates to 0 or 1, or the number is used in a RAM operation the immediate (#) character is not inserted. Note that if the number is defined in a macro, the insertion of the # character will cause errors during assembly if the number is later used as a ram address. The user should manually remove the offending # character from the macro in the converted file. Example: TPUASM macro: %macro temp '(1,4)'. Converted macro: %macro temp '(1,#4)'. Other unusual macro definitions which make it impossible to define the context of a macro body might not be converted correctly either. 3. The extension .UC is appended to the file name in the %include directive. Example: TPUASM directive: %include qom Converted directive: %include 'qom.tp2'. This makes it unnecessary for the user to rename converted include files. List of Syntax Changes between TPUASM and TPUMASM. -------------------------------------------------- TPUCNV performs the following syntax changes to TPUASM compatible source files, to produce TPUMASM compatible source files. There are changes to most sub-command keywords, and to some directive parameters and delimiters. TPUASM TPUMASM Keyword Keyword ------- ------- (* AU commands *) acc -> a rmer -> read_mer cc -> ccl shft -> shift plow -> p_low phi -> p_high byte_0 -> #0 immed_0 -> #0 immed_1 -> #1 -> # (* Channel commands *) ensr -> enable_mtsr dssr -> disable_mtsr by_p -> p in_mtcr1_ctcr1 -> in_m1_c1 in_mtcr1_ctcr2 -> in_m1_c2 in_mtcr2_ctcr1 -> in_m2_c1 in_mtcr2_ctcr2 -> in_m2_c2 out_mtcr1_ctcr1 -> out_m1_c1 out_mtcr1_ctcr2 -> out_m1_c2 out_mtcr2_ctcr1 -> out_m2_c1 out_mtcr2_ctcr2 -> out_m2_c2 no_trns -> no_detect any_trns -> any_trans clr -> clear cflg0 -> flag0 cflg1 -> flag1 pir -> cir (* RAM command *) -> # (* Microengine Commands *) suben -> dec_return flsh -> flush cflg0 -> flag0 cflg1 -> flag1 seq0 -> hsq0 seq1 -> hsq1 less_then -> less_than (* ENTRY directive *) prim -> function target -> start_address dismatch -> disable_match enmatch -> enable_match lsl -> lsr (* INCLUDE directive *) -> ; function = . -> '' Example: %include psp 15 -> %include 'psp' ; function = 15. Also please note: * Semicolons are required to separate sub-directives or sub-commands. * Commas are required to separate fields in sub-directives or sub-commands. Example: TPUASM entry: %entry target *, dismatch, cond hsr1 = 0 hsr0 = 0 m/tsr = 1 lsl = 0 pin = x flg0 = 0. TPUMASM entry: %entry start_address *; disable_match; cond hsr1 = 0, hsr0 = 0, m/tsr = 1, lsr = 0, pin = x, flag0 = 0. ---------------------------==== End Of File ====-----------------------------