User guide

BOT &E000 FORCE; force low address to be &E000, EPROM start
; The above is important!
; Because we are assembling ROM code, we want only &E000 to
; &FFFF to be saved, but we also want to set up locations
; in page zero so we can refer to them by label.
; B I O S C O D E F O L L O W S
; =================================
ORG &F000 ; The BIOS sits in the second half of the EPROM
; R E S E T The "reset_vector" label is required by
; --------- required by the ROM instruction
.nmi_vector ; because NMIs are not used in this example...
.reset_vector
NOP
SEI ; should be already, but no guarantees
CLD ; undefined at NMOS 6502 init
LDX #&FF ; reset stack pointer
TXS
; we’d reset hardware devices here too
; and suspend all sources of IRQs
; ******* lots snipped *******
CLI ; Re-allow interrupts
; BIOS startup complete! Call application...
JMP app_code_entry
.irq_vector
NOP
RTI ; In reality, a LOT more would happen!
CNT "appcode.s65" ; Continue in the "appcode" file.
Meanwhile the “appcode.s65” file will look like:
; A P P L I C A T I O N C O D E v0.01 2001/01/01 at 01h01
; ===============================
ORG &E000 ; The application code is the first half of the EPROM
.app_code_entry
JMP app_code_entry ; do nothing, it's just an example!
This is just to give you an ‘idea’ of the layout of the code. To make things tidier, the BIOS and the application
code are in separate files. This would also be the case if a debugger was included. In this manner it is possible
to mix and match parts; perhaps different application codes (depending on needs/features) using the same
BIOS? Perhaps debugging support in test versions but not release versions? More flexible than a giant single
source file.
To assemble, enter at the command line:
6502asm mybios.s65 mybios.img
6502asm user guide – prerelease version
page 17