Skip to content

Commit

Permalink
GTRi failide lugemise moodul VAKSTU kettalt
Browse files Browse the repository at this point in the history
  • Loading branch information
boamaod committed Dec 26, 2024
1 parent ee0cbbe commit 56d9946
Showing 1 changed file with 263 additions and 0 deletions.
263 changes: 263 additions & 0 deletions src/pmood.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
;*************************************************
;** GTR-i pildilugemismoodul: **
;** **
;** SISEND: LXI H,PILT **
;** PUSH H **
;** CALL PMOOD **
;** **
;*************************************************
.printx /Processing PMOOD/
pmood:: MVI A,0C9H
STA PESA1
POP H
XTHL
PUSH H
CALL ALAM1
PUSH H
CALL ALAM2
POP H
MVI A,0C3H
STA PESA1
JMP ALAM1
ALAM1: PUSH H
CALL ALAM3
POP H
CALL ALAM4
PUSH H
CALL ALAM5
POP H
JMP ALAM4
ALAM6: STA MSG1+1
LXI B,MSG1
JMP 0FFCDH
ALAM5: MVI A,28H
JMP ALAM6
ALAM3: MVI A,27H
JMP ALAM6
MSG1: DB 1BH,0,24H,0
ALAM4: MOV A,M
INX H
STA PESA2
CPI 0FFH
RZ
PUSH H
MVI E,1BH
CALL ALAM7
MVI E,59H
CALL ALAM7
LDA PESA2
CALL ALAM8
POP H
MOV A,M
INX H
PUSH H
CALL ALAM8
POP H
MOV A,M
INX H
STA PESA3
ALAM9: MOV E,M
INX H
PUSH H
CALL ALAM7
POP H
LDA PESA3
DCR A
STA PESA3
JNZ ALAM9
JMP ALAM4
ALAM7: MOV A,E
PESA1: DB 0C9H,0D9H,0FFH,0C9H
ALAM8: ADI 20H
MOV E,A
JMP ALAM7
ALAM2: POP H
XTHL
MOV A,M
INX H
CPI 00H
JNZ ALAM10
MVI A,48H
STA PESA4
LXI D,0D800H
ALAM24: XRA A
STA PESA5
MOV A,M
CPI 00H
JZ ALAM11
MVI B,0
RLC
JNC ALAM12
MVI B,0FFH
ALAM12: RLC
MOV A,M
JNC ALAM13
ANI 3FH
MOV C,B
MOV B,A
MOV A,C
INX H
MOV C,M
JMP ALAM14
ALAM13: ANI 3FH
MOV C,A
MOV A,B
MVI B,0
ALAM14: STA PESA6
ALAM18: LDA PESA4
CPI 56H
LDA PESA6
JZ ALAM15
STAX D
INX D
JMP ALAM16
ALAM15: XTHL
CALL ALAM17
XTHL
ALAM16: DCR C
JNZ ALAM18
INR B
DCR B
JZ ALAM19
MOV C,B
ALAM22: LDA PESA4
CPI 56H
LDA PESA6
JZ ALAM20
STAX D
INX D
JMP ALAM21
ALAM20: XTHL
CALL ALAM17
XTHL
ALAM21: DCR C
JNZ ALAM22
MVI C,0FFH
DCR B
JP ALAM22
ALAM19: LDA PESA5
ORA A
JZ ALAM23
INX H
JMP ALAM24
ALAM23: INX H
MOV A,M
CPI 0
JNZ ALAM25
INX H
JMP ALAM24
ALAM25: STA PESA5
RLC
JNC ALAM26
MOV A,M
ANI 7FH
MOV B,A
ANI 40H
JNZ ALAM27
INX H
MOV C,M
JMP ALAM28
ALAM27: MOV A,M
ANI 3FH
MOV B,A
INX H
MOV C,M
JMP ALAM29
ALAM30: MOV A,M
ANI 3FH
MOV C,A
MVI B,0
ALAM29: INX H
MOV A,M
JMP ALAM14
ALAM26: RLC
JC ALAM30
MOV C,M
MVI B,0
ALAM28: INX H
ALAM33: LDA PESA4
CPI 56H
MOV A,M
INX H
JZ ALAM31
STAX D
INX D
JMP ALAM32
ALAM31: XTHL
CALL ALAM17
XTHL
ALAM32: DCR C
JNZ ALAM33
INR B
DCR B
JZ ALAM24
MOV C,B
ALAM36: LDA PESA4
CPI 56H
MOV A,M
INX H
JZ ALAM34
STAX D
INX D
JMP ALAM35
ALAM34: XTHL
CALL ALAM17
XTHL
ALAM35: DCR C
JNZ ALAM36
MVI C,0FFH
DCR B
JP ALAM36
JMP ALAM24
ALAM10: CPI 0FFH
RNZ
MVI A,56H
STA PESA4
PUSH H
LXI H,0D800H
SHLD PESA7
LXI D,0028H
XTHL
MVI A,0E6H
STA PESA8
JMP ALAM24
MOV M,A
DAD D
LDA PESA8
DCR A
LXI H,0D800H
SHLD PESA7
LXI D,0028H
XTHL
MVI A,0E6H
STA PESA8
JMP ALAM24
ALAM17: MOV M,A
DAD D
LDA PESA8
DCR A
STA PESA8
RNZ
MVI A,0E6H
STA PESA8
LHLD PESA7
INX H
SHLD PESA7
RET
PESA2: DB 0
PESA3: DB 0
PESA4: DB 0
PESA5: DB 0
PESA6: DB 0
PESA7: DW 0
PESA8: DB 0
ALAM11: INX H
MOV A,M
CPI 0
JNZ ALAM25
LDA PESA4
CPI 48H
RZ
POP H
RET


0 comments on commit 56d9946

Please sign in to comment.