Apple II series ROM contains a simple but powerful machine level monitor to display and modify machine's memory. While original Apple II actually starts up directly in the monitor, later Apple models automatically boot into the BASIC program.
Monitor also includes a mini-assembler, a very rudimentary assembler for 6502.
Entering the Monitor from BASIC can be done by executing CALL -151
:
] CALL -151
*
Exiting the monitor can be accomplished in multiple ways:
Control-B
(and ENTER) - will do a cold start (jumps to address $E000
)Control-Y
(and ENTER) - will do a warm start (jumps to address $E003
)While Mini-assembler seems to be included with all Apple II models except Apple II+, invoking it depends on the machine type:
!
in the monitor promptF666G
in the monitor promptOnce in the mini-assembler, the prompt should change to !
and you can start
entering the instructions.
To test this out, here's a small program that prints "APPLE" on the screen. Note
that all the entry lines start with !
-prompt:
! 300: JSR FC58
0300- 20 58 FC JSR $FC58
! LDA #C1
0303- A9 C1 LDA #$C1
! STA 700
0305- 8D 00 07 STA $0700
! LDA #D0
0308- A9 D0 LDA #$D0
! STA 701
030A- 8D 01 70 STA $0701
! STA 702
030D- 8D 02 70 STA $0702
! LDA #CC
0310- A9 CC LDA #$CC
! STA 703
0312- 8D 03 70 STA $0703
! LDA #C5
0315- A9 C5 LDA #$C5
! STA 704
0317- 8D 04 70 STA $0704
! RTS
031A- 60 RTS
Now that program has been inserted, exit by just pressing enter in the prompt.
In the monitor, one can inspect the code using the L
(list) command by prepending
the address to it:
* 300L
0300 20 58 FC JSR $FC58
0303 A9 C1 LDA #$C1
0305 8D 00 07 STA $0700
0308 A9 D0 LDA #$D0
030A 8D 01 70 STA $0701
030D 8D 02 70 STA $0702
0310 A9 CC LDA #$CC
0312 8D 03 70 STA $0703
0315 A9 C5 LDA #$C5
0317 8D 04 70 STA $0704
031A 60 RTS
...
And to run this, use the G
(Go) command:
* 300G
If everything was typed in correctly, the screen should clear and you'll end up
with APPLE
written on sreen.
I have mostly used Roger Wagner's book "Assembly Lines: The Complete Book" to get myself started. It's also available on the Archive.org.