C64 ROM | Routines |
Prev: ACFC | Up: Map | Next: AD8A |
|
||||
AD1E | D0 04 | BNE $AD24 | branch if NEXT variable | |
AD20 | A0 00 | LDY #$00 | else clear Y | |
AD22 | F0 03 | BEQ $AD27 | branch always | |
NEXT variable
|
||||
AD24 | 20 8B B0 | JSR $B08B | get variable address | |
AD27 | 85 49 | STA $49 | save FOR/NEXT variable pointer low byte | |
AD29 | 84 4A | STY $4A | save FOR/NEXT variable pointer high byte (high byte cleared if no variable defined) | |
AD2B | 20 8A A3 | JSR $A38A | search the stack for FOR or GOSUB activity | |
AD2E | F0 05 | BEQ $AD35 | branch if FOR, this variable, found | |
AD30 | A2 0A | LDX #$0A | else set error $0A, next without for error | |
This entry point is used by the routine at AC0F.
|
||||
AD32 | 4C 37 A4 | JMP $A437 | do error #X then warm start | |
found this FOR variable
|
||||
AD35 | 9A | TXS | update stack pointer | |
AD36 | 8A | TXA | copy stack pointer | |
AD37 | 18 | CLC | clear carry for add | |
AD38 | 69 04 | ADC #$04 | point to STEP value | |
AD3A | 48 | PHA | save it | |
AD3B | 69 06 | ADC #$06 | point to TO value | |
AD3D | 85 24 | STA $24 | save pointer to TO variable for compare | |
AD3F | 68 | PLA | restore pointer to STEP value | |
AD40 | A0 01 | LDY #$01 | point to stack page | |
AD42 | 20 A2 BB | JSR $BBA2 | unpack memory (AY) into FAC1 | |
AD45 | BA | TSX | get stack pointer back | |
AD46 | BD 09 01 | LDA $0109,X | get step sign | |
AD49 | 85 66 | STA $66 | save FAC1 sign (b7) | |
AD4B | A5 49 | LDA $49 | get FOR/NEXT variable pointer low byte | |
AD4D | A4 4A | LDY $4A | get FOR/NEXT variable pointer high byte | |
AD4F | 20 67 B8 | JSR $B867 | add FOR variable to FAC1 | |
AD52 | 20 D0 BB | JSR $BBD0 | pack FAC1 into FOR variable | |
AD55 | A0 01 | LDY #$01 | point to stack page | |
AD57 | 20 5D BC | JSR $BC5D | compare FAC1 with TO value | |
AD5A | BA | TSX | get stack pointer back | |
AD5B | 38 | SEC | set carry for subtract | |
AD5C | FD 09 01 | SBC $0109,X | subtract step sign | |
AD5F | F0 17 | BEQ $AD78 | branch if =, loop complete | |
loop back and do it all again
|
||||
AD61 | BD 0F 01 | LDA $010F,X | get FOR line low byte | |
AD64 | 85 39 | STA $39 | save current line number low byte | |
AD66 | BD 10 01 | LDA $0110,X | get FOR line high byte | |
AD69 | 85 3A | STA $3A | save current line number high byte | |
AD6B | BD 12 01 | LDA $0112,X | get BASIC execute pointer low byte | |
AD6E | 85 7A | STA $7A | save BASIC execute pointer low byte | |
AD70 | BD 11 01 | LDA $0111,X | get BASIC execute pointer high byte | |
AD73 | 85 7B | STA $7B | save BASIC execute pointer high byte | |
AD75 | 4C AE A7 | JMP $A7AE | go do interpreter inner loop | |
NEXT loop comlete
|
||||
AD78 | 8A | TXA | stack copy to A | |
AD79 | 69 11 | ADC #$11 | add $12, $11 + carry, to dump FOR structure | |
AD7B | AA | TAX | copy back to index | |
AD7C | 9A | TXS | copy to stack pointer | |
AD7D | 20 79 00 | JSR $0079 | scan memory | |
AD80 | C9 2C | CMP #"," | compare with "," | |
AD82 | D0 F1 | BNE $AD75 | if not "," go do interpreter inner loop | |
was "," so another NEXT variable to do
|
||||
AD84 | 20 73 00 | JSR $0073 | increment and scan memory | |
AD87 | 20 24 AD | JSR $AD24 | do NEXT variable |
Prev: ACFC | Up: Map | Next: AD8A |