Prev: A955 Up: Map Next: A9DE
A97E: main_loop_20
Used by the routines at main_loop and cpu_driver.
main_loop_20 A97E LD A,$00 A = <self modified> -- Self modified by A974
A980 AND A Return if A is zero
A981 RET Z
A982 LD IYh,$E3 IY = $E361
A985 LD IYl,$61
A988 LD BC,$1400 BC = $1400
A98B LD HL,$ED28 Point HL at (something above the stack)
Scan through whatever-it-is for a non-zero byte. Move 4 bytes per iteration.
ml20_loop1 A98E LD A,(HL) A = *HL++
A98F AND A Set flags
A990 INC HL
A991 JR NZ,main_loop_20_0 Jump to A9A7 if non-zero
A993 INC HL HL += 3
A994 INC HL
A995 INC HL
ml20_loop1_continue A996 DEC IY IY--
A998 DJNZ ml20_loop1 Loop to ml20_loop1 while B
A99A LD A,C A = C
A99B AND A Set flags
A99C RET NZ Return if non-zero
A99D LD ($A97F),A Self modify LD A @ main_loop_20
A9A0 LD ($C0BC),A Self modify LD A @ rm_c0bb
A9A3 LD ($A9DF),A Self modify LD A @ sub_A9DE
A9A6 RET Return
main_loop_20_0 A9A7 LD A,(HL) A = *HL++
A9A8 INC HL
A9A9 INC C C++
A9AA EXX
A9AB EX AF,AF' Bank A
A9AC LD A,(IY+$01) L = ~(IY[1] * 2)
A9AF ADD A,A
A9B0 CPL
A9B1 LD L,A
A9B2 LD H,$E8 H = $E8
A9B4 LD D,(HL) D = *HL
A9B5 DEC L L--
A9B6 LD E,(HL) E = *HL
A9B7 LD H,$EC H = $EC
A9B9 LD A,(HL) A = *HL
A9BA INC L L++
A9BB LD H,(HL) H = *HL
A9BC LD L,A L = A
A9BD AND A Set flags
A9BE PUSH DE
A9BF SBC HL,DE HL -= DE
A9C1 EX DE,HL
A9C2 LD HL,$0000 HL = $0000
A9C5 EX AF,AF' Unbank A
Multiplier.
A9C6 LD B,$08 B = 8
ml20_loop2 A9C8 RLA
A9C9 JR NC,main_loop_20_1 If carry HL += DE
A9CB ADD HL,DE
main_loop_20_1 A9CC ADD HL,HL HL <<= 1
A9CD DJNZ ml20_loop2 Loop to ml20_loop2 while B
A9CF LD A,H A = H
A9D0 RRA
A9D1 LD C,A C = A
A9D2 POP HL
A9D3 ADD HL,BC HL += BC
A9D4 PUSH HL
A9D5 EXX
A9D6 POP DE
A9D7 LD (HL),E DE = wordat(HL); HL += 2
A9D8 INC HL
A9D9 LD (HL),D
A9DA INC HL
A9DB JP ml20_loop1_continue Jump to ml20_loop1_continue
Prev: A955 Up: Map Next: A9DE