.RADIX 16 RLAT SET 0BFEC SYMB EQU 0E2E9 KL EQU 0E18F INV EQU 0E850 STAT SET 0E113 JMP MAIN DGRF: DB 1F,"*** ZNAKO GENERATOR Version 2.0 ***",0D,0A DB 0D,0A,"Addr Hex Dec " DTB: DB "0 1 2 3 4 5 6 7 8 9 A B C D E F",0 MAIN: LXI H,4000 SHLD TABL0 MVI A,8 STA LONG MAIF1: LHLD TABL0 MAIS: SHLD TABL MON: XRA A STA END ZNG: LXI D,DGRF CALL PRINT MVI A,22 STA WERT XRA A STA HORZ MOV C,A GRF: CALL GRAF INR C JNZ GRF LXI D,030E CALL SCRN LXI H,DTB MVI D,10 STLB: MOV C,M CALL SYM MVI C,0A CALL SYM MVI C,08 CALL SYM INX H INX H DCR D JNZ STLB ZG0: MVI D,0 ; HL=HL+A*LONG LDA END MOV E,A LXI H,0 LDA LONG ZG: DAD D DCR A JNZ ZG XCHG LHLD TABL DAD D ; END SHLD MTO LXI D,1400 CALL SCRN LXI D,MNUD CALL PRINT LXI D,0200 CALL SCRN CALL CRLF LDA END CALL HEX MVI C," " CALL SYM LDA END CALL DVDES CALL D0A LDA LONG CALL DVDES LDA LONG MOV D,A ZG1: CALL D0A MVI E,80 ZG2: MOV A,M ANA E MVI C,7F JZ TCHK MVI C,0FF TCHK: CALL SYM MOV A,E RRC MOV E,A JNC ZG2 DCR D JZ NEXT INX H JMP ZG1 NEXT: LHLD MTO MVI A,01 STA END+1 STA END+2 LXI D,0507 CALL SCRN NEX1: CALL KLVC CPI "A" JZ ADDR CPI "H" JZ JMP CPI "M" JZ MOV CPI "I" JZ INVR CPI "R" JZ ROTR CPI "L" JZ ROTL CPI "+" JZ LNGP CPI "-" JZ LNGM CPI 0D JZ ZNG CPI 9E ;F1 JZ MAIF1 CPI 81 ;F2 JZ F2 CPI 86 ;F3 JZ F3 CPI 20 JZ DOT CPI 93 JZ LEFT CPI 84 JZ RGHT CPI 85 JZ UP CPI 98 JZ DOWN CPI 83 JZ ZG3 CPI 92 JNZ NEX1 LDA END ;IF F4 DCR A JMP ZG4 ZG3: LDA END ;IF F5 INR A ZG4: STA END JMP ZG0 F2: LXI H,0000 LXI D,0100 LDA LONG F2m: DAD D DCR A JNZ F2m SHLD Longa XCHG LHLD TABL0 DAD D JMP MAIS F3: LHLD Longa XCHG LHLD TABL0 DAD D DAD D JMP MAIS DOT: LDA END+1 MOV B,A MVI C,0FF ANA M JZ DT1 MVI C,7F DT1: MOV A,M XRA B MOV M,A CALL SYM MVI C,08 JMP RET LEFT: LDA END+1 RLC JC NEX1 STA END+1 MVI C,08 JMP RET RGHT: LDA END+1 RRC JC NEX1 STA END+1 MVI C,18 JMP RET UP: LDA END+2 DCR A JZ NEX1 STA END+2 DCX H MVI C,19 JMP RET DOWN: LDA LONG MOV B,A LDA END+2 CMP B JZ NEX1 INR A STA END+2 INX H MVI C,0A RET: CALL SYM JMP NEX1 VERH: MVI C,0C JMP SYM ADDR: LXI D,0300 CALL SCRN LXI H,TABL0+1 CALL POKH JC ADDR JMP MAIF1 JMP: LXI D,0306 CALL SCRN LXI H,END CALL POK JC JMP JMP ZG0 LNGP: LDA LONG CPI 10 JZ ZNG INR A STA LONG JMP MON LNGM: LDA LONG CPI 1 JZ ZNG DCR A STA LONG JMP MON INVR: LXI H,0000 LXI D,00FF LDA LONG IND: DAD D DCR A JNZ IND XCHG LHLD TABL IVR0: MOV B,M ;BEGIN A=INV M MVI A,08 IVR1: STA EGHT MOV A,B RAL MOV B,A MOV A,C RAR MOV C,A LDA EGHT DCR A JNZ IVR1 MOV M,C ;END INX H DCR E JNZ IVR0 DCR D JNZ IVR0 JMP ZNG ROTR: LHLD MTO LDA LONG DCR A MOV B,M RTR0: INX H MOV C,M DCX H MOV M,C INX H DCR A JNZ RTR0 MOV M,B JMP ZG0 ROTL: LHLD MTO LDA LONG MOV B,A RTR1: MOV A,M RRC MOV M,A INX H DCR B JNZ RTR1 JMP ZG0 MDAT:DB "Mov",0 MOV: LXI D,0205 CALL SCRN LXI D,MDAT CALL PRINT LXI D,0306 CALL SCRN LXI H,MFOR CALL POK JC MOV LXI H,0 MVI D,0 ; HL=HL+A*LONG LDA MFOR MOV E,A DAD H PUSH H POP D DAD H PUSH H POP B DAD H DAD D DAD B XCHG LHLD TABL DAD D ; END MFOR XCHG LHLD MTO LDA LONG MOV B,A MCKL: LDAX D MOV M,A INX H INX D DCR B JNZ MCKL JMP ZNG POKH: CALL POK RC DCX H POK: MVI B,1 PK1: CALL KLV MOV C,A CPI 08 STC RZ PK2: CALL POKE MOV A,B ORA A JNZ PK1 RET POKE: CPI 47 RP CPI 30 RM SUI 30 CPI 0A JM M4 SUI 7 M4: PUSH PSW CALL HE1 MOV A,B CPI 2 JZ M5 MOV A,M ANI 0F MOV B,A POP PSW RLC RLC RLC RLC ADD B MOV M,A MVI B,2 RET M5: MOV A,M ANI 0F0 MOV B,A POP PSW ADD B MOV M,A XRA A MOV B,A RET DVDES: LXI D,0 MVI B,8 MOV C,A DV1: MOV A,C RLC MOV C,A MOV A,E ADC E DAA MOV E,A MOV A,D ADC D DAA MOV D,A DCR B JNZ DV1 MOV A,D ANI 0F CALL HE1 MOV A,E JMP HEX HEXH: MOV A,H CALL HEX MOV A,L HEX: PUSH PSW ANI 0F0 RRC RRC RRC RRC CALL HE1 POP PSW PUSH PSW ANI 0F CALL HE1 POP PSW RET HE1: PUSH D LXI D,DANN ADD E JNC HE2 INR D HE2: MOV E,A LDAX D MOV C,A CALL SYM POP D RET DANN: DB "0123456789ABCDEF",0 CRLF: MVI C,0A CALL SYM CRD0: CALL A0D CALL HEXH PRB: MVI C,20 CALL SYM JMP SYM D0A: MVI C,0A CALL SYM A0D: MVI C,0D JMP SYM SYM: MOV A,C ANI 80 JZ RUS MVI A,01 RUS: STA RLAT CALL SYMB RET KLVC: CALL KLV MOV C,A CPI 03 RNZ CALL NIZ LXI D,PS CALL PRINT JMP 0 KLV: PUSH H PUSH D PUSH B LXI H,0 KL1: CALL STAT ORA A JNZ KL0 KL2: DCR A JNZ KL2 DCR H JNZ KL1 CALL INV INR L JMP KL1 KL0: MOV A,L ANI 01 CNZ INV POP B POP D POP H CALL KL RET CURC: MOV C,E CURS: CALL SYM DCR D RZ JMP CURS NIZ: LXI D,1500 SCRN: CALL VERH ;TAB PRINT MOV A,D ORA A MVI C,0A SCR0: JZ SCR1 CALL SYM DCR D JNZ SCR0 SCR1: MOV A,E MVI C,18 ORA A RZ SCR2: CALL SYM DCR E JNZ SCR2 RET PRINKL: CALL PRIND JMP KLVC PRIND: CALL D0A PRINT: MVI B,10 PRNT: LDAX D ORA A RZ CPI 0D JNZ PPRI DCR B JNZ PPRI CALL KLVC MVI B,10 LDAX D PPRI: MOV C,A CALL SYM INX D JMP PRNT GRAF: PUSH H PUSH D PUSH B MVI D,0 MOV E,C ;BEGIN DE=C*LONG LDA LONG LXI H,0 GR: DAD D DCR A JNZ GR XCHG LHLD TABL DAD D ;HL=TABL+DE LDA WERT MOV E,A LDA 0BFEB ADD E MOV E,A LDA HORZ ADI 0D0 MOV D,A LDA LONG MOV B,A DI MVI A,10 OUT 0C1 MO1: PUSH D PUSH B MOV B,M ;BEGIN A=INV M MVI E,8 MO5: MOV A,B RAL MOV B,A MOV A,C RAR MOV C,A DCR E JNZ MO5 MOV A,C ;END POP B POP D STAX D INR E INX H DCR B JNZ MO1 XRA A OUT 0C1 EI INR D INR D MOV A,D CPI 0F0 JNZ MO2 LDA WERT MOV B,A LDA LONG ADD B STA WERT XRA A STA HORZ JMP MO3 MO2: SUI 0D0 STA HORZ MO3: POP B POP D POP H RET PS: DB " (C) AZMaster -1993- ,Moskow RU.",0 MNUD: DB "[F1] [F2] [F3] [F4] [F5] [A] [H] [M] [I] [R,L]",0 TABL0: DB 0,0 TABL: DB 0,0 Longa: DB 0,0 END: DB 0,0,0 RGH: DB 0,0 MTO: DB 0,0 EGHT: DB 0 WERT: DB 0 HORZ: DB 0 LONG: DB 0 MFOR: DB 0 .PRINTX "END FILE" END