Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Mixing C and assembly with special requirements.

2012-03-27 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, fireweaver <firewevr@...> wrote:
> So  I should write:
> subi    ZL,0xFF-low(X_actions)
> lpm     ZL,Z                      ;<---
> ijmp

Yes, if you want to load the value from the table entry into ZL.  Also, I suspect that the instruction preceding the lpm should actually be

 subi    ZL,0-low(X_actions)

This subtracts the negative of the low byte of the X_actions address, effectively adding the low byte of the X_actions address.

I thought you said (or perhaps I inferred) that this code was working.  It doesn't seem that that is so.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.