Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; "Hello World" in dasm assembler format.
  2.  
  3.             processor 6502
  4.  
  5. ddata       equ     $11a0       ; Display data address.
  6. dcommand    equ     $11a1       ; Display command address.
  7.  
  8.             org     $1200       ; Code start.
  9.            
  10.             ldx     #0          ; Starting index 0 in X register.
  11. printnext:
  12.             lda     text,x      ; Get character from string.
  13.             beq     done        ; If we read a 0 we're done.
  14.             sta     ddata       ; Output character.
  15.             lda     #$7
  16.             sta     dcommand
  17.             inx                 ; Increment index to next character.
  18.             bne printnext       ; Repeat if index doesn't overflow to 0.
  19. done:
  20.             brk                 ; Just die.
  21.  
  22. text:
  23.     dc.b    "Hello, world!", $00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement