Let's assume we have a following situation.
Code: Select all
LDA variable
CMP #$10
BEQ LABEL
; these are instructions executed when variable != 16
; program simply continues to execute, increasing program counter
; you have to take care of it, to not hit LABEL after it's done
; for example by using RTS or JMP instruction
LABEL:
; this is set of instructions executed when variable == 16
; program jumps here after BEQ LABEL
Code: Select all
if (variable < 16) {
hd44780_putc('A');
}
while(1) { }
Code: Select all
lda _variable
cmp #$10
L001F: bcs L001F
lda #$41
jsr _hd44780_putc
L001E: jmp L001E
Can it be done that way? Will bcs simply jump to the next label (L001E in that case) if variable is less or equal than 0x10?