1 <!doctype linuxdoc system>
5 <title>Ohio Scientific-specific information for cc65
7 <url url="mailto:stephan.muehlstrasser@web.de" name="Stephan Mühlstrasser"><newline>
11 An overview over the Ohio Scientific runtime system as it is implemented for the cc65 C
15 <!-- Table of contents -->
18 <!-- Begin the document -->
22 This file contains an overview of the Ohio Scientific runtime system as it comes with the
23 cc65 C compiler. It describes the memory layout, Ohio Scientific-specific header files,
24 and any pitfalls specific to that platform.
26 Please note that Ohio Scientific-specific functions are just mentioned here, they are
27 described in detail in the separate <url url="funcref.html" name="function
28 reference">. Even functions marked as "platform dependent" may be available on
29 more than one platform. Please see the function reference for more
34 Currently the target "osic1p" is implemented. This works for the Ohio Scientific
35 Challenger 1P machine.
37 <sect>Binary format<p>
39 The standard binary output format generated by the linker for the osic1p target
40 is a machine language program.<p>
42 For uploading into a real machine over the serial port or into an emulator a
43 program must be converted to a text file that is understood by the 65V PROM
44 monitor. For this purpose the srec_cat program from the
45 <url url="http://srecord.sourceforge.net/" name="SRecord"> tool collection can be used.
47 Care must be taken that the -offset and -execution-start-address options for the srec_cat
48 program correspond to the start address of the executable.
50 Example for converting an executable "hello" that was built for the default
51 start address $0200 to an uploadable file "hello.c1p":
54 srec_cat hello -binary -offset 0x200 -o hello.c1p -Ohio_Scientific -execution-start-address=0x200
57 <sect>Memory layout<p>
59 By default programs compiled for the osic1p target are configured for 32 kB RAM.
60 The RAM size can be configured via the symbol __HIMEM__.
65 <tag/Program start address/
66 The default start address is $0200. The start address is configurable
67 via the compiler option --start-addr.
70 The C runtime stack is located at the top of RAM and growing downwards.
71 The size is configurable via the symbol __STACKSIZE__. The default
72 stack size is $0400.
75 The C heap is located at the end of the program and grows towards the C
79 The 1 kB video RAM is located at $D000. On the monitor only a subset
80 of the available video RAM is visible. The address of the upper left corner
81 of the visible area is $dollar;D085 and corresponds to conio cursor
86 Example for building a program with start address $0300, stack size
87 $0200 and RAM size $0200:
90 cl65 --start-addr 0x300 -Wl -D,__HIMEM__=$2000,-D,__STACKSIZE__=$0300 -t osic1p hello.c
93 <sect>Platform-specific header files<p>
95 Programs containing PET-specific code may use the <tt/pet.h/ or <tt/cbm.h/
99 <sect1>PET-specific functions<p>
101 There are currently no special Ohio Scientific functions.
103 <sect1>Hardware access<p>
105 There is no specific support for direct hardware access.
107 <sect>Loadable drivers<p>
109 There are no loadable drivers available.
113 <sect1>conio implementation<p>
115 The conio implementation is complete except for the kbhit() function. A
116 call to cgetc() always blocks until a character is entered.
118 <sect1>stdio implementation<p>
120 There is no support for stdio at the moment.
124 <sect1>Passing arguments to the program<p>
126 There is currently no support for passing arguments to a program.
128 <sect1>Program return code<p>
130 The program return code currently has no effect. When the main() function
131 finishes, the boot prompt is shown again.
135 This software is provided 'as-is', without any expressed or implied
136 warranty. In no event will the authors be held liable for any damages
137 arising from the use of this software.
139 Permission is granted to anyone to use this software for any purpose,
140 including commercial applications, and to alter it and redistribute it
141 freely, subject to the following restrictions:
144 <item> The origin of this software must not be misrepresented; you must not
145 claim that you wrote the original software. If you use this software
146 in a product, an acknowledgment in the product documentation would be
147 appreciated but is not required.
148 <item> Altered source versions must be plainly marked as such, and must not
149 be misrepresented as being the original software.
150 <item> This notice may not be removed or altered from any source