Sha256: ef4f63f3feb59e2a33996730f285256e2164a880817b163f5dd81d2f82027b57

Contents?: true

Size: 655 Bytes

Versions: 10

Compression:

Stored size: 655 Bytes

Contents

; 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		; C64 KERNEL ROM, output a character to current device.
			; use $fded for Apple 2, $ffe3 (ascii) or $ffee (raw) for BBC.
	.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

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/hello_world.text/6502_assembly.txt
zettacode-0.1.6 files.zettacode/hello_world.text/6502_assembly.txt
zettacode-0.1.6 files.zettacode2/hello_world.text/6502_assembly.txt
zettacode-0.1.5 files.zettacode/hello_world.text/6502_assembly.txt
zettacode-0.1.5 files.zettacode2/hello_world.text/6502_assembly.txt
zettacode-0.1.4 files.zettacode/hello_world.text/6502_assembly.txt
zettacode-0.1.4 files.zettacode2/hello_world.text/6502_assembly.txt
zettacode-0.1.3 files.zettacode/hello_world.text/6502_assembly.txt
zettacode-0.1.2 files.zettacode/hello_world.text/6502_assembly.txt
zettacode-0.1.1 zettacode.files/hello_world.text/6502_assembly.txt