You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
829 B
NASM
32 lines
829 B
NASM
|
|
; hello world example
|
|
; for win2c64 by Aart Bik
|
|
; http://www.aartbik.com/
|
|
|
|
; Adapted for the RE6502 emulator simple test machine
|
|
; compile with win2c64 using the -R option
|
|
|
|
strout .equ $1100 ; console output address
|
|
print_flag .equ $009E ; str print flag address
|
|
|
|
main .org $0200 ; program load address for the simple test machine
|
|
ldx #0
|
|
loop lda text,x
|
|
sta strout,x
|
|
inx
|
|
cpx #11
|
|
bne loop
|
|
|
|
; null terminate the string
|
|
lda #0
|
|
sta strout,x
|
|
|
|
; Set flag to do the print
|
|
ldx #1 ; 0xA2, 0x01,
|
|
stx print_flag ; 0x86, 0x9E, ; Print string flag is at 0x9E
|
|
|
|
; End the program
|
|
rts ; 0x60
|
|
|
|
; Variables
|
|
text .byte "HELLO WORLD" |