231a-ag progressdec14

From CSclasswiki
Jump to: navigation, search

Progress Report (as of December 14)

Coding

So, actually, I haven't modified much (ie. any) code since yesterday. The Arduino sketch is still the same as modified yesterday. The arduino_serial.c should be the same (I played around with it a bit because it wouldn't compile without running errors, but then I realized that it's not supposed to compile without running errors? Or something... I tried to compile driver.c from the last homework and it gave me the same problems, so I just went with it), and the assembly program is also still the same. No changes!

Running the Program

I tried compiling all the programs today, and it took me awhile to figure out all the compiling commands, but here's what I've been using:

nasm -f elf arduino.asm
nasm -f elf -F stabs asm_io.asm
gcc -o arduino arduino_serial.c asm_io.o arduino.o
./arduino -b 9600 /dev/ttyUSB0

The good news is that nothing crashes or gives me errors (or segmentation faults!). The bad news is that it outputs weird numbers (I'm not sure what they are; screenshot below), and isn't done, so it could soon crash and give me errors.


231a-ag runningScreenshot.png

I really don't know what these numbers are, as the Arduino sketch serial prints numbers from 1-9, and no numbers larger than 100, let alone 500+. I tried adding in a tester print function before all the "serious" code started, and this is what I added:

mov	eax, [tm_mon]
call	print_int
call	print_nl

The result of this was that it printed 0, when it should have printed 12 (for December). I'm not sure why it did this... but it printed something...

What's Left?

  • Figuring out what the printed numbers are.
  • Figuring out how to retrieve the printed numbers - are they stored in a register? How can I take these numbers and modify them?