I learn now KickAss assembler for C64, but i'm never learnd any asm or 8 bit computing before. I want to print big ascii banner (numbers). I want to store the "$0400" address in the memory and when i'm increased the line number i need to increase it by 36 (because the sceen is 40 char width so i want to jump ti next line), but my problem is this is a 2 byte number so i can't just add to it. This demo is works "fine" except the line increasing because i dont know that.
So what i'm need:
Thx a lot guys!
BasicUpstart2(main)
*=$1000
currentLine:
.byte 00
main:
printNumber(num5)
rts
num5: .byte $E0, $E0, $E0, $E0, $00 // XXXX(null)
.byte $E0, $20, $20, $20, $00 // X (null)
.byte $E0, $20, $20, $20, $00 // X (null)
.byte $E0, $E0, $E0, $E0, $00 // XXXX(null)
.byte $20, $20, $20, $E0, $00 // X(null)
.byte $20, $20, $20, $E0, $00 // X(null)
.byte $E0, $E0, $E0, $E0, $00 // XXXX(null)
.macro printNumber(numberLabel)
{
ldx #0
lda #0
lda #0
loop:
lda numberLabel,x
beq checkNextline
sta $0400,x
inx
jmp loop
checkNextline:
inx
inc currentLine
lda currentLine
cmp #7
beq done
jmp loop
done:
}
// Expected output:
XXXX
X
X
XXXX
X
X
XXXX
// Current output:
XXXXX X XXXX X XXXXX
(where the X is the $E0 petscii char)
clc
lda LowByte ; Load the lower byte
adc #LowValue ; Add the desired value
sta LowByte ; Write back the lowbyte
lda HiByte ; No load hi byte
adc #HiValue ; Add the value.
sta HiByte