Hello all,
I have found this Disassembler Tool and i think is worth sharing
http://www.forward.com.au/pfod/ArduinoProgramming/index.html
Hello all,
I have found this Disassembler Tool and i think is worth sharing
http://www.forward.com.au/pfod/ArduinoProgramming/index.html
installation works (after virus scan)
then I get an error message
Exception in thread "Thread-9" java.lang.NoSuchMethodError: processing.app.SerialMonitor.closeSerialPort()V
at au.com.forward.arduinoTools.Disassembler.internalRun(Disassembler.java:109)
at au.com.forward.arduinoTools.Disassembler$1.run(Disassembler.java:83)
Strange...for me it works, i am using 1.0.5 r2, maybe is a version issue?
Here is my code test
svolatile byte I0, I1;
volatile unsigned int T1OFC;//Timer1 Overflow Count
unsigned long a = 0;
void setup()
{
}
void loop()
{
a=myFastTime();
}
unsigned long myFastTime()
{
unsigned long tmp = 0;// temporary variable to hold the value
cli();//disable interrupts
tmp = ((T1OFC * 65536UL) + (uint32_t)TCNT1 - 10UL);//get the value -10 to compensate the call of myFastTime()
sei();
return tmp;
}
the result is
}
unsigned long myFastTime()
{
unsigned long tmp = 0;// temporary variable to hold the value
cli();//disable interrupts
a8: f8 94 cli
tmp = ((T1OFC * 65536UL) + (uint32_t)TCNT1 - 10UL);//get the value -10 to compensate the call of myFastTime()
aa: 20 91 00 01 lds r18, 0x0100
ae: 30 91 01 01 lds r19, 0x0101
b2: 80 91 84 00 lds r24, 0x0084
b6: 90 91 85 00 lds r25, 0x0085
sei();
ba: 78 94 sei
}
void loop()
{
a=myFastTime();
bc: a0 e0 ldi r26, 0x00 ; 0
be: b0 e0 ldi r27, 0x00 ; 0
c0: 0a 97 sbiw r24, 0x0a ; 10
c2: a1 09 sbc r26, r1
c4: b1 09 sbc r27, r1
c6: 40 e0 ldi r20, 0x00 ; 0
c8: 50 e0 ldi r21, 0x00 ; 0
ca: a9 01 movw r20, r18
cc: 33 27 eor r19, r19
ce: 22 27 eor r18, r18
d0: 82 0f add r24, r18
d2: 93 1f adc r25, r19
d4: a4 1f adc r26, r20
d6: b5 1f adc r27, r21
d8: 80 93 02 01 sts 0x0102, r24
dc: 90 93 03 01 sts 0x0103, r25
e0: a0 93 04 01 sts 0x0104, r26
e4: b0 93 05 01 sts 0x0105, r27
}
e8: 08 95 ret
I am not good at assembly, so i need someone to check the result
It takes 10 clock cycles for myFastTime() and 28 to complete one loop (a=myFastTime()) including return?
instruction - cycles needed - http://www.atmel.com/images/Atmel-0856-AVR-Instruction-Set-Manual.pdf
cli - 1
lds - 2
sei - 1
ldi - 1
sbiw - 2
sbc - 1
movw - 1
eor - 1
add - 1
adc - 1
sts - 2
ret - 5