Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Pretty Boot Loader
- ; Include this in main file:
- ;Boot loader
- !source "./libs/loader.asm"
- +start_at $1000
- ;source of loader.asm
- ;Basic loader
- ;Creates a macro that sets the program counter to BASIC, then
- ;puts "10 SYS <address>". Address is written in base 10 and
- ;assumes 5 digits, although it will work with 4. Finally, it
- ;sets the program counter to the given address to start the
- ;assembly.
- !macro start_at .address {
- * = $0801 ;Set program counter to address of BASIC in memory.
- !byte $0e,$08,$0a,$00,$9e,$20
- !if .address >= 10000 { !byte 48 + ((.address / 10000) % 10) }
- !if .address >= 1000 { !byte 48 + ((.address / 1000) % 10) }
- !if .address >= 100 { !byte 48 + ((.address / 100) % 10) }
- !if .address >= 10 { !byte 48 + ((.address / 10) % 10) }
- !byte $30 + (.address % 10), $3a,$8f,$20,$4c,$45,$44,$47,$45,$52,$00, $00, $00
- * = .address
- }
- ;10 SYS ####:REM LEDGER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement