[Coco] Assembly Code from within a C program.

Pierre Sarrazin sarrazip at sarrazip.com
Fri Nov 3 11:48:58 EDT 2023


Dixit Dave via Coco (2023-11-03 10:19):
> You can still make OS9 system calls with SWI followed by the appropriate code. 

Indeed.


Dixit Charlie via Coco (2023-11-03 07:27):
> You can still make OS9 system calls with SWI followed by the appropriate code. 
> > On Nov 3, 2023, at 7:27 AM, coco--- via Coco <coco at maltedmedia.com> wrote:
> > hi09a.s(75) : ERROR : Undefined symbol I$WritLn
> > hi09a.s:00075  os9 I$WritLn
> > 
> > hi09a.s(79) : ERROR : Undefined symbol F$Exit
> > hi09a.s:00079  os9 F$Exit

In these cases, "os9 $8C" should work for I$WritLn, and "os9 $06"
should work for F$Exit.

Defining I$WritLn and F$Exit using equates should also work.


> > So rather then pursue this further I would like to know how to write
> > an assembly program that takes parameters directly from the os.
    [...]
> > {Term | 02 }/DD:hayu Charlie
> > Hello Charlie.

This should be doable in the usual way by using the argc and argv
parameters that main() can receive, provided that it is declared
like this:

int main(int argc, char *argv[])

-- 
Pierre Sarrazin <sarrazip @ sarrazip . com>


More information about the Coco mailing list