[Coco] C RMA question

Bob Devries devries.bob at gmail.com
Tue Nov 6 20:11:32 EST 2012


Hi Bill,

I would suggest that if in doubt, preserve all registers. Also, did you read 
page 1-4 of the manual titled "Imbedded Assembly Language"? Mention is made 
there of using the correct code section (i.e PSECT/VSECT/ENDSECT)

Hope that helps.

Regards, Bob Devries
Dalby, QLD, Australia

----- Original Message ----- 
From: "Bill Pierce" <ooogalapasooo at aol.com>
To: <coco at maltedmedia.com>
Sent: Wednesday, November 07, 2012 10:55 AM
Subject: [Coco] C RMA question


>
> 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
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list