Watchdog ISR in assembly language

asm("#define SREG 0x3f\n");
asm(" in r16,SREG\n"); // fails with "Error: constant value required"
asm(" in r16,0x3f\n"); // works

@CB
I tried with and without \n, no difference. I often wondered about the \n in these assembler examples, it's the sort of thing you do when generating HTML code that has to be read by a human but you wouldn't expect it to be required here.

@Rob
I did the same with the small exception that I don't have python installed :), I'll go and get it.

@stimmer
That approach produced 964

at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java)

errors.

However I noticed your .equ syntax is different

asm(".equ SREG,0x3f\n");
asm(" in r16,SREG\n"); // this works

but

asm(".equ r_temp1,r16\n");
asm(" push r_temp\n"); // this doesn't work, Error: register name or number from 0 to 31 required
asm(" in r_temp,SREG\n"); // same error

Is this the ASM equivelant of "lvalue required"?

Anyway that's where I left it at 2AM last night. I'm back on deck now so will continue with this.


Rob