[Coco] C RMA question

Bill Pierce ooogalapasooo at aol.com
Tue Nov 6 19:55:07 EST 2012


Hi guys
I have a C program that has RMA assembly routines built in. It's a multiple file source that compiles into one executable program. All seems to function well till I call the function that was in RMA.
The RMA routine does what it's intended to do (reads the serial port and prints to the screen) and returns to the caller. Then a new CWArea is created and the area cleared.
Herein lies the problem, the area doen't clear and from that point on, most printing functions in the C portion do not seem to work properly, but calling the RMA routine again produces it's print fine. The program does not crash, all cmds keys work as expected. I just can't clear the screen or print from C. I know it's in the RMA routine, as I can comment out that call and all functions as intended and screen clears properly.
I wondered if I should preserve some regs as maybe it was messing with Cs regs, so I inserted "pshs a,b,x,y" at the beginning and "puls a,b,x,y" at the end. Now the program runs properly, but prints extra lines during the RMA portion. It prints the last 3 printed lines twice. When it returns to the caller, the screen clears and print works.
I narrowed it down by eliminating each of the regs in pshs and the only one that has this effect is when I preserve Y.

Here's the question, when calling an "inline" assembled function, what regs (if any) need to be preserved and what are the state of the regs in C at the time of calling?

any ideas?
Bill P

Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Bill Pierce
ooogalapasooo at aol.com




More information about the Coco mailing list