keep all assembly examples under a/assembly_*.asm
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
LA 1,MSGAREA Point Register 1 to message area
|
||||
SVC 35 Invoke SVC 35 (Write to Operator)
|
||||
BR 14 Return
|
||||
MSGAREA EQU * Message Area
|
||||
DC AL2(19) Total area length = 19 (Prefix length:4 + Data Length:15)
|
||||
DC XL2'00' 2 bytes binary of zeros
|
||||
DC C'Hello world!' Text to be written to system console
|
||||
END
|
||||
@@ -1,22 +0,0 @@
|
||||
; 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 "Hello world!", a_cr, 0
|
||||
Reference in New Issue
Block a user