]> git.sur5r.net Git - cc65/blob - doc/osi.sgml
Fixed URL for SRecord.
[cc65] / doc / osi.sgml
1 <!doctype linuxdoc system>
2
3 <article>
4
5 <title>Ohio Scientific-specific information for cc65
6 <author>
7 <url url="mailto:stephan.muehlstrasser@web.de" name="Stephan M&uuml;hlstrasser"><newline>
8 <date>2015-02-04
9
10 <abstract>
11 An overview over the Ohio Scientific runtime system as it is implemented for the cc65 C
12 compiler.
13 </abstract>
14
15 <!-- Table of contents -->
16 <toc>
17
18 <!-- Begin the document -->
19
20 <sect>Overview<p>
21
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.
25
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
30 information.
31
32 <sect>Targets<p>
33
34 Currently the target "osic1p" is implemented. This works for the Ohio Scientific
35 Challenger 1P machine.
36
37 <sect>Binary format<p>
38
39 The standard binary output format generated by the linker for the osic1p target
40 is a machine language program.<p>
41
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">
46 tool collection can be used.
47
48 Care must be taken that the -offset and -execution-start-address options for the srec_cat
49 program correspond to the start address of the executable.
50
51 Example for converting an executable "hello" that was built for the default
52 start address &dollar;0200 to an uploadable file "hello.c1p":
53
54 <tscreen>
55 srec_cat hello -binary -offset 0x200 -o hello.c1p -Ohio_Scientific -execution-start-address=0x200
56 </tscreen>
57
58 <sect>Memory layout<p>
59
60 By default programs compiled for the osic1p target are configured for 32 kB RAM.
61 The RAM size can be configured via the symbol __HIMEM__.
62
63 Special locations:
64
65 <descrip>
66   <tag/Program start address/
67   The default start address is &dollar;0200. The start address is configurable
68   via the compiler option --start-addr.
69
70   <tag/Stack/
71   The C runtime stack is located at the top of RAM and growing downwards.
72   The size is configurable via the symbol __STACKSIZE__. The default
73   stack size is &dollar;0400.
74
75   <tag/Heap/
76   The C heap is located at the end of the program and grows towards the C
77   runtime stack.
78
79   <tag/Video RAM/
80   The 1 kB video RAM is located at &dollar;D000. On the monitor only a subset
81   of the available video RAM is visible. The address of the upper left corner
82   of the visible area is $dollar;D085 and corresponds to conio cursor
83   position (0, 0).
84
85 </descrip><p>
86
87 Example for building a program with start address &dollar;0300, stack size
88 &dollar;0200 and RAM size &dollar;0200:
89
90 <tscreen>
91 cl65 --start-addr 0x300 -Wl -D,__HIMEM__=$2000,-D,__STACKSIZE__=$0300 -t osic1p hello.c
92 </tscreen>
93
94 <sect>Platform-specific header files<p>
95
96 Programs containing Ohio Scientific-specific code may use the <tt/osic1p.h/ 
97 header file. 
98
99
100 <sect1>Ohio Scientific-specific functions<p>
101
102 There are currently no special Ohio Scientific functions.
103
104 <sect1>Hardware access<p>
105
106 There is no specific support for direct hardware access.
107
108 <sect>Loadable drivers<p>
109
110 There are no loadable drivers available.
111
112 <sect>Limitations<p>
113
114 <sect1>conio implementation<p>
115
116 The conio implementation is complete except for the kbhit() function. A
117 call to cgetc() always blocks until a character is entered.
118
119 <sect1>stdio implementation<p>
120
121 There is no support for stdio at the moment.
122
123 <sect>Other hints<p>
124
125 <sect1>Passing arguments to the program<p>
126
127 There is currently no support for passing arguments to a program.
128
129 <sect1>Program return code<p>
130
131 The program return code currently has no effect. When the main() function
132 finishes, the boot prompt is shown again.
133
134 <sect>License<p>
135
136 This software is provided 'as-is', without any expressed or implied
137 warranty.  In no event will the authors be held liable for any damages
138 arising from the use of this software.
139
140 Permission is granted to anyone to use this software for any purpose,
141 including commercial applications, and to alter it and redistribute it
142 freely, subject to the following restrictions:
143
144 <enum>
145 <item>  The origin of this software must not be misrepresented; you must not
146         claim that you wrote the original software. If you use this software
147         in a product, an acknowledgment in the product documentation would be
148         appreciated but is not required.
149 <item>  Altered source versions must be plainly marked as such, and must not
150         be misrepresented as being the original software.
151 <item>  This notice may not be removed or altered from any source
152         distribution.
153 </enum>
154
155 </article>