Hallo. Abfrage von mehren werten vereinfachen. AVR: ATmega8515 Sprache: ASM Wie kann ich die cpi abfrage vereinfachen ? vielen dank, markus ** Code ** ch1: cpi dmx_byte, 0 breq motor_off cpi dmx_byte, 1 breq motor_off <bis dmx_byte 10> cpi dmx_byte, 11 breq motor_links cpi dmx_byte, 12 breq motor_links cpi dmx_byte, 13 breq motor_links <bis dmx_byte, 20> cpi dmx_byte, 21 breq motor_rechts cpi dmx_byte, 22 breq motor_rechts cpi dmx_byte, 23 breq motor_rechts <bis dmx_byte, 30>
Nicht zwingend kürzer (nur wenn relative Sprünge nicht mehr ausreichen), aber einfacher: ldi zh, high(cmdtab*2) ldi zl, low(cmdtab*2) hc1: lpm xl, z+ lpm xh, z+ lpm yl, z+ lpm yh, z+ cpi xh, $FF cpse r24, xl brne hc1 movw zh:zl, yh:yl ijmp cmdtab: .dw 11, cmd_11 .dw 22, cmd_22 .dw 33, cmd_33 ... .dw $FFFF,cmd_unknown
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.