Routines

61658: Control teacher during assembly


Used by table of A&P number 80

H Character number of teacher (201-203)

61658 3AE47F LD A,(32740) A=MSB of lesson time counter (starts off at 16)
61661 FE02 CP 2 Has the teacher been standing still long enough?
61663 DA8C63 JP C,25484 Move to the next instruction in the table of A&P if so
61666 FE0B CP 11
61668 D0 RET NC
61669 7C LD A,H A=character number of teacher
61670 FEC9 CP 201 Is this MR WITHIT?
61672 C0 RET NZ Return if not
61673 11807F LD DE,32640 Set bits 6 (ERIC should be here now) and 7 (time to sit down: this is checked by tables of A&P numbers 20, 40 and 88) at 32640
61676 1A LD A,(DE)
61677 F6C0 OR 192
61679 12 LD (DE),A
61680 3AE47F LD A,(32740) A=MSB of lesson time counter
61683 FE0A CP 10 Is ERIC supposed to be in the assembly hall by now?
61685 D0 RET NC Return if not
61686 CD157D CALL 32021 Is ERIC in the assembly hall?
61689 C8 RET Z Return if so
61690 C3D0F0 JP 61648 Go and find him otherwise