#pragma GCC optimize ("Og")
#include "ArduinoTrace.h"
volatile int8_t a=2,b=6,c;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("INICIO");
//------------- Proceso en alto nivel -------------------
//if (a>=2 && b>5)
// if (a>=2 && b>5)
// {
// goto then1;
// }
// else
// {
// goto else1;
// }
cond1:
// if(a>=2)
// {
// goto cond2;
// }
// else
// {
// goto else1;
// }
asm goto
(
"lds r16, a\n"
"cpi r16, 2\n"
"brge %l[cond2]\n"
"jmp %l[else1]"
::::cond2, else1
);
cond2:
// if (b>5)
// {
// goto then1;
// }
// else
// {
// goto else1;
// }
asm goto
(
"lds r16, b\n"
"cpi r16, 6\n"
"brge %l[then1]\n"
"jmp %l[else1]"
::::then1, else1
);
then1:
// {
// c=3;
// }
// goto endif1;
asm goto
(
"ldi r16, 3\n"
"sts c, r16\n"
"jmp %l[endif1]"
::::endif1
);
//else
else1:
// {
// c=7;
// }
asm volatile
(
"ldi r16, 7\n"
"sts c, r16"
);
endif1:
//--------------------------------------------------------
DUMP(c);
}
void loop() {
}