this post was submitted on 16 Aug 2023
571 points (96.7% liked)

Programmer Humor

32224 readers
19 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

When you come back from vacation
@programmerhumor

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago

@anders @nthcdr lda #0 ; Load accumulator with character code for NULL
sta $0400 ; Store it in the screen memory to clear the screen
ldx #0 ; Initialize X register to 0
loop lda message,x ; Load the next character from the message
beq done ; If the character is NULL (end of string), we are done
sta $0400,x ; Store the character in the screen memory
inx ; Increment X register
bne loop ; Branch back to the loop
done rts ; Return from subroutine
message .text "Hello World!",0 ; Null-terminated string