]>
wirehaze git hosting - MS-DOS.git/blob - v1.25/source/TRANS.ASM
1 ; Z80 to 8086 Translator version 2.21
2 ; Runs on the 8086 under 86-DOS
6 EOF: EQU 1
AH ;End of file
42 MOV BX,"A"+5300H
;"AS"
174 ; Get character from source file.
180 MOV BX,[GETPT
] ; Get buffer pointer.
181 CMP BX,GETBUF
+80H
; Past end-of-buffer?
182 JNZ GETIT
; Jump if not.
183 MOV DX,GETBUF
; Set `DMA address'.
186 MOV DX,FCB
; Read the next record from source file.
189 CMP AL,0 ; Entire record read OK?
191 CMP AL,3 ; Partial record read?
193 MOV AL,EOF
; Force end-of-file character in case
194 JP TESEND
; there is nothing in the record.
196 MOV BX,GETBUF
; Reset buffer pointer.
198 MOV AL,[BX] ; Get next character from buffer.
199 INC BX ; Point to next character.
200 MOV [GETPT
],BX ; Save new pointer.
203 JP NOTAF
; Pop registers and return.
498 ;If immediate move, check for byte memory reference
500 CMP AL,20H
;Could be immediate?
503 CALL BYTCHK
;Add "B," if memory reference
538 CALL BYTCHK
;If memory reference, add "B," flag
731 CMP AL,RCX+1 ;16-bit?
780 MOV BX,'R'+4500H
;"RE"
871 ;Check if memory reference and add "B," for byte mode
872 CMP B
,[OP1
],"[" ;Memory reference?
874 CMP B
,[OP1
+1],RIX
;Referencing IX as a word?
919 DW AOPS
,BOPS
,COPS
,DOPS
,EOPS
920 DW FOPS
,GOPS
,HOPS
,IOPS
,JOPS
921 DW KOPS
,LOPS
,MOPS
,NOPS
,OOPS
922 DW POPS
,QOPS
,ROPS
,SOPS
,TOPS
923 DW UOPS
,VOPS
,WOPS
,XOPS
,YOPS
1099 PUSHAF: DB 'LAHF',0,'XCHG',9,'AH,AL',0,'PUSH',9,'AX',0
1101 POPAF: DM
'POP',9,'AX',0,'XCHG',9,'AH,AL',0,'SAHF'
1104 BLMOVE: DB 0,'MOV',9,'SI,BX',0,'MOV',9,'DI,DX'
1105 DB 0,'REP',0,'MOVB',0,'MOV',9,'DX,DI'
1106 DM
0,'MOV',9,'BX,SI'
1108 CMPREP: DB 0,'MOV',9,'DI,BX',0,'REPNZ',0,'SCAB'
1109 DM
0,'MOV',9,'BX,DI'
1110 DAD1: DM
'LAHF',0,'ADD'
1111 DAD2: DM
0,'RCR',9,'SI',0,'SAHF',0,'RCL',9,'SI'
1114 DJNZ: DB 'DEC',9,'CH',13,10
1115 DB '; *** WARNING: DJNZ does not affect flags - DEC does.',0
1117 WARNPA: DM
13,10,'; *** WARNING: Parity flag not always same as Z80.'
1118 IO1: DB 'MOV',9,'DI,DX',0,'MOV',9,'DL,CL',0
1119 DM
'XOR',9,'DH,DH',13,10,9
1120 IO2: DM
0,'MOV',9,'DX,DI'
1121 BADIO: DM
13,10,'; *** WARNING: Flags not same as Z80.'
1122 BITERR: DM
13,10,' *** ERROR: Cannot determine bit number.'
1123 SETBIT: DM
'LAHF',0,'OR'
1125 RESBIT: DM
'LAHF',0,'AND'
1127 TESBIT: DM
'RCR',9,'AH',0,'TEST'
1129 XTHL1: DM
'POP',9,'SI',0,'XCHG',9,'SI'
1130 XTHL2: DM
0,'PUSH',9,'SI'
1131 EXX: DB 'XCHG',9,'BX,[HL]',0,'XCHG',9,'DX,[DE]',0
1132 DM
'XCHG',9,'CX,[BC]'
1133 EXAF: DM
'LAHF',0,'XCHG',9,'AX,BP',0,'SAHF'
1134 MOVAL: DM
0,'MOV',9,'AL'
1135 IXSI: DM
9,'MOV',9,'SI,[IX]',13,10
1136 IYDI: DM
9,'MOV',9,'DI,[IY]',13,10
1138 SAVEAX: DM
'XCHG',9,'AX,SI'
1164 DB 'PEPOS',0,'NSNZZ',0,'NCC',0
1166 DB 'BLBHDLDHCLCHALIXIY'
1168 DB 'ABCDEHLBDHSACNZNPMPPII'
1170 DB 0,0,0,0,0,0,0,'CELPF',0,'C',0,'Z',0,0,'OEYX'
1171 HEADER: DB 13,10,'Z80 to 8086 Translator version 2.21',13,10,'$'
1172 NOROOM: DB 13,10,'File creation error',13,10,'$'
1173 NOFILE: DB 13,10,'File not found',13,10,'$'
1174 ENDMES: DB 13,10,'Translation complete',13,10,'$'
1175 WRTERR: DB 13,10,'Out of disk space',13,10,'$'
1176 OPCDER: DM
13,10,'*** Opcode Error '
1192 ORG 1 ;This is really just for equates without EQU
1197 DS 5 ;MINUS,PLUS,NOT ZERO,ZERO,NOT CARRY