Sun Mar 01, 2015 5:07 pm
Sun Mar 01, 2015 11:43 pm
Mon Mar 02, 2015 7:24 am
C:/arduino-1.0.5/hardware/tools/avr/bin/avr-objdump -h -S C:\Users\YOURNAME\AppData\Local\Temp\build123456etc.tmp\yourfile.cpp.elf > output.lst
Mon Mar 02, 2015 1:31 pm
NicK wrote:[...]
That explains how you can get ASM going for Arduino. There are a few ways it can be incorporated into code (inline assembler) but that is not advised do to the strange syntax.
NicK wrote:The problem I would face with a purely ASM code may not be the actual game but in fact all the other parts like the Gamebuino start menu and boot loader. I managed to disassemble a VERY simple pixel routine but it was very long and to my uneducated brain far too complex.
[...]
Too bad that one doesn't exist for linuxMyndale wrote:[...]
And then finally there's the Simbuino emulator which doesn't currently support symbols but does let you step through the raw assembly and add breakpoints etc.
Myndale wrote:Overall the AVR's are much easier to program than most other comparable architectures. The chip does pretty much exactly what you expect it to thanks to no cache lines, multi-stage execution pipelines or branch-prediction to worry about. The main thing to watch out for is the poor shift support; it can only shift one bit at a time, so anything higher has to be implemented as either a loop, look-up table or multiply/divide.
Mon Mar 02, 2015 2:22 pm
Tue Mar 24, 2015 12:54 pm
cbi 5,3 ; if bit is supposed to be off then sbi 5,3
sbi 5,5
cbi 5,5
Wed Mar 25, 2015 3:21 am
Sorunome wrote:Is there somewhere information on how to output things to the screen, so some documentation on how the screen is working on port-level?
Wed Mar 25, 2015 4:09 am
Sorunome wrote:I got another issue now: I have a variable outside of my assembly (one byte) that I want to have in R19 during the asm code and want it to be stored back afterwards. How could I do that?
volatile int val = 1;
void setup() {
Serial.begin(9600);
Serial.print("before: val = ");
Serial.println(val);
__asm__ __volatile__ (
"cli \n" // disable interrupts
"push r19 \n" // save registers
"push r28 \n"
"push r29 \n"
"ldi r28, lo8(val) \n" // load address of val into Y
"ldi r29, hi8(val) \n"
"ld r19, Y \n" // load val
"inc r19 \n" // increment
"st Y, r19 \n" // store it back out
"pop r29 \n" // restore registers
"pop r28 \n"
"pop r19 \n"
"sei \n" // re-enable interrupts
);
Serial.print("after: val = ");
Serial.println(val);
}
void loop() {
}
Wed Mar 25, 2015 10:21 am
asm volatile(
<code that uses %[rotFlagReg] as a register>
::[rotFlagReg] "r" (rotFlagTmp):);
Wed Mar 25, 2015 10:52 am
asm volatile("mov __tmp_reg__, %A0" "\n\t"
"mov %A0, %D0" "\n\t"
"mov %D0, __tmp_reg__" "\n\t"
"mov __tmp_reg__, %B0" "\n\t"
"mov %B0, %C0" "\n\t"
"mov %C0, __tmp_reg__" "\n\t"
: "+r" (value));