A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
22
Task/Hello-world-Text/6502-Assembly/hello-world-text.6502
Normal file
22
Task/Hello-world-Text/6502-Assembly/hello-world-text.6502
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
; goodbyeworld.s for C= 8-bit machines, ca65 assembler format.
|
||||
; String printing limited to strings of 256 characters or less.
|
||||
|
||||
a_cr = $0d ; Carriage return.
|
||||
bsout = $ffd2 ; KERNAL ROM, output a character to current device.
|
||||
|
||||
.code
|
||||
|
||||
ldx #0 ; Starting index 0 in X register.
|
||||
printnext:
|
||||
lda text,x ; Get character from string.
|
||||
beq done ; If we read a 0 we're done.
|
||||
jsr bsout ; Output character.
|
||||
inx ; Increment index to next character.
|
||||
bne printnext ; Repeat if index doesn't overflow to 0.
|
||||
done:
|
||||
rts ; Return from subroutine.
|
||||
|
||||
.rodata
|
||||
|
||||
text:
|
||||
.byte "Goodbye, World!", a_cr, 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue