[Coco] C RMA question
Bill Pierce
ooogalapasooo at aol.com
Tue Nov 6 20:33:05 EST 2012
@Bob Devries
Yes, i have the variable data in the proper vsect section which makes to global and accessable to the C code.
Since I posted, I did find a portion of the code that is changing the opts with getstt and setstt. So I inserted code at the end to restore the original opts and it didn't do any good. The original RMA code is not my own but an adaptation of exsisting code that I need to access the serial port. The original code was a stand alone program and worked fine, but it passes through once then exits. This would be why that code showed no signs of anything wrong as once it exits and OS9 goes back to it's normal state
Using the adaptation, the code stays active and is called regularly and it's rearing it's ugly head at me and I'm ready to chop it off :-)
This code is imperative to the software I'm working on and I know of no alternative at the moment to replace it.
Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Bill Pierce
ooogalapasooo at aol.com
-----Original Message-----
From: Bob Devries <devries.bob at gmail.com>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Tue, Nov 6, 2012 8:19 pm
Subject: Re: [Coco] C RMA question
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
--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco
More information about the Coco
mailing list