Prev: 1C9B Up: Map Next: 1D66
1D15: check_footer: Check row 23 of recieved page for telesoftware footer.
Used by the routine at telesoftware_main.
check_footer 1D15 LD DE,(page_receive_buffer_pointer) Set HL to page_receive_buffer_pointer + 920 (row 23 of receive buffer).
1D19 LD HL,$0398
1D1C ADD HL,DE
1D1D LD A,$43 If byte in column 0 is not $43 ('C') jump to check_footer_0.
1D1F CP (HL)
1D20 JP NZ,check_footer_0
1D23 INC HL If byte in column 1 is not $4F ('O') jump to check_footer_0.
1D24 LD A,$4F
1D26 CP (HL)
1D27 JR NZ,check_footer_0
1D29 INC HL If byte in column 2 is not $CD ('M' + parity) jump to check_footer_0.
1D2A LD A,$CD
1D2C CP (HL)
1D2D JP NZ,check_footer_0
1D30 INC HL If byte in column 3 is not $D0 ('P' + parity) jump to check_footer_0.
1D31 LD A,$D0
1D33 CP (HL)
1D34 JR NZ,check_footer_0
1D36 INC HL If bit 6 of byte in column 5 is clear jump to check_footer_1.
1D37 INC HL
1D38 LD A,(HL)
1D39 BIT 6,A
1D3B JP Z,check_footer_1
1D3E AND $3F Store lower 6 bits (number of blocks) in D.
1D40 LD D,A
1D41 INC HL If bit 6 of byte in column 7 is clear jump to check_footer_1.
1D42 INC HL
1D43 LD A,(HL)
1D44 BIT 6,A
1D46 JP Z,check_footer_1
1D49 AND $3F If lower 6 bits of byte (block number) is greater than or equal to D jump to check_footer_1.
1D4B CP D
1D4C JP P,check_footer_1
1D4F LD E,A Else set HL to $4800 + block number (offset in map of received blocks).
1D50 LD D,$00
1D52 LD HL,$4800
1D55 ADD HL,DE
1D56 LD A,(HL) If byte at address in HL equals zero return $00, else jump to check_footer_2.
1D57 OR A
1D58 JP NZ,check_footer_2
1D5B XOR A Return $00 (ok).
1D5C RET
check_footer_0 1D5D LD A,$01 Return $01 (not data).
1D5F RET
check_footer_1 1D60 LD A,$02 Return $02 (bad page).
1D62 RET
check_footer_2 1D63 LD A,$03 Return $03 (already received).
1D65 RET
Prev: 1C9B Up: Map Next: 1D66