Prev: 802F Up: Map Next: 8100
80BC: Prepare to load the standard speed code block
This section of code is executed immediately after the fast code block has loaded. First of all, it modifies the loading routines at 8000 and 802F to make them suitable for loading a standard speed block.
80BC LD B,$0B Do the 11 POKEs in the POKE table at 8100; these POKEs convert the fast loading routines into standard speed loading routines, ready for the final code block on the tape
80BE LD D,$80
80C0 LD HL,$8100
80C3 LD E,(HL)
80C4 INC L
80C5 LD A,(HL)
80C6 LD (DE),A
80C7 INC L
80C8 DJNZ $80C3
Now a checksum of the bytes at addresses 8100-81AB (just loaded from tape) is calculated.
80CA LD L,B HL=8100
80CB LD E,B DE=0000
80CC LD D,B
80CD LD B,$AC Create 'checksums' in A and E of the 172 bytes at addresses 8100-81AB
80CF LD A,(HL)
80D0 ADD A,E
80D1 LD E,A
80D2 LD A,(HL)
80D3 XOR D
80D4 LD D,A
80D5 INC L
80D6 DJNZ $80CF
80D8 LD L,$28 HL=8128
80DA CP $4B Is the checksum in A correct?
80DC JP NZ,$0000 Reset the Spectrum if not
80DF LD A,E Is the checksum in E correct?
80E0 CP $AF
80E2 JP Z,$8116 Jump if so
80E5 JP $0000 Otherwise reset the Spectrum
Prev: 802F Up: Map Next: 8100