More debugging – part 3.

November 11th, 2013

Right, where am I at now? Still bloody confused, that’s where!

I tried a few more things. I tried changing the file I was sending it. When in load mode all that is really happening is the machine is accepting characters from the serial port instead of the keyboard. Other than that it behaves the same.

So I tried sending it commands instead of a program. The simplest command is just a line number. If you send it “10” then if line 10 exists in Basic memory it removes that line. If it doesn’t exist it doesn’t do anything.

That falls over fairly quickly.

I also tried an immediate command “REM” which is the basic remark command. It doesn’t do much although the comments in the conde call it a false IF?

That falls over.

I tried sending it a LOAD command. Since I wrote that function I know exactly what it does.

And that falls over.

To eliminate the interrupt handler entirely I tweaked the code to poll the receiver port instead of relying on interrupts. So there were no interrupts at all on the machine. The receiving was a lot worse as you’d expect (missed characters) but that also falls over.

I also tried putting in code that was checking the characters being received and if they were outside the normal range of ASCII values I’d ignore them. That still broke (although I might revisit this as I might not have done the check in the right place).

So basically it just seems no matter what data is being sent if it’s being sent too quickly something breaks. I just can’t see what!

It’s not the interrupt handler. It’s not the code that shuffles Basic lines about in memory. It’s not one particular bad ASCII value being received. If there are no receive errors everything works fine. Characters received are echoed back (as each is received) and when things go wrong there is no evidence of back characters sent back.

Very odd!


Comments are closed.