;PURPOSE - This is the code which will written to ROM at $0000 (but will be referenced as $8000)
;
;
;The first difference we'll see is the inclusion of other source files (note they do not have .s extensions, we do not want
;them assembled as their own objects).
; ca65 documentation:
https://cc65.github.io/doc/ca65.html#ss11.66
;
;Include the via import file (defining the imports there and keeping this source clean)
.include "via.s_imports"
;Include the acia (serial) import file
.include "acia.s_imports"
;Include the reset and interrupt vector definitions
.include "reset.s_interrupts"
.include "lcd.s_imports"
.code
setmode:
ldx #$FF
txs
clc ; Clear carry to set addition mode
xce ; Switch to native mode
sei ; Disable interrupts
cld ; Clear decimal mode
; Now in native mode with interrupts disabled and stack set
sep #%00110000 ; Set to 8-bit accumulator and index registers
jsr via_init ;Initialize VIA
jsr acia_init ;Initialize ACIA (serial)
jsr lcd_init ;Initialize LCD
jsr print_hello ;Print "Hello, World!" to the LCD
main:
nop ; dummy instruction
nop ; dummy instruction
nop ; dummy instruction
lda #'H'
jsr acia_putchar
jmp main ; Infinite loop to keep the program running;
00000000 9c 91 7f a9 1a 8d 93 7f a9 19 8d 92 7f 60 aa 8e |.............`..|
00000010 90 7f 84 ff 88 d0 fd 60 a9 08 2c 91 7f f0 fb ad |.......`..,.....|
00000020 90 7f 60 18 fb 78 d8 e2 30 20 3b 81 20 00 80 20 |..`..x..0 ;. .. |
00000030 82 80 20 40 80 ea ea ea a9 48 20 0e 80 4c 35 80 |.. @.....H ..L5.|
00000040 a9 48 20 c1 80 a9 65 20 c1 80 a9 6c 20 c1 80 a9 |.H ...e ...l ...|
00000050 6c 20 c1 80 a9 6f 20 c1 80 a9 2c 20 c1 80 a9 20 |l ...o ..., ... |
00000060 20 c1 80 a9 57 20 c1 80 a9 6f 20 c1 80 a9 72 20 | ...W ...o ...r |
00000070 c1 80 a9 6c 20 c1 80 a9 64 20 c1 80 a9 21 20 c1 |...l ...d ...! .|
00000080 80 60 a9 01 20 97 80 a9 38 20 97 80 a9 0f 20 97 |.`.. ...8 .... .|
00000090 80 a9 06 20 97 80 60 48 20 12 81 fa ad 81 7f 29 |... ..`H ......)|
000000a0 f8 8d 81 7f 8e 80 7f a2 ff 8e 82 7f 09 01 8d 81 |................|
000000b0 7f 29 f8 8d 81 7f a9 00 8d 80 7f a9 ff 8d 82 7f |.)..............|
000000c0 60 48 20 12 81 fa ad 81 7f 29 fc 09 04 8d 81 7f |`H ......)......|
000000d0 8e 80 7f a2 ff 8e 82 7f 09 05 8d 81 7f 29 f8 8d |.............)..|
000000e0 81 7f a9 00 8d 80 7f a9 ff 8d 82 7f 60 ad 81 7f |............`...|
000000f0 a9 00 8d 82 7f 29 fa 09 02 8d 81 7f 09 03 8d 81 |.....)..........|
00000100 7f ae 81 7f 29 f8 8d 81 7f 8a 29 7f a2 ff 8e 82 |....).....).....|
00000110 7f 60 ae 81 7f 8a a9 00 8d 82 7f 29 fa 09 02 8d |.`.........)....|
00000120 81 7f 09 03 8d 81 7f aa ad 80 7f 89 80 d0 e6 8a |................|
00000130 29 f8 8d 81 7f a9 ff 8d 82 7f 60 a9 00 8d 81 7f |).........`.....|
00000140 a9 00 8d 80 7f a9 ff 8d 83 7f a9 ff 8d 82 7f a9 |................|
00000150 cc 8d 8c 7f 60 00 00 00 00 00 00 00 00 00 00 00 |....`...........|
00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|