TURBO Pascal 3.0 projects



Inline-Generator for TURBO PASCAL 3.0

As is well-known one can insert easily assembler routines into a TURBO Pascal 3.0 program using the command inline. Some other Pascal compilers allow the input of direct assembler instructions (mnemonics) but TURBO requires "hieroglyphs" codeds as hex bytes.

Remember that assemblers such as RMAC use also external references. Therefore two alternatives for generating inline files do exist:
  1. Generate a listing and extract the hex code out of it inserting external references accordingly. A big drawback is the fixation on the listing format because this format may vary between assemblers seriously.
    The following detail illustrates this:
       M80:  0000'   21 0001     ld    hl,1    Thus: <code><hi><lo>
    
       RMAC: 0000    210100      lxi   h,1     Thus: <code><lo><hi>
    
    In the German magazine c't, issue 2 1986, such a program was published for using the format as generated by the Microsoft assembler M80.
  2. Generate an object file in the popular REL-80 format. This format was introduced by the Microsoft assembler M80 and will be used by RMAC amongst others. So you have the choice to work with your favorite assembler. In the German magazine mc, issue 6 1986, such a program was published for generating inline codes out of the REL-80 format.
I typed this program up and enhanced it a bit. This gave me an opportunity to become familiar with TURBO Pascal on the JOYCE. If you wish help then type the program without any parameter and detailed informations will be displayed. The function "GetBits" from module MKINL3.INC is capable for a test. Find the routine as assembler source for RMAC GETBITS.ASM or M80 GETBITS.MAC.



Published in Klubzeitung No. 57    Author: Werner Cirsovius