home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / beehive / program / tpinline.arc / DEMO.PRN < prev    next >
Encoding:
Text File  |  1990-07-22  |  5.3 KB  |  122 lines

  1.     MACRO-80 3.44    09-Dec-81    PAGE    1
  2.  
  3.  
  4.                                 ; A short demo file for use with INLINE.COM.
  5.                                 ; Instructions included in INLINE.COM.
  6.                                 ;
  7.                                 ; This is a demo file for the TURBO PASCAL inline statment generator.
  8.                                 ; For: CP/M 2.2 and above with at least 48k TPA.
  9.                                 ;
  10.                                 ; Andrew McLean - 22nd Septempber 1987
  11.                                 ;
  12.                                 ; All undefined labels produced in this code will be copied into the
  13.                                 ; new INLINE source maintaining readablity between the assembler source
  14.                                 ; and the pascal source.
  15.                                 ;
  16.                                 ;
  17.                                     .z80            ;will also work with 8080 assembler code
  18.                                 
  19.   0000'                             aseg            ;      **** MUST BE ASEG ****
  20.                                                 ;           and
  21.                                     org    0100h        ;**** ALL CODE MUST START AT 0100h ****
  22.                                 
  23.                                 
  24.   0001                          one    equ    00001h        ;equates and addresses under 100 hex
  25.   0002                          two    equ    00002h        ;will not be translated.
  26.                                                 ;
  27.   0032                          fifty    equ    50
  28.                                                 ;
  29.   0005                          BDOS    equ    00005h
  30.                                 
  31.                                 
  32.   0100                          start:                ;demo loop 1
  33.   0100    21 3000                   ld    hl,03000h
  34.   0103    01 0032                   ld    bc,fifty
  35.   0106                          loop:
  36.   0106    36 2A                     ld    (hl),'*'
  37.   0108    23                        inc    hl
  38.   0109    0B                        dec    bc
  39.   010A    78                        ld    a,b
  40.   010B    B1                        or    c
  41.   010C    C2 0106                   jp    nz,loop        ;note: correct offset calculated
  42.                                     
  43.   010F    0E 02                     ld    c,2
  44.   0111    1E 33                     ld    e,33h
  45.   0113    CD 0005                   call    BDOS
  46.                                 
  47.                                 ;
  48.   0116                              ds    5
  49.   011B    00 00 00 00               db    0,0,0,0,0    ;simulate a 'DEFS   5'
  50.   011F    00                    
  51.                                 
  52.                                 ;
  53.   0120                          loop2:
  54.   0120    11 0173                   ld    de,msg        ;note: correct offset calculated
  55.   0123    0E 09                     ld    c,9        ;      here also.
  56.   0125    CD 0005                   call    bdos
  57.   0128    C3 0120                   jp    loop2
  58.                                 
  59.                                 
  60.     MACRO-80 3.44    09-Dec-81    PAGE    1-1
  61.  
  62.  
  63.   012B    C3 012B               here:    jp    here
  64.                                 
  65.   012E    DD 21 0159                ld    ix,value1    ;It also translates these complex
  66.   0132    FD 77 00                  ld    (iy),a        ;instructions into PASCAL INLINE code too.
  67. U 0135    FD 36 01 00               ld    (iy+1),value3
  68.   0139    FD 36 00 01               ld    (iy),one
  69.   013D    FD 36 01 02               ld    (iy+1),two
  70. U 0141    DD 22 0000                ld    (value4),ix
  71.   0145    FD 36 01 00               ld    (iy+1),0
  72.   0149    FD 36 00 03               ld    (iy),3
  73.   014D    DD CB 03 9E               res    3,(ix+3)
  74.   0151    DD CB 04 96               res    two,(ix+4)
  75. U 0155    DD CB 01 C6               set    eight,(ix+1)        ;NOTE the error here!
  76.                                                     ;Although it assembles, it will
  77.                                                     ;not produce the desired code so
  78.                                                     ;it will be left out of the PASCAL
  79.                                                     ;inline code.
  80.   0159    2A                    value1:    db    42
  81.                                 
  82.   015A                          value2:
  83.   015A    42                        db    042h
  84.                                 
  85.                                 ;
  86.                                 ;A whole lot of DB's!!!
  87.                                 ;
  88.   015B    01 02 03 04               db    1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
  89.   015F    05 06 07 08           
  90.   0163    09 0A 0B 0C           
  91.   0167    0D 0E 0F 10           
  92.   016B    04D2 10E1                 dw    1234,4321,0fffh,0ffffh
  93.   016F    0FFF FFFF             
  94.   0173                          msg:
  95.   0173    07 57 68 61               db    7,'What a handy program!!',0
  96.   0177    74 20 61 20           
  97.   017B    68 61 6E 64           
  98.   017F    79 20 70 72           
  99.   0183    6F 67 72 61           
  100.   0187    6D 21 21 00           
  101.                                 
  102.                                     end
  103.     MACRO-80 3.44    09-Dec-81    PAGE    S
  104.  
  105.  
  106. Macros:
  107.  
  108. Symbols:
  109. 0005     BDOS            0000U    EIGHT           0032     FIFTY           
  110. 012B     HERE            0106     LOOP            0120     LOOP2           
  111. 0173     MSG             0001     ONE             0100     START           
  112. 0002     TWO             0159     VALUE1          015A     VALUE2          
  113. 0000U    VALUE3          0000U    VALUE4          
  114.  
  115.  
  116.  
  117. 3 Fatal error(s)
  118.  
  119.  
  120.   0187    6D 21 21 00           
  121.                                 
  122.