one way is to use a subroutine that consists of computational code followed by 1 to 256 occurrences of the macro followed by a RET instruction. use the computational code to compute start_address as (address_of_RET_instruction - macro_size * number_of_executions_desired), then jump to start_address. get it? if the macro size is a power of two then (macro_size * number_of_executions) may be implemented as "number_of_executions << logbase2(macro_size)" -----Original Message----- From: Dave VanHorn <dvanhorn@dvanhorn.org> To: AVR-Chat@yahoogroups.com; AVR-Chat@yahoogroups.com Sent: Mon, 21 Mar 2005 14:21:35 -0500 Subject: [AVR-Chat] Vector table in assembler. For speed, I need to have a bunch of operations that I would normally loop, set up in straightline code. I also need to control how many of these operations that I execute, by varying the entry point. I seem to remember a way to implement vectored jumps, but I can't think what it was offhand. Each entry might be 6-10 instructions, and there may be 256 of them, so whatever it is, needs to not use rjmps. Definitely trading codespace for speed here!, and one of the few places where I'm likely to use a macro. Yahoo! Groups Links
Message
[AVR-Chat] executing a code block 0 to ?? times
2005-03-21 by wg0z@aol.com
Attachments
- No local attachments were found for this message.