This questions relates to an unexpanded VIC 20.
My first (probably too ambitious) assembly project is to try and recreate a lunar module display and keyboard from the 1960s. I need to be able to light up several areas of the screen (2x4 characters) based on whether a memory location contains a zero or one. I've redefined 72 characters and loaded them up starting at location 6144 (decimal). I don't have enough RAM to include reversed characters, so I am trying to figure out an efficient way of reversing these 2x4 portions of the screen so that they appear to "light up" to tell the astronauts things.
I've not run the code below, and it's probably all wrong in terms of addressing modes etc (so forgive my newbieness), but would it reverse a given character?
Code: Select all
lda 7726 ;put the char code from screen ram location into the accumulator
reverse_char ;reverse the char code currently in the accumulator
clc
adc #6144 ;add 6144 to the accumulator to get the char address
sta 7675 ;store a in a safe place for later
ldy #7 ; we need to loop through the 8 bits of the character
rvc_loop lda #255 ; put 255 in accumulator
sec ; set the carry bit
sbc (7675) ;subtract the char address content from 255
sta (7675),y ;store the result back in the char address
dey ; decrement y
inc 7675 ; add 1 to the value in 7676
bne rvc_loop ; if x is non-zero rvc_loop
rts ; all done
Thanks all
Martin