Commit d59eab62 authored by Christian Dietrich's avatar Christian Dietrich

IJMP & ICALL

parent 15436601
......@@ -544,14 +544,8 @@
}
% RCALL
\csdef{avr@instr@1101}#1\@nnil{
\avr@count@tobin@w{\the\avr@pc}{\@@pc}%
\avr@instr@rjump@dec{#1}{\avr@count@tmpa}%
\avr@reg@get{\csuse{avr@r24}}{\@@A}%
\avr@reg@get{\csuse{avr@r25}}{\@@B}%
\avr@reg@get{\csuse{avr@r26}}{\@@C}%
\avr@debug{RCALL \the\avr@count@tmpa {r24:\@@A} {r25:\@@B} {r26:\@@C}}%
\avr@pc@add{\avr@count@tmpa}%
\def\avr@CALL@helper#1{%
\edef\@@pc{#1}%
\avr@bin@word@low{\@@pc}{\@@low}%
\avr@bin@word@high{\@@pc}{\@@high}%
\avr@mem@set{\@@low}{\the\avr@stackptr}%
......@@ -561,6 +555,41 @@
\avr@pc@inc%
\avr@debug{ done}%
}
\csdef{avr@instr@1101}#1\@nnil{
\avr@count@tobin@w{\the\avr@pc}{\@@pc}%
\avr@instr@rjump@dec{#1}{\avr@count@tmpa}%
\avr@reg@get{\csuse{avr@r24}}{\@@A}%
\avr@reg@get{\csuse{avr@r25}}{\@@B}%
\avr@reg@get{\csuse{avr@r26}}{\@@C}%
\avr@debug{ICALL \the\avr@count@tmpa {r24:\@@A} {r25:\@@B} {r26:\@@C}}%
\avr@CALL@helper{\@@pc}%
\avr@pc@add{\avr@count@tmpa}%
}
\def\avr@instr@ICALL#1{\avr@code@set{1001010100001001}{#1}}
\csdef{avr@instr@1001010100001001}\@nnil{
\avr@count@tobin@w{\the\avr@pc}{\@@pc}%
\avr@regw@get{\csuse{avr@Z}}{\@@addr}
\avr@bin@tocount{\@@addr}{\avr@addr}%
\avr@reg@get{\csuse{avr@r24}}{\@@A}%
\avr@reg@get{\csuse{avr@r25}}{\@@B}%
\avr@reg@get{\csuse{avr@r26}}{\@@C}%
\avr@debug{ICALL \the\avr@addr {r24:\@@A} {r25:\@@B} {r26:\@@C}}%
\avr@CALL@helper{\@@pc}%
\avr@pc=\avr@addr
}
\def\avr@instr@IJMP#1{\avr@code@set{1001010000001001}{#1}}
\csdef{avr@instr@1001010000001001}\@nnil{
\avr@count@tobin@w{\the\avr@pc}{\@@pc}%
\avr@regw@get{Z}{\@@addr}
\avr@bin@tocount{\@@addr}{\avr@addr}%
\avr@reg@get{\csuse{avr@r24}}{\@@A}%
\avr@reg@get{\csuse{avr@r25}}{\@@B}%
\avr@reg@get{\csuse{avr@r26}}{\@@C}%
\avr@debug{IJMP \the\avr@addr {r24:\@@A} {r25:\@@B} {r26:\@@C}}%
\avr@pc=\avr@addr
}
% RET
\def\avr@instr@RET#1{%
......
#include <avr/io.h>
// Produces LPM operations
__attribute__((noinline)) void bar() {
UDR='X';
}
void (*foo)() = bar;
int main() {
bar();
foo();
asm volatile ("break");
}
/*
check-name: Function Pointers
check-start:
\avr@instr@stepn{1000000}
\avr@test@UDR{XX}
check-end:
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment