I can't figure out whats wrong with my code. :(
Posted: Sat Dec 21, 2024 1:27 am
I have tried making a basic Hello World program in ASM, but it keeps hanging and I don't know why.
This is my code:
.SEGMENT "START"
JMP BEGIN
.SEGMENT "INIT"
.SEGMENT "ONCE"
.SEGMENT "CODE"
CHROUT = $FFD2
HELLOTEXT:
.BYTE "HELLO, WORLD!",13,0
BEGIN:
LDX #0
LOOP:
LDA HELLOTEXT,X
BEQ DONE
JSR CHROUT
INX
BRA LOOP
DONE:
LDA 13
JSR CHROUT
RTS
Does anyone know what's wrong with the code?
Sorry about this, but this is my first time coding in ASM.
P.S. This may not be useful, but when I assembled this code, it threw up an error code and I can't figure out what it means.
"ld65: Error: Missing memory area assignment for segment 'START'
This is my code:
.SEGMENT "START"
JMP BEGIN
.SEGMENT "INIT"
.SEGMENT "ONCE"
.SEGMENT "CODE"
CHROUT = $FFD2
HELLOTEXT:
.BYTE "HELLO, WORLD!",13,0
BEGIN:
LDX #0
LOOP:
LDA HELLOTEXT,X
BEQ DONE
JSR CHROUT
INX
BRA LOOP
DONE:
LDA 13
JSR CHROUT
RTS
Does anyone know what's wrong with the code?
Sorry about this, but this is my first time coding in ASM.
P.S. This may not be useful, but when I assembled this code, it threw up an error code and I can't figure out what it means.
"ld65: Error: Missing memory area assignment for segment 'START'