Can some one told me why my compiler give operand error out of range 0x22 with this code on mega8
Loop:
SBIC ASSR,TCN2UB
RJMP Loop
The same with TCR2UB
Thank you
Can some one told me why my compiler give operand error out of range 0x22 with this code on mega8
Loop:
SBIC ASSR,TCN2UB
RJMP Loop
The same with TCR2UB
Thank you
Because SBIC has a limited address range, and ASSR is not within this range.
Read m8 datasheet, memory section sub-section "I/O memory" .
Alternative instruction for that job?
Alternative instruction for that job?
Loop: in r16,ASSR sbrc r16,TCN2UB rjmp Loop
Thanks every one
I suppose this will work
LOOP:
in r16,assr
andi r16,~(1<<TCN2UB)
BRNE LOOP
I suppose this will work
BTW: You can test more than one bit at once with the andi.
Because i have to wait until become zero, wrong syntax?
Because i have to wait until become zero, wrong syntax?
To add to that: remove the ~ and change BRNE to BREQ
Thanks a lot I try it tonight hope it will work now
and change BRNE to BREQ
Sorry more caffeine needed here!
What's wrong with my SBRC above - another extra instruction to learn?
What's wrong with my SBRC above
another extra instruction to learn?
His initial code was SBIC on an out of coverage SFR. He asked for an alternative instruction, and I gave him exactly what he was asking for - SBRC, so why invent the non-existing demands about checking multiple bits?