Refined the comments in the target start-up files.
Fixed typo errors. Made the comments consistent across all those files.
This commit is contained in:
@@ -24,76 +24,76 @@
|
||||
ldx #$FF
|
||||
txs ; Init stack pointer
|
||||
|
||||
; Switch in LC bank 2 for W/O
|
||||
; Switch in LC bank 2 for W/O.
|
||||
bit $C081
|
||||
bit $C081
|
||||
|
||||
; Set source start address
|
||||
; Set the source start address.
|
||||
lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__)
|
||||
ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__)
|
||||
sta $9B
|
||||
sty $9C
|
||||
|
||||
; Set source last address
|
||||
; Set the source last address.
|
||||
lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
|
||||
ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
|
||||
sta $96
|
||||
sty $97
|
||||
|
||||
; Set destination last address
|
||||
; Set the destination last address.
|
||||
lda #<__LC_LAST__
|
||||
ldy #>__LC_LAST__
|
||||
sta $94
|
||||
sty $95
|
||||
|
||||
; Call into Applesoft Block Transfer Utility - which handles zero
|
||||
; sized blocks well - to move content of the LC memory area
|
||||
; Call into the Applesoft Block Transfer Utility -- which handles zero-
|
||||
; sized blocks well -- to move the content of the LC memory area.
|
||||
jsr $D396 ; BLTU + 3
|
||||
|
||||
; Set source start address
|
||||
; Set the source start address.
|
||||
lda #<__ZPSAVE_RUN__
|
||||
ldy #>__ZPSAVE_RUN__
|
||||
sta $9B
|
||||
sty $9C
|
||||
|
||||
; Set source last address
|
||||
; Set the source last address.
|
||||
lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__)
|
||||
ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__)
|
||||
sta $96
|
||||
sty $97
|
||||
|
||||
; Set destination last address
|
||||
; Set the destination last address.
|
||||
lda #<(__INIT_RUN__ + __INIT_SIZE__)
|
||||
ldy #>(__INIT_RUN__ + __INIT_SIZE__)
|
||||
sta $94
|
||||
sty $95
|
||||
|
||||
; Call into Applesoft Block Transfer Utility - which handles moving
|
||||
; overlapping blocks upwards well - to move the INIT segment
|
||||
; Call into the Applesoft Block Transfer Utility -- which handles moving
|
||||
; overlapping blocks upwards well -- to move the INIT segment.
|
||||
jsr $D396 ; BLTU + 3
|
||||
|
||||
; Delegate all further processing to keep the STARTUP segment small
|
||||
; Delegate all further processing, to keep the STARTUP segment small.
|
||||
jsr init
|
||||
|
||||
; Avoid re-entrance of donelib. This is also the _exit entry
|
||||
; Avoid a re-entrance of donelib. This is also the exit() entry.
|
||||
_exit: ldx #<exit
|
||||
lda #>exit
|
||||
jsr reset ; Setup RESET vector
|
||||
|
||||
; Switch in ROM in case it wasn't already switched in by a RESET
|
||||
; Switch in ROM, in case it wasn't already switched in by a RESET.
|
||||
bit $C082
|
||||
|
||||
; Call module destructors
|
||||
; Call the module destructors.
|
||||
jsr donelib
|
||||
|
||||
; Restore the original RESET vector
|
||||
; Restore the original RESET vector.
|
||||
exit: ldx #$02
|
||||
: lda rvsave,x
|
||||
sta SOFTEV,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
; Copy back the zero page stuff
|
||||
; Copy back the zero-page stuff.
|
||||
ldx #zpspace-1
|
||||
: lda zpsave,x
|
||||
sta sp,x
|
||||
@@ -111,17 +111,17 @@ exit: ldx #$02
|
||||
|
||||
.segment "INIT"
|
||||
|
||||
; Save the zero page locations we need
|
||||
; Save the zero-page locations that we need.
|
||||
init: ldx #zpspace-1
|
||||
: lda sp,x
|
||||
sta zpsave,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
; Clear the BSS data
|
||||
; Clear the BSS data.
|
||||
jsr zerobss
|
||||
|
||||
; Save the original RESET vector
|
||||
; Save the original RESET vector.
|
||||
ldx #$02
|
||||
: lda SOFTEV,x
|
||||
sta rvsave,x
|
||||
@@ -135,58 +135,58 @@ init: ldx #zpspace-1
|
||||
lda #>_exit
|
||||
jsr reset ; Setup RESET vector
|
||||
|
||||
; Check for ProDOS
|
||||
; Check for ProDOS.
|
||||
ldy $BF00 ; MLI call entry point
|
||||
cpy #$4C ; Is MLI present? (JMP opcode)
|
||||
bne basic
|
||||
|
||||
; Check ProDOS system bit map
|
||||
|
||||
; Check the ProDOS system bit map.
|
||||
lda $BF6F ; Protection for pages $B8 - $BF
|
||||
cmp #%00000001 ; Exactly system global page is protected
|
||||
bne basic
|
||||
|
||||
; No BASIC.SYSTEM so quit to ProDOS dispatcher instead
|
||||
; No BASIC.SYSTEM; so, quit to the ProDOS dispatcher instead.
|
||||
lda #<quit
|
||||
ldx #>quit
|
||||
sta done+1
|
||||
stx done+2
|
||||
|
||||
; No BASIC.SYSTEM so use addr of ProDOS system global page
|
||||
|
||||
; No BASIC.SYSTEM; so, use the addr of the ProDOS system global page.
|
||||
lda #<$BF00
|
||||
ldx #>$BF00
|
||||
bne :+ ; Branch always
|
||||
|
||||
; Get highest available mem addr from BASIC interpreter
|
||||
; Get the highest available mem addr from the BASIC interpreter.
|
||||
basic: lda HIMEM
|
||||
ldx HIMEM+1
|
||||
|
||||
; Setup the C stack
|
||||
; Set up the C stack.
|
||||
: sta sp
|
||||
stx sp+1
|
||||
|
||||
; Enable interrupts as old ProDOS versions (i.e. 1.1.1)
|
||||
; jump to SYS and BIN programs with interrupts disabled
|
||||
; Enable interrupts, as old ProDOS versions (i.e. 1.1.1)
|
||||
; jump to SYS and BIN programs with interrupts disabled.
|
||||
cli
|
||||
|
||||
; Call module constructors
|
||||
; Call the module constructors.
|
||||
jsr initlib
|
||||
|
||||
; Switch in LC bank 2 for R/O
|
||||
; Switch in LC bank 2 for R/O.
|
||||
bit $C080
|
||||
|
||||
; Push arguments and call main()
|
||||
; Push the command-line arguments; and, call main().
|
||||
jmp callmain
|
||||
|
||||
.code
|
||||
|
||||
; Setup RESET vector
|
||||
; Set up the RESET vector.
|
||||
reset: stx SOFTEV
|
||||
sta SOFTEV+1
|
||||
eor #$A5
|
||||
sta PWREDUP
|
||||
return: rts
|
||||
|
||||
; Quit to ProDOS dispatcher
|
||||
; Quit to the ProDOS dispatcher.
|
||||
quit: jsr $BF00 ; MLI call entry point
|
||||
.byte $65 ; Quit
|
||||
.word q_param
|
||||
|
||||
Reference in New Issue
Block a user