AVR: Skip if Bit in I/O Register is Cleared (SBIC)

OP #2224539
Lesenswert?

Der Befehl
1
  sbic  PINB, PINB0
führt zu der Fehlermeldung:
1
Error: number must be positive and less than 32

PINB ist definiert als _SFR_IO8 (0x03) (I/O-Register 3) und führt 
letztlich zu dem Wert 0x23. Formal hat gas also recht, konsistent zum 
Definitionssystem für die AVRs ist es wohl nicht.

Leider ist es mir noch nicht gelungen, den Preprozessor-Output zu 
konservieren, den gas zu fressen bekommt - die Option -save-temps ist 
für .s-Files wirkungslos.

Wie ist das mit SBIC gedacht? Ich möchte das Problem ungern mit einem 
Hack umgehen.


SBIC – Skip if Bit in I/O Register is Cleared
Description: This instruction tests a single bit in an I/O Register and 
skips the next instruction if the bit is set. This instruction operates 
on
the lower 32 I/O Registers – addresses 0-31.

Syntax:            SBIC A,b
Operands:          0 ≤ A ≤ 31, 0 ≤ b ≤ 7
Program Counter:   PC ← PC + 1, Condition false - no skip
                   PC ← PC + 2, Skip a one word instruction
                   PC ← PC + 3, Skip a two word instruction

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren