73 lines
2.0 KiB
HTML
73 lines
2.0 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20">
|
||
|
<TITLE>Commodore Plus/4 specific information for cc65: Other hints</TITLE>
|
||
|
<LINK HREF="plus4-8.html" REL=next>
|
||
|
<LINK HREF="plus4-6.html" REL=previous>
|
||
|
<LINK HREF="plus4.html#toc7" REL=contents>
|
||
|
</HEAD>
|
||
|
<BODY>
|
||
|
<A HREF="plus4-8.html">Next</A>
|
||
|
<A HREF="plus4-6.html">Previous</A>
|
||
|
<A HREF="plus4.html#toc7">Contents</A>
|
||
|
<HR>
|
||
|
<H2><A NAME="s7">7.</A> <A HREF="plus4.html#toc7">Other hints</A></H2>
|
||
|
|
||
|
|
||
|
|
||
|
<H2><A NAME="ss7.1">7.1</A> <A HREF="plus4.html#toc7.1">Passing arguments to the program</A>
|
||
|
</H2>
|
||
|
|
||
|
|
||
|
<P>Command line arguments can be passed to <CODE>main()</CODE>. Since this is not
|
||
|
supported by BASIC, the following syntax was chosen:</P>
|
||
|
<P>
|
||
|
<BLOCKQUOTE><CODE>
|
||
|
<PRE>
|
||
|
RUN:REM ARG1 " ARG2 IS QUOTED" ARG3 "" ARG5
|
||
|
</PRE>
|
||
|
</CODE></BLOCKQUOTE>
|
||
|
</P>
|
||
|
<P>
|
||
|
<OL>
|
||
|
<LI>Arguments are separated by spaces.</LI>
|
||
|
<LI>Arguments may be quoted.</LI>
|
||
|
<LI>Leading and trailing spaces around an argument are ignored. Spaces within
|
||
|
a quoted argument are allowed.</LI>
|
||
|
<LI>The first argument passed to <CODE>main</CODE> is the program name.</LI>
|
||
|
<LI>A maximum number of 10 arguments (including the program name) are
|
||
|
supported.</LI>
|
||
|
</OL>
|
||
|
</P>
|
||
|
|
||
|
|
||
|
|
||
|
<H2><A NAME="ss7.2">7.2</A> <A HREF="plus4.html#toc7.2">Program return code</A>
|
||
|
</H2>
|
||
|
|
||
|
|
||
|
<P>The program return code (low byte) is passed back to BASIC by use of the
|
||
|
<CODE>ST</CODE> variable.</P>
|
||
|
|
||
|
|
||
|
<H2><A NAME="ss7.3">7.3</A> <A HREF="plus4.html#toc7.3">Interrupts</A>
|
||
|
</H2>
|
||
|
|
||
|
|
||
|
<P>The runtime for the Plus/4 uses routines marked as <CODE>.CONDES</CODE> type 2 for
|
||
|
interrupt handlers. Such routines must be written as simple machine language
|
||
|
subroutines and will be called automatically by the interrupt handler code
|
||
|
when they are linked into a program. See the discussion of the <CODE>.CONDES</CODE>
|
||
|
feature in the
|
||
|
<A HREF="ca65.html">assembler manual</A>.</P>
|
||
|
|
||
|
|
||
|
|
||
|
<HR>
|
||
|
<A HREF="plus4-8.html">Next</A>
|
||
|
<A HREF="plus4-6.html">Previous</A>
|
||
|
<A HREF="plus4.html#toc7">Contents</A>
|
||
|
</BODY>
|
||
|
</HTML>
|