Prev: $24A7 Up: Map Next: $253E
$2500: Prepare a message telling the kids to go to a certain page in their books
Used by the routines at $09E9, $0A58 and $0B3B.
$2500 LDA $D41B Generate a random number in A.
$2503 ORA #$80 Set bit 7 to ensure that the number has three digits and store the result as a two-byte value at $A3. This will be the page number.
$2505 STA $A3
$2507 LDA #$00
$2509 STA $A4
$250B JSR $217E Generate the character codes for the digits of this value.
$250E LDA $D41B Generate a random value in A.
$2511 ASL A Is bit 7 set?
$2512 BCS $251F Branch if so.
$2514 LDA #$9D $9D is the LSB of $5C9D: ANSWER THE QUESTIONS ON PAGE 123 OF YOUR LOVELY TEXTBOOK.
$2516 STA $AC
$2518 LDA #$BA $BA is the LSB of the address of the '1' in this message.
$251A STA $4E
$251C JMP $2527 Jump forward.
$251F LDA #$62 $62 is the LSB of $5C62: TURN TO PAGE 123 OF YOUR BOOKS,BE SILENT AND START READING.
$2521 STA $AC
$2523 LDA #$6F $6F is the LSB of the address of the '1' in this message.
$2525 STA $4E
$2527 LDA #$5C Set the MSB of the message address at $AC.
$2529 STA $AD
$252B STA $4F Set the MSB of the address of the '1' at $4E.
$252D LDY #$00 Copy the character codes of the digits of the page number from $8C, $8D and $8E into the message.
$252F LDA $8C
$2531 STA ($4E),Y
$2533 INY
$2534 LDA $8D
$2536 STA ($4E),Y
$2538 INY
$2539 LDA $8E
$253B STA ($4E),Y
$253D RTS
Prev: $24A7 Up: Map Next: $253E