home *** CD-ROM | disk | FTP | other *** search
- MACRO-80 3.44 09-Dec-81 PAGE 1
-
-
- ; A short demo file for use with INLINE.COM.
- ; Instructions included in INLINE.COM.
- ;
- ; This is a demo file for the TURBO PASCAL inline statment generator.
- ; For: CP/M 2.2 and above with at least 48k TPA.
- ;
- ; Andrew McLean - 22nd Septempber 1987
- ;
- ; All undefined labels produced in this code will be copied into the
- ; new INLINE source maintaining readablity between the assembler source
- ; and the pascal source.
- ;
- ;
- .z80 ;will also work with 8080 assembler code
-
- 0000' aseg ; **** MUST BE ASEG ****
- ; and
- org 0100h ;**** ALL CODE MUST START AT 0100h ****
-
-
- 0001 one equ 00001h ;equates and addresses under 100 hex
- 0002 two equ 00002h ;will not be translated.
- ;
- 0032 fifty equ 50
- ;
- 0005 BDOS equ 00005h
-
-
- 0100 start: ;demo loop 1
- 0100 21 3000 ld hl,03000h
- 0103 01 0032 ld bc,fifty
- 0106 loop:
- 0106 36 2A ld (hl),'*'
- 0108 23 inc hl
- 0109 0B dec bc
- 010A 78 ld a,b
- 010B B1 or c
- 010C C2 0106 jp nz,loop ;note: correct offset calculated
-
- 010F 0E 02 ld c,2
- 0111 1E 33 ld e,33h
- 0113 CD 0005 call BDOS
-
- ;
- 0116 ds 5
- 011B 00 00 00 00 db 0,0,0,0,0 ;simulate a 'DEFS 5'
- 011F 00
-
- ;
- 0120 loop2:
- 0120 11 0173 ld de,msg ;note: correct offset calculated
- 0123 0E 09 ld c,9 ; here also.
- 0125 CD 0005 call bdos
- 0128 C3 0120 jp loop2
-
-
- MACRO-80 3.44 09-Dec-81 PAGE 1-1
-
-
- 012B C3 012B here: jp here
-
- 012E DD 21 0159 ld ix,value1 ;It also translates these complex
- 0132 FD 77 00 ld (iy),a ;instructions into PASCAL INLINE code too.
- U 0135 FD 36 01 00 ld (iy+1),value3
- 0139 FD 36 00 01 ld (iy),one
- 013D FD 36 01 02 ld (iy+1),two
- U 0141 DD 22 0000 ld (value4),ix
- 0145 FD 36 01 00 ld (iy+1),0
- 0149 FD 36 00 03 ld (iy),3
- 014D DD CB 03 9E res 3,(ix+3)
- 0151 DD CB 04 96 res two,(ix+4)
- U 0155 DD CB 01 C6 set eight,(ix+1) ;NOTE the error here!
- ;Although it assembles, it will
- ;not produce the desired code so
- ;it will be left out of the PASCAL
- ;inline code.
- 0159 2A value1: db 42
-
- 015A value2:
- 015A 42 db 042h
-
- ;
- ;A whole lot of DB's!!!
- ;
- 015B 01 02 03 04 db 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
- 015F 05 06 07 08
- 0163 09 0A 0B 0C
- 0167 0D 0E 0F 10
- 016B 04D2 10E1 dw 1234,4321,0fffh,0ffffh
- 016F 0FFF FFFF
- 0173 msg:
- 0173 07 57 68 61 db 7,'What a handy program!!',0
- 0177 74 20 61 20
- 017B 68 61 6E 64
- 017F 79 20 70 72
- 0183 6F 67 72 61
- 0187 6D 21 21 00
-
- end
- MACRO-80 3.44 09-Dec-81 PAGE S
-
-
- Macros:
-
- Symbols:
- 0005 BDOS 0000U EIGHT 0032 FIFTY
- 012B HERE 0106 LOOP 0120 LOOP2
- 0173 MSG 0001 ONE 0100 START
- 0002 TWO 0159 VALUE1 015A VALUE2
- 0000U VALUE3 0000U VALUE4
-
-
-
- 3 Fatal error(s)
-
-
- 0187 6D 21 21 00
-
-