Updates to come! But first...
drogon wrote:
Want to port RubyOS:BCPL to it:
I forgot to reply to this. I actually really want to use BCPL as my higher level language for my editor. We'll be talking
Now! Attachments! Registers! Errors! Confusion!
As shown below, I am able to use the PIC to load from the SD card again, but this time it also includes code. And that code is running! Kind of! The picture looks great, I jump to the start of code (which is included with the picture data but in the V-Blanking area), and it has the ability to blink a pixel in the top corner. That's a sign of life
But that's all it's doing. In fact, I had my "printchar" subroutine copied over to the code, and although the simulator shows the 'A' character, my actual hardware does not.
YET it still does the blinky pixel AFTER trying to print the character. Huh? That makes me think there is something I really don't understand about the '816 in native mode. I *feel* like the registers are being cleared or corrupted or something. I can JSR and RTS just fine, anything more complex and it gets weird. My first instructions look like this:
Code:
CLC
XCE
REP #$08
SEP #$34
The REP #$08 turns off decimal mode, and the SEP #$34 keeps it in 8-bit mode with interrupts off, right?
The rest of the code is really quick:
Code:
STZ printchar_x
STZ printchar_y
LDA #$41 ; A
JSR printchar
:loop
STA $020000
INC
BRA loop
Assuming that my "printchar" does what it should do (given that the simulator seems to work fine), I don't see what could be an issue besides a hardware/register level misunderstanding.
Any thoughts on why the '816 would be acting funny to more complex code? I'm open to suggestions. My full assembly code is attached (ignore the picture data at the top), and the C code is for the PIC in case you were wondering.
Thanks everyone!
Chad