Modcomp XPL Compiler Code
XPL Compiler for the Modcomp III/IV and Classic
Status: Beta
Brought to you by:
shoefoot
File | Date | Author | Commit |
---|---|---|---|
bootstrap | 2023-04-10 | Daniel Weaver | [839d35] Modify the makefile to use the XPL compiler fro... |
compiler | 2023-04-12 | Daniel Weaver | [1f67d7] Fix a few typos in comments. |
muse | 2023-04-12 | Daniel Weaver | [1f67d7] Fix a few typos in comments. |
sim | 2023-04-11 | Daniel Weaver | [3993d3] The Floating Point tests from classic.xpl have ... |
tools | 2023-04-11 | Daniel Weaver | [c5bf1c] Use the latest version of the XPL compiler. |
COPYING | 2020-07-22 | Daniel Weaver | [96d4f3] New files |
FILES | 2023-04-11 | Daniel Weaver | [52335c] Add new files. |
FM4::.FM | 2020-08-23 | Daniel Weaver | [de545d] Add an INT for RTP:: |
README | 2023-04-12 | Daniel Weaver | [be7910] Document version mcs0007 |
makefile | 2023-04-01 | Daniel Weaver | [eb0aec] Bump revision |
tools.rtf | 2023-04-11 | Daniel Weaver | [87c8d3] Add the MODCOMP Fill Switch operation. |
xpl.rtf | 2023-04-12 | Daniel Weaver | [6dd1b5] Document the XPLLIB functions. |
The Modcomp XPL compiler is written in XPL. Therefor it needs another XPL compiler for bootstrapping. The bootstrap compiler is found here: https://sourceforge.net/projects/xpl-compiler/ The Modcomp compiler needs xpl0007 or later. Feel free to contact me about the compiler or any MODCOMP related topic. shoefoot@gmail.com I am also interested in buying MODCOMP hardware and software. I need documentation on the following subjects: MODCOMP IV CPU Reference Manual M4EDIT and TOC Reference Manuals MAX IV Input/Output Reference Manual 2023/04/12 version mcs0007 changes: XCOM REV 0.6 1) The Compare instructions jump on Negative set rather than less then. 2) Optimize MODCOMP III compare to zero. 3) Generate CRMB instructions when optimal. 4) Optimize register allocation for magnitude compare. 5) Optimize unsigned compare for EQ and NE. 6) Implement Compare Bit instructions for the MODCOMP III. 7) Use Subtract Bit instructions instead of CBMB when optimal. 8) Use TBRB instruction instead of CRMB for compares LT or GE to zero. 9) The peephole optimizer will now backup over ETI instructions that are masking a power of two. 10) Add __LINE__ builtin function. XPL Library 1) Add floating point conversion to PRINTF. Add print formats A, E, F and G. MUSE XCOM REV 0.4 1) Add all the MODCOMP op-codes. 2) Add Floating Point to Integer conversion. 3) Fixed a bug with the last argument of the INLINE function. 4) Fixed ILINE to allow variables as offsets with short displaced op-codes. M4EDIT Rev 0.5 1) The linker will now scan Libraries repeatedly until it has resolved all symbols contained within the Library. 2) Fix an infinite loop when the binary input file is corrupted and does not have an end record. 3) The linker return code will be non-zero if any errors occur. 4) Add an error message for multiple start addresses. MODCOMP simulator version 0.6 1) Change all the Compare and Branch instructions to jump on negative rather than less than. This is how the MODCOMP III actually works. 2022/11/20 version mcs0006 changes: XCOM REV 0.5 1) Add a variable($) to represent the current Program Pointer. 2) Flush out INLINE calls that do not end in an integer constant. 3) Move $OPTIONS to a common block so it can be accessed by all modules. 4) Move DATE_OF_GENERATION and TIME_OF_GENERATION to the constant counter. 5) Fix a bug with a byte index that follows a conditional. 6) Add an error message if the condition codes are corrupted. 7) Increase the number of Externals from 64 to 96. 8) Fix External function call parameters where the relocation was being lost when using reentrant code. 9) Fix another spot where the relocation was being lost when doing arithmetic with the ADDR function. 10) Finalize the start-up code for reentrant modules. MUSE XCOM REV 0.3 1) Move $OPTIONS to a common block so it can be accessed by all modules. 2) Move DATE_OF_GENERATION and TIME_OF_GENERATION to the constant counter. 3) Add the ALLOCATE builtin function. Bootstrap XCOM REV 0.2 1) Move $OPTIONS to a common block so it can be accessed by all modules. 2) Move DATE_OF_GENERATION and TIME_OF_GENERATION to the constant counter. MASM Version 0.05 1) Add the CTV command for special Counter Values. 2) Add line number to error display when the lines are inside macros. 3) Set the correct loader bits to allow an absolute start address. M4EDIT Rev 0.4 1) Implement the CTV opcodes. 2) Add a --verbose option to print debug information. 3) Fix relocation values of External References. 4) Additional fixes to -r relocatable option. 5) Add a -t option to trace files being processed. 6) The -L option can be used with or without an intervening blank. 7) The -L option will no longer effect .bo files, only library files. 8) Fixed a bug when RES was used to clear data at the beginning of a file. 9) The maximum number of libraries was changed from 4 to 8. 10) Add the -p option to generate partial load files. MODCOMP simulator version 0.5 1) Add the ability to break when a watchpoint triggers. 2) Call history changed from the target address to the address of the call. 3) Do not Overflow if HSA equals new CSP when executing the PLM instruction. 4) Fix modified registers in trace display for CRI, TETI, TORI, and TXOI. 5) Add a notice when hitting return link. 6) Calculate the Core Partition size for MAX III Task Info. 7) Add Hex(#) and CAN code(@) to the --dop option. 8) Add a hexcode array to help with Hex conversions. 9) Add simulations for the REX Load Overlay calls for MAX III and MAX IV. 10) Add the ability to load relocatable object modules from the command line. 11) Add a --load=hhhh option to set the load address for relocatable object modules. MCDIS Rev 0.6 1) Major rewrite of the disassemble file code to fix a tiny problem where instructions would appear after the END statement. 2) Correct a problem where the disassembler would double up on DFC arguments when used after a MAX III REX call. 2022/09/24 version mcs0005 changes: XCOM REV 0.4 1) Fix a bug with the FORTRAN calling sequence. 2) Change conditional compile to use System Options rather than Program Options. 3) Fix an accuracy bug with floating point constants. 4) Add a Peephole optimizer for "and branch" instructions. MASM Version 0.04 1) Fix a bug with macro definitions using MAD where the parameters had the wrong numbers. 2) Implement the LST directive. Add the -P option to allow LST P. 3) Added String variables. Strings start with a colon(:) in column one. 4) Added text symbols for the --opt option. M4EDIT Rev 0.3 1) Add -j option to join Read/Execute memory with Read Only memory. 2) Fix a bug with common blocks when subsequent object files use different order to declare the blocks. 3) Implement version one of the object file header. 4) Implement Counter 9 to map the same page in both instruction and data maps. 5) Expand the --high option to work with both I-Space and O-Space. XPL Library 1) Modify PRINTF to allow it to run as reentrant. MODCOMP simulator version 0.4 1) Correct the condition codes for Multiply and Divide. 2) Add the option --mcX to select machine number. 3) Correct the BLxx instructions so they do not change the Link register when the condition is FALSE. 4) Use version one of the object file header. 5) Add Virtual Memory with 8 large maps. 6) Add 16 register blocks. 7) Add new opcodes: SIOM, SOOM, SZOM, SCRB, ZIMP, ZOMP, LIMP, LOMP, SOMP, MMRB, MRBM, LDAM, LDVM, STAM, STVM. MCDIS Rev 0.5 1) Implement version one of the object file header. 2) Change --recsize to --secsize. 2021/12/09 version mcs0004 changes: XCOM REV 0.3 1) Add a 16-bit unsigned integer type for POINTER and the ADDR function. 2) Fix Floating point to integer conversion for both MODCOMP III and IV. 3) Remove all MODCOMP IV opcodes from INLINE statements within the MODCOMP III compiler. 4) Fix logical NOT for MODCOMP III when negating integers. 5) Add option U5 to the conditional compile. 6) Optimize logical variables used in IF statements in the MODCOMP III compiler. Use TOR instead of XBR. 7) Optimize hidden function calls by flushing the workstack after the call. For example: after a concatenate. 8) Optimize register selection for Byte load/store. 9) Convert option 4 from PIC to Reentrant code generation. 10) Implement option 4 with MAX III for Reentrant code generation. 11) Add the -V option to display built-in symbols and predefined externals. XPL Library 1) Swap the order of the first two arguments in BCOPY 2) New function: WCOPY - Copy blocks of 16-bit words 3) New function: X:CDFI, X:CFDI - Floating point to Integer routines 4) New function: STRCMP - String compare 5) New function: SNCMP - String compare with length limit 6) New function: SCCMP - String compare ignore case 7) New function: SNCCMP - String compare ignore case with length limit 8) New function: INDEX - Return the first occurrence of a character 9) New function: RINDEX - Return the last occurrence of a character 10) New function: STRSTR - Find a String in a String 11) New function: STRSEP - Tokenize a string using delimiters 12) New function: UPPER - Convert string to upper case 13) New function: LOWER - Convert string to lower case MASM Version 0.03 1) Correct the line counter when multiple programs are in one file. 2) Implement NOL and LST assembler pseudo-ops. 3) Add the Program name to the final error message. 4) Add options to select hardware: --mc3 --mc4 --mc5 5) Add all Modcomp IV and Classic opcodes 6) Expand the upper limit of macro arguments from 16 to 99. 7) Correct %0 to expand to the number of arguments 8) Add %@ to expand to the label used on the macro invocation 9) Add the error letter B to flag macro expansion errors 10) Add code to generate a CPU reference card. 11) Add the pseudo-ops BND, GTC, CENT and LOG2 12) Add Date and Time macro expansions. %$ %= and %# 13) Implement <HH> within single quote strings for hex characters 14) Implement [ for label generation within macros Modcomp Disassembler - Rev 0.3 1) Add all Modcomp IV and Classic opcodes MODCOMP simulator version 0.3 1) Add more Modcomp IV opcodes in the disassembler 2) Change the BLI instruction to have a link of $+2 3) Implement PSM, PLM and BLT instructions 2021/9/8 version mcs0003 changes: XCOM REV 0.2 1) Add $J option to put a branch to the start address at the beginning of the code. 2) Allow the FORTRAN calling sequence when using the %2 option. 3) Fix a bug with BIT(8) arrays longer than 32767 bytes. 4) Optimize <expression> & <constant> to ones complement the constant in the compiler to work better with the Extract instruction. 5) Change code to correctly generate ABMM, ADMM instructions. XPL Library 1) Allow PRINTF.XPL to be used with the MODCOMP III version. 2) Reduce the amount of space used by COMPACTIFY. MASM Version 0.02 1) Support TABs in the listing. 2) Relax some of the rules for multiple uses of INT and EXT. 3) Change the address value printed on the RES directive. 4) Fix a bug where logical compares had bogus relocation. 5) Fix a bug with expressions with strings 'X'-'A' MCDIS Rev 0.2 1) Add --recsize=nnn option 2) Extend the number of Externals to 1023. M4EDIT Rev 0.2 1) Add option -1 to create a one map task. 2) Add option -b to output the binary in Kermit BOO file format. 3) Add option -high=HHHHH to allocate extra memory at the end of the task. 4) Fixed a problem where ABS allocation overlapped REL memory. 5) Add option -r to generate a MAX III relocatable object file. 6) Add option --recsize=nnn to set the output record size. 7) Display an error message when Externals are referenced without be defined. MODCOMP simulator version 0.2 1) Add instruction level simulation for the Console. 2) Add instruction level simulation for the Card Reader. 3) Add option --cr=filename for Card Reader simulation. 4) Add option --rwx to allocate all 64K memory and mark it Read/Write/Exec. 2020/8/25 version mcs0002 changes: Adds a new XPL compiler that uses an optimizer with a Common Sub-expression Eliminator.