1
0
mirror of https://github.com/pfusik/xasm.git synced 2024-11-11 19:04:36 +00:00
xasm/doc/xloadstd.asx
2013-01-07 12:07:28 +01:00

60 lines
1.3 KiB
Plaintext

* Boot executable file loader coded by Fox/Taquart
* Receives file from X-LOAD via SIO2PC interface.
* Standard loader - ROM and interrupts enabled while running loaded program.
opt h-
org $700
* Boot code
boot dta b(0,1),a(boot) Boot header
arts dta a(rts)
dta b({lda #$60}) Skip rts
rts rts
sei Disable interrupts
inc ^4e
mva #$08 ^24 Set transmission speed
mva #$00 ^26
mva #$28 ^28
sta ^29 Reset counters
mva #$23 ^2f Send enable
sta ^2d Send a byte
wait sta ^4a Wait until sent
asl @
bcc wait
mva #$13 ^2f Receive enable
ldy #2
head jsr get Receive address (high/low byte)
sta stor,y
mva arts-1,y $2e2-1,y Set init address
pha Put return address on stack
dey
bne head
jsr get Receive length (one byte)
tax
load jsr get Receive data
stor sta a:0,x+ Store in memory
bne load
mva $10 ^2e Reset POKEY
mva #3 ^2f
lsr ^4e Enable interrupts
cli
init jmp ($2e2) Call init routine
get lda #$20 Function: Receive one byte
sta ^2e Enable receive interrupt
bit:rne ^2e Wait for interrupt request
sty ^2e Disable receive interrupt
lda ^2d Get byte
rts
:boot+$80-* dta b(0) Padd with zeros to full sector
* X-LOAD adds this block at the end of loaded file
* It changes jmp ($2e2) to jmp ($2e0)
opt h+
org init+1
dta l($2e0)
end