TITLE '8086 TINCMP CMPLR[CP/M 1.1]' PAGEWIDTH 79 NAME 'MAINPROG' EXTRN MSG:NEAR,OPENIO:NEAR,CLOSEIO:NEAR,RNX:NEAR EXTRN WNX:NEAR,STOP:NEAR,BREAD:NEAR,BWRITE:NEAR EXTRN INITIAL:NEAR,ENDING:NEAR,STOP:NEAR,ATTACH:NEAR EXTRN ASSOC:NEAR IOCTRL DSEG COMMON IAV DW 0 BA0ER DB 0 DATA DSEG KA0LF EQU 10 KA0CR EQU 13 KA0EF EQU 26 BA0AA RB 1 BA0BB RB 1 BA0DD RB 1 BA0EE RB 1 BA0BF RB 80 BA0BL RB 1 BA0BP RB 1 BA0C0 RB 1 BA0C1 RB 1 BA0C2 RB 1 BA0C3 RB 1 BA0C4 RB 1 BA0C8 RB 1 BA0C9 RB 1 BA0CC RB 1 BA0CX RB 1 BA0DG RB 1 BA0DS RB 10 BA0EF RB 1 BA0F1 RB 128 BA0F2 RB 128 BA0HA RB 1 BA0HF RB 1 BA0LE RB 1 BA0LF RB 1 BA0LS RB 9000 BA0MF RB 1 BA0ML RB 1 BA0MM RB 1 BA0ND RB 1 BA0NL RB 1 BA0O1 RB 1 BA0O2 RB 1 BA0O3 RB 1 BA0OA RB 1 BA0OB RB 1 BA0OC RB 1 BA0OD RB 1 BA0OE RB 1 BA0OG RB 1 BA0OH RB 1 BA0OL RB 1 BA0OM RB 1 BA0ON RB 1 BA0OP RB 1 BA0OR RB 1 BA0OS RB 1 BA0OT RB 1 BA0PP RB 1 BA0RB RB 1 BA0RC RB 1 BA0SF RB 1 BA0SP RB 1 BA0TR RB 1 BA0UG RB 1 BA0UN RB 1 BA0UO RB 1 BA0UT RB 1 BA0ZR RB 1 WA000 RW 1 WA001 RW 1 WA009 RW 1 WA010 RW 1 WA016 RW 1 WA0AA RW 1 WA0BB RW 1 WA0BC RW 1 WA0DP RW 1 WA0ED RW 1 WA0II RW 1 WA0JJ RW 1 WA0LM RW 1 WA0LP RW 1000 WA0MP RW 1 WA0NM RW 1 WA0PR RW 10 WA0SS RW 40 WA0TU RW 1 WA0UU RW 1 WA0XX RW 1 WA0YY RW 1 BA0AC RB 1 WA0AV RW 1 ERASER RB 1 CSEG START: CALL INITIAL MOV AX,IAV MOV BA0AC,AL MOV BA0NL,KA0CR MOV BA0LF,KA0LF CALL SA0CR CALL MSG DB 'COPYRIGHT' CALL MSG DB ' (C) 1981' CALL MSG DB ' W.A.GALE' CALL SA0CR CALL MSG DB '8086 TINC' CALL MSG DB 'MP COMPIL' CALL MSG DB 'ER CP/M V' CALL MSG DB 'ERSION 1.' CALL MSG DB '07/TINCMP' CALL SA0CR CALL MSG DB 'COPYRIGHT' CALL MSG DB ' (C) 1984' CALL MSG DB ' A L BEND' CALL MSG DB 'ER, MD ' CALL SA0CR CALL SA0IN CALL SA0RM LOC00: TW0100: MOV BX, OFFSET BA0CC MOV DX, OFFSET BA0F1 CALL BREAD MOV AL,BA0ER CMP AL,BA0C0 MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0100 MOV AL,BA0UG TEST AL,AL JNZ $+5 JMP IFA0101 TW0102: MOV AL,BA0CC CMP AL,BA0NL MOV AL,1 JZ $+4 MOV AL,0 MOV BA0BB,AL MOV AL,BA0CC CMP AL,BA0LF MOV AL,1 JZ $+4 MOV AL,0 MOV BA0DD,AL MOV AL,BA0CC CMP AL,BA0OG MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0BB OR AL,BA0DD MOV BA0EE,AL MOV AL,BA0CC CMP AL,BA0BL MOV AL,1 JZ $+4 MOV AL,0 MOV BA0BB,AL MOV AL,BA0BB OR AL,BA0AA MOV BA0AA,AL MOV AL,BA0EE OR AL,BA0AA MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0102 CALL SA0GC JMP TW0102 BW0102: IFA0101: MOV AL,BYTE PTR BA0C1 MOV BA0BP,AL MOV BL,BA0C0 MOV BH,0 MOV AL,BA0CC MOV BA0BF[BX],AL TW0103: CALL SA0GC MOV AL,BA0CC CMP AL,BA0NL MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0104 CALL SA0GC MOV AL,BA0CC CMP AL,BA0LF MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0105 MOV AL,BYTE PTR BA0NL MOV BA0CC,AL IFA0105: IFA0104: MOV AL,BA0NL CMP AL,BA0CC MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0C8 CMP AL,BA0BP MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0BB,AL MOV AL,BA0AA AND AL,BA0BB MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0103 MOV BL,BA0BP MOV BH,0 MOV AL,BA0CC MOV BA0BF[BX],AL INC BA0BP JMP TW0103 BW0103: TW0106: MOV AL,BA0NL CMP AL,BA0CC MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0106 CALL SA0GC JMP TW0106 BW0106: MOV BL,BA0BP MOV BH,0 MOV AL,BA0RC MOV BA0BF[BX],AL INC BA0BP MOV BL,BA0BP MOV BH,0 MOV AL,BA0NL MOV BA0BF[BX],AL MOV AL,BYTE PTR BA0BP MOV BA0LE,AL MOV AL,BA0BP CMP AL,BA0MM MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0107 MOV BA0ML,0 JMP LOC17 JMP IFA0108 IFA0107: MOV BA0ML,1 IFA0108: MOV BX,WA000 MOV WA0DP,BX MOV AL,BYTE PTR BA0C0 MOV BA0PP,AL MOV BX,WA000 MOV WA0JJ,BX MOV BH,0 MOV BL,BA0C0 MOV WA0NM,BX TW0109: MOV AX,WA0DP CMP AX,WA0ED LAHF ROL AH,1 AND AH,1 MOV BA0AA,AH MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0109 MOV AL,BYTE PTR BA0C0 MOV BA0BP,AL TW0110: MOV AL,BA0BP CMP AL,BA0LE MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0110 MOV BX,WA0JJ MOV AL,BA0LS[BX] MOV BA0AA,AL MOV AL,BA0AA CMP AL,BA0RC MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV BL,BA0BP MOV BH,0 MOV AL,BA0BF[BX] MOV BA0O3,AL MOV AL,BA0O3 CMP AL,BA0RC MOV AL,1 JZ $+4 MOV AL,0 MOV BA0O3,AL MOV AL,BA0AA AND AL,BA0O3 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0111 CALL SA0DM JMP LOC00 JMP IFA0112 IFA0111: MOV BL,BA0BP MOV BH,0 MOV AL,BA0BF[BX] MOV BA0AA,AL MOV BX,WA0JJ MOV AL,BA0LS[BX] MOV BA0BB,AL MOV AL,BA0AA CMP AL,BA0BB MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0113 JMP LOC01 JMP IFA0114 IFA0113: MOV AL,BA0SF CMP AL,BA0BB MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0115 JMP LOC10 JMP IFA0116 IFA0115: INC BA0PP MOV BL,BA0BP MOV BH,0 MOV AL,BA0BF[BX] MOV BA0AA,AL MOV BH,0 MOV BL,BA0AA MOV WA0AA,BX MOV BL,BA0PP MOV BH,0 SHL BX,1 MOV AX,WA0AA MOV WA0PR[BX],AX IFA0116: IFA0114: IFA0112: LOC01: INC BA0BP INC WA0JJ JMP TW0110 BW0110: LOC10: MOV AL,BYTE PTR BA0C0 MOV BA0PP,AL INC WA0NM MOV BX,WA0NM SHL BX,1 MOV AX,WA0LP[BX] MOV WA0DP,AX MOV BX,WA0DP MOV WA0JJ,BX JMP TW0109 BW0109: LOC17: MOV AL,BYTE PTR BA0C0 MOV BA0BP,AL TW0117: MOV BL,BA0BP MOV BH,0 MOV AL,BA0BF[BX] MOV BA0CC,AL MOV AL,BA0C1 ADD AL,BA0BP MOV BA0O1,AL MOV BL,BA0O1 MOV BH,0 MOV AL,BA0BF[BX] MOV BA0AA,AL MOV AL,BA0NL CMP AL,BA0AA MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0117 MOV AL,BA0ML TEST AL,AL JNZ $+5 JMP IFA0118 MOV AL,BA0CC CALL WNX IFA0118: MOV BX, OFFSET BA0CC MOV DX, OFFSET BA0F2 CALL BWRITE INC BA0BP JMP TW0117 BW0117: MOV AL,BA0ML TEST AL,AL JNZ $+5 JMP IFA0119 CALL SA0CR IFA0119: MOV AL,BA0UN TEST AL,AL JNZ $+5 JMP IFA0120 MOV BX, OFFSET BA0NL MOV DX, OFFSET BA0F2 CALL BWRITE MOV BX, OFFSET BA0LF MOV DX, OFFSET BA0F2 CALL BWRITE IFA0120: JMP TW0100 BW0100: LOC88: CALL MSG DB 'TINCMP CO' CALL MSG DB 'MPILATION' CALL MSG DB ' FINISHED' CALL SA0CR MOV DX, OFFSET BA0F1 CALL CLOSEIO MOV DX, OFFSET BA0F2 CALL CLOSEIO CALL ENDING MOV CL,0 INT 224 HLT SA0GC: MOV BX, OFFSET BA0CC MOV DX, OFFSET BA0F1 CALL BREAD MOV AL,BA0C0 CMP AL,BA0ER MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0121 JMP LOC88 IFA0121: MOV AL,BA0CC CMP AL,BA0EF MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0122 JMP LOC88 IFA0122: RET SA0SD: MOV AX,WA0TU CMP AX,WA000 LAHF ROL AH,1 AND AH,1 MOV BA0AA,AH MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0123 MOV BA0BB,1 MOV AX,WA0TU NEG AX MOV WA0TU,AX JMP IFA0124 IFA0123: MOV BA0BB,0 IFA0124: MOV AX,WA000 CMP AX,WA0TU MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0125 MOV AL,BYTE PTR BA0C1 MOV BA0ND,AL MOV BL,BA0C0 MOV BH,0 MOV AL,BA0ZR MOV BA0DS[BX],AL JMP IFA0126 IFA0125: MOV AL,BYTE PTR BA0C0 MOV BA0ND,AL TW0127: MOV AX,WA000 CMP AX,WA0TU LAHF ROL AH,1 AND AH,1 MOV BA0AA,AH MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0127 MOV AX,WA0TU MOV CX,WA010 CWD JCXZ $+4 IDIV CX MOV WA0YY,AX MOV AX,WA010 IMUL WA0YY MOV WA0AA,AX MOV AX,WA0TU SUB AX,WA0AA MOV WA0XX,AX MOV BX,WA0YY MOV WA0TU,BX MOV AL,BYTE PTR WA0XX MOV BA0AA,AL MOV AL,BA0ZR ADD AL,BA0AA MOV BA0AA,AL MOV BL,BA0ND MOV BH,0 MOV AL,BA0AA MOV BA0DS[BX],AL INC BA0ND JMP TW0127 BW0127: IFA0126: MOV BL,BA0ND MOV BH,0 MOV AL,BA0OR MOV BA0DS[BX],AL MOV AL,BA0BB ADD AL,BA0ND MOV BA0ND,AL RET SA0WN: CALL SA0SD TW0128: MOV BH,0 MOV BL,BA0ND MOV WA0AA,BX MOV AX,WA000 CMP AX,WA0AA LAHF ROL AH,1 AND AH,1 MOV BA0AA,AH MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0128 DEC BA0ND MOV BL,BA0ND MOV BH,0 MOV AL,BA0DS[BX] MOV BA0AA,AL MOV BX, OFFSET BA0AA MOV DX, OFFSET BA0F2 CALL BWRITE JMP TW0128 BW0128: RET SA0PN: CALL SA0SD TW0129: MOV BH,0 MOV BL,BA0ND MOV WA0AA,BX MOV AX,WA000 CMP AX,WA0AA LAHF ROL AH,1 AND AH,1 MOV BA0AA,AH MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0129 DEC BA0ND MOV BL,BA0ND MOV BH,0 MOV AL,BA0DS[BX] MOV BA0AA,AL MOV AL,BA0AA CALL WNX JMP TW0129 BW0129: MOV AL,BA0BL CALL WNX RET SA0CD: MOV AL,BA0ZR CMP AL,BA0AA MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0BB,AL MOV AL,BA0AA CMP AL,BA0C9 MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0CC,AL MOV AL,BA0BB AND AL,BA0CC MOV BA0BB,AL MOV AL,BA0BB TEST AL,AL JNZ $+5 JMP IFA0130 MOV AL,BA0AA SUB AL,BA0ZR MOV BA0AA,AL RET IFA0130: MOV AL,BYTE PTR BA0C0 MOV BA0AA,AL RET SA0CH: MOV AL,BA0ZR CMP AL,BA0AA MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0BB,AL MOV AL,BA0AA CMP AL,BA0C9 MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0CC,AL MOV AL,BA0BB AND AL,BA0CC MOV BA0BB,AL MOV AL,BA0BB TEST AL,AL JNZ $+5 JMP IFA0131 MOV AL,BA0AA SUB AL,BA0ZR MOV BA0AA,AL RET IFA0131: MOV AL,BA0HA CMP AL,BA0AA MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0BB,AL MOV AL,BA0AA CMP AL,BA0HF MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0CC,AL MOV AL,BA0BB AND AL,BA0CC MOV BA0BB,AL MOV AL,BA0BB TEST AL,AL JNZ $+5 JMP IFA0132 MOV AL,BA0AA SUB AL,BA0HA MOV BA0AA,AL MOV AL,BA0CX ADD AL,BA0AA MOV BA0AA,AL RET IFA0132: MOV AL,BYTE PTR BA0C0 MOV BA0AA,AL RET SA0IN: MOV WA0LM,8920 MOV WA000,0 MOV WA001,1 MOV WA010,10 MOV WA009,9 MOV BA0C0,0 MOV BA0C1,1 MOV BA0C2,2 MOV BA0C3,3 MOV BA0EF,KA0EF MOV BA0C4,40 MOV BA0C8,80 MOV WA016,16 MOV BA0SP,0 MOV BA0C9,'9' MOV BA0ZR,'0' MOV BA0BL,' ' MOV BA0HF,'F' MOV BA0HA,'A' MOV BA0CX,10 MOV BX,WA001 MOV WA0BC,BX MOV BA0TR,'R' MOV DX, OFFSET BA0F1 CALL CLOSEIO MOV AL,1 MOV BX, OFFSET WA0BC CALL ATTACH MOV DX,OFFSET BA0F1 MOV BX,OFFSET BA0TR MOV SI,OFFSET WA0BC CALL OPENIO MOV BA0TR,'W' INC WA0BC MOV DX, OFFSET BA0F2 CALL CLOSEIO MOV AL,2 MOV BX, OFFSET WA0BC CALL ATTACH MOV DX,OFFSET BA0F2 MOV BX,OFFSET BA0TR MOV SI,OFFSET WA0BC CALL OPENIO MOV BX, OFFSET BA0AA MOV DX, OFFSET BA0F1 CALL BREAD MOV BA0OT,'T' MOV BA0UT,0 MOV BA0BB,'X' MOV AL,BA0BB CMP AL,BA0AA MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0UN,AL MOV BX, OFFSET BA0RB MOV DX, OFFSET BA0F1 CALL BREAD MOV BX, OFFSET BA0RC MOV DX, OFFSET BA0F1 CALL BREAD MOV BX, OFFSET BA0SF MOV DX, OFFSET BA0F1 CALL BREAD MOV BX, OFFSET BA0MF MOV DX, OFFSET BA0F1 CALL BREAD MOV BA0BB,'X' MOV AL,BA0MF CMP AL,BA0BB MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0133 MOV AL,BYTE PTR BA0C0 MOV BA0UO,AL JMP IFA0134 IFA0133: MOV AL,BYTE PTR BA0C1 MOV BA0UO,AL IFA0134: MOV BA0OP,'P' MOV BA0OE,'@' MOV BA0OD,'V' MOV BA0OB,'!' MOV BA0OS,'S' MOV BA0OH,'H' MOV BA0ON,'N' MOV BA0OL,'L' MOV BA0OC,'C' MOV BA0OA,'+' MOV BA0OR,'-' MOV BA0OM,'*' MOV BX, OFFSET BA0OG MOV DX, OFFSET BA0F1 CALL BREAD MOV BA0AA,'X' MOV AL,BA0AA CMP AL,BA0OG MOV AL,1 JZ $+4 MOV AL,0 MOV BA0BB,AL MOV AL,BA0BB TEST AL,AL JNZ $+5 JMP IFA0135 MOV BA0UG,0 JMP IFA0136 IFA0135: MOV BA0UG,1 IFA0136: MOV BX, OFFSET BA0CC MOV DX, OFFSET BA0F1 CALL BREAD MOV AL,BA0CC CMP AL,BA0NL MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0137 CALL MSG DB 'FLAG LINE' MOV AL,1 CALL STOP IFA0137: MOV WA0UU,100 RET SA0RM: MOV BX,WA000 MOV WA0II,BX MOV BH,0 MOV BL,BA0C0 MOV WA0NM,BX MOV BA0MM,127 TW0138: MOV BX, OFFSET BA0CC MOV DX, OFFSET BA0F1 CALL BREAD MOV AL,BA0ER CMP AL,BA0C0 MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0138 MOV AL,BA0CC MOV ERASER,AL JMP XA0140 RB 0-3 A0U139: MOV AL,BA0OE CMP AL,ERASER JZ $+5 JMP A0U141 MOV BX, OFFSET BA0CC MOV DX, OFFSET BA0F1 CALL BREAD JMP LOC77 JMP XA0140 RB 0-0 A0U141: MOV AL,BA0RB CMP AL,ERASER JZ $+5 JMP A0U142 MOV BX,WA0NM SHL BX,1 MOV AX,WA0II MOV WA0LP[BX],AX INC WA0NM MOV BA0ML,0 JMP XA0140 RB 0-0 A0U142: MOV AL,BA0NL CMP AL,ERASER JZ $+5 JMP A0U143 JMP XA0140 RB 0-0 A0U143: MOV AL,BA0LF CMP AL,ERASER JZ $+5 JMP A0U144 JMP XA0140 RB 0-0 A0U144: MOV AL,BA0RC CMP AL,ERASER JZ $+5 JMP A0U145 MOV BX,WA0II MOV AL,BA0RC MOV BA0LS[BX],AL INC WA0II MOV AL,BA0ML CMP AL,BA0MM LAHF AND AH,1 MOV BA0AA,AH MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0146 MOV AL,BYTE PTR BA0ML MOV BA0MM,AL IFA0146: TW0147: MOV BX, OFFSET BA0CC MOV DX, OFFSET BA0F1 CALL BREAD MOV AL,BA0LF CMP AL,BA0CC MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0147 JMP TW0147 BW0147: JMP XA0140 RB 0-0 A0U145: MOV AL,BA0OG CMP AL,ERASER JZ $+5 JMP A0U148 MOV AL,BA0UG TEST AL,AL JNZ $+5 JMP IFA0149 JMP IFA0150 IFA0149: JMP LOC77 IFA0150: JMP XA0140 RB 0-0 A0U148: LOC77: MOV BX,WA0II MOV AL,BA0CC MOV BA0LS[BX],AL INC WA0II MOV AX,WA0LM CMP AX,WA0II LAHF ROL AH,1 AND AH,1 MOV BA0AA,AH MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0151 CALL MSG DB 'MACMEMXST' CALL SA0CR MOV DX, OFFSET BA0F1 CALL CLOSEIO MOV AL,5 CALL STOP IFA0151: INC BA0ML XA0140: JMP TW0138 BW0138: MOV AL,BA0EF CMP AL,BA0CC MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0152 CALL MSG DB 'DEFN READ' MOV AL,2 CALL STOP IFA0152: MOV DX, OFFSET BA0F1 CALL CLOSEIO MOV WA0BC,3 MOV AL,3 MOV BX, OFFSET WA0BC CALL ATTACH MOV BA0TR,'R' MOV DX,OFFSET BA0F1 MOV BX,OFFSET BA0TR MOV SI,OFFSET WA0BC CALL OPENIO MOV BX,WA0II MOV WA0ED,BX CALL MSG DB 'LOADED...' MOV BX,WA0II MOV WA0TU,BX CALL SA0PN CALL MSG DB '.BYTES FO' CALL MSG DB 'R DEFINES' CALL SA0CR MOV BX,WA0NM SHL BX,1 MOV AX,WA0II MOV WA0LP[BX],AX MOV BX,WA0NM MOV WA0TU,BX CALL SA0PN CALL MSG DB '.MACROS..' MOV BH,0 MOV BL,BA0MM MOV WA0TU,BX CALL SA0PN CALL MSG DB ' MIN LEN.' CALL SA0CR RET SA0CR: MOV AL,BA0NL CALL WNX MOV AL,BA0LF CALL WNX RET SA0DM: MOV AX,WA0JJ ADD AX,WA001 MOV WA0MP,AX INC WA0NM MOV BX,WA0NM SHL BX,1 MOV AX,WA0LP[BX] MOV WA0DP,AX TW0153: MOV AX,WA0MP CMP AX,WA0DP LAHF ROL AH,1 AND AH,1 MOV BA0AA,AH MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP BW0153 MOV BX,WA0MP MOV AL,BA0LS[BX] MOV BA0AA,AL MOV AL,BA0UO TEST AL,AL JNZ $+5 JMP IFA0154 MOV AL,BA0AA CMP AL,BA0MF MOV AL,1 JZ $+4 MOV AL,0 MOV BA0AA,AL JMP IFA0155 IFA0154: MOV AL,BYTE PTR BA0C0 MOV BA0AA,AL IFA0155: MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0156 INC WA0MP MOV BX,WA0MP MOV AL,BA0LS[BX] MOV BA0O1,AL INC WA0MP MOV BX,WA0MP MOV AL,BA0LS[BX] MOV BA0AA,AL MOV AL,BYTE PTR BA0AA MOV BA0O2,AL CALL SA0CD MOV AL,BYTE PTR BA0AA MOV BA0DG,AL INC WA0MP MOV BX,WA0MP MOV AL,BA0LS[BX] MOV BA0O3,AL MOV AL,BA0UT TEST AL,AL JNZ $+5 JMP IFA0157 MOV AL,BA0O1 CALL WNX MOV AL,BA0O2 CALL WNX MOV AL,BA0O3 CALL WNX IFA0157: MOV AL,BA0O1 MOV ERASER,AL JMP XA0159 RB 0-3 A0U158: MOV AL,BA0OP CMP AL,ERASER JZ $+5 JMP A0U160 MOV BL,BA0DG MOV BH,0 SHL BX,1 MOV AX,WA0PR[BX] MOV WA0TU,AX JMP XA0159 RB 0-0 A0U160: MOV AL,BA0OD CMP AL,ERASER JZ $+5 JMP A0U161 MOV BL,BA0DG MOV BH,0 SHL BX,1 MOV AX,WA0PR[BX] MOV WA0AA,AX MOV AL,BYTE PTR WA0AA MOV BA0AA,AL CALL SA0CD MOV BH,0 MOV BL,BA0AA MOV WA0TU,BX JMP XA0159 RB 0-0 A0U161: MOV AL,BA0OB CMP AL,ERASER JZ $+5 JMP A0U162 MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0SS[BX] MOV WA0TU,AX MOV AL,BA0SP CMP AL,BA0C0 MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0163 CALL MSG DB 'S STACKER' CALL SA0CR MOV AL,BYTE PTR BA0C1 MOV BA0SP,AL IFA0163: DEC BA0SP JMP XA0159 RB 0-0 A0U162: MOV AL,BA0OS CMP AL,ERASER JZ $+5 JMP A0U164 MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0SS[BX] MOV WA0TU,AX JMP XA0159 RB 0-0 A0U164: MOV AL,BA0OH CMP AL,ERASER JZ $+5 JMP A0U165 MOV AL,BYTE PTR BA0O2 MOV BA0AA,AL CALL SA0CH MOV BH,0 MOV BL,BA0AA MOV WA0AA,BX MOV AX,WA0AA IMUL WA016 MOV WA0AA,AX MOV AL,BYTE PTR BA0O3 MOV BA0AA,AL CALL SA0CH MOV BH,0 MOV BL,BA0AA MOV WA0BB,BX MOV AX,WA0AA ADD AX,WA0BB MOV WA0TU,AX MOV AL,BYTE PTR BA0OC MOV BA0O3,AL JMP XA0159 RB 0-0 A0U165: MOV AL,BA0OL CMP AL,ERASER JZ $+5 JMP A0U166 MOV BH,0 MOV BL,BA0O2 MOV WA0TU,BX JMP XA0159 RB 0-0 A0U166: MOV AL,BA0ON CMP AL,ERASER JZ $+5 JMP A0U167 MOV AL,BYTE PTR BA0O2 MOV BA0AA,AL CALL SA0CD MOV BH,0 MOV BL,BA0AA MOV WA0TU,BX JMP XA0159 RB 0-0 A0U167: MOV AL,BA0OT CMP AL,ERASER JZ $+5 JMP A0U168 MOV BA0UT,1 JMP XA0159 RB 0-0 A0U168: MOV BX,WA0UU MOV WA0TU,BX INC WA0UU XA0159: MOV AL,BA0UT TEST AL,AL JNZ $+5 JMP IFA0169 MOV BX,WA0TU MOV WA0II,BX CALL SA0PN MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0SS[BX] MOV WA0TU,AX CALL SA0PN MOV BH,0 MOV BL,BA0SP MOV WA0TU,BX CALL SA0PN MOV BX,WA0II MOV WA0TU,BX CALL SA0CR IFA0169: MOV AL,BA0O3 MOV ERASER,AL JMP XA0171 RB 0-3 A0U170: MOV AL,BA0OC CMP AL,ERASER JZ $+5 JMP A0U172 MOV AL,BYTE PTR WA0TU MOV BA0AA,AL MOV BX, OFFSET BA0AA MOV DX, OFFSET BA0F2 CALL BWRITE JMP XA0171 RB 0-0 A0U172: MOV AL,BA0OS CMP AL,ERASER JZ $+5 JMP A0U173 INC BA0SP MOV AL,BA0C4 CMP AL,BA0SP MOV AL,0 JNBE $+4 MOV AL,1 MOV BA0AA,AL MOV AL,BA0AA TEST AL,AL JNZ $+5 JMP IFA0174 CALL MSG DB 'S OVERFLO' CALL SA0CR MOV AL,BYTE PTR BA0C4 MOV BA0SP,AL IFA0174: MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0TU MOV WA0SS[BX],AX JMP XA0171 RB 0-0 A0U173: MOV AL,BA0OP CMP AL,ERASER JZ $+5 JMP A0U175 MOV BL,BA0DG MOV BH,0 SHL BX,1 MOV AX,WA0TU MOV WA0PR[BX],AX JMP XA0171 RB 0-0 A0U175: MOV AL,BA0OA CMP AL,ERASER JZ $+5 JMP A0U176 MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0SS[BX] MOV WA0AA,AX MOV AX,WA0AA ADD AX,WA0TU MOV WA0AA,AX MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0AA MOV WA0SS[BX],AX JMP XA0171 RB 0-0 A0U176: MOV AL,BA0OR CMP AL,ERASER JZ $+5 JMP A0U177 MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0SS[BX] MOV WA0AA,AX MOV AX,WA0AA SUB AX,WA0TU MOV WA0AA,AX MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0AA MOV WA0SS[BX],AX JMP XA0171 RB 0-0 A0U177: MOV AL,BA0OM CMP AL,ERASER JZ $+5 JMP A0U178 MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0SS[BX] MOV WA0AA,AX MOV AX,WA0AA IMUL WA010 MOV WA0AA,AX MOV AX,WA0AA ADD AX,WA0TU MOV WA0AA,AX MOV BL,BA0SP MOV BH,0 SHL BX,1 MOV AX,WA0AA MOV WA0SS[BX],AX JMP XA0171 RB 0-0 A0U178: MOV AL,BA0OH CMP AL,ERASER JZ $+5 JMP A0U179 MOV AX,WA0TU MOV BA0AA,AH MOV BA0BB,AL MOV BX, OFFSET BA0AA MOV DX, OFFSET BA0F2 CALL BWRITE JMP XA0171 RB 0-0 A0U179: CALL SA0WN XA0171: JMP IFA0180 IFA0156: MOV BX,WA0MP MOV AL,BA0LS[BX] MOV BA0AA,AL MOV AL,BA0UN TEST AL,AL JNZ $+5 JMP IFA0181 MOV AL,BA0RC CMP AL,BA0AA MOV AL,1 JNZ $+4 MOV AL,0 MOV BA0BB,AL JMP IFA0182 IFA0181: MOV AL,BYTE PTR BA0C1 MOV BA0BB,AL IFA0182: MOV AL,BA0BB TEST AL,AL JNZ $+5 JMP IFA0183 MOV BX, OFFSET BA0AA MOV DX, OFFSET BA0F2 CALL BWRITE JMP IFA0184 IFA0183: MOV BX, OFFSET BA0NL MOV DX, OFFSET BA0F2 CALL BWRITE MOV BX, OFFSET BA0LF MOV DX, OFFSET BA0F2 CALL BWRITE IFA0184: IFA0180: INC WA0MP JMP TW0153 BW0153: MOV BA0UT,0 RET END START