browser

helloworld.xyw

helloworld.xyw
calendarsave
; main program
hello print JSRw
HLT

; a16 --
; printing subroutine
.label print
  ; store top of stack to register XW
  POPxw
  .label print.loop
    ; dereference address in XW and print 
    ; by setting the terminal output ($11) byte
    LDBxw $11 STB
    ; increment address, dereference 
    ; go back to loop unless zero
    INCxw LDBxw print.loop JCNw
    RTS

; store null-terminated string
.label hello
  .string "Hello, World!\n"