Programming for ZeS is nor hard, you have to options, in your program, you:
use librairies
you don't
If you don't want to use CONVERT
program (on-calc) you just need to do this:
REPLACE
.org 9327h
WITH
.org
931Eh \
.db E7h,"9_ZES"
.db 3Fh,D5h,3Fh
in your source code and compile it normaly :) -program must be
squished!
(See sample.asm) |
Programming using SOS librairies
If you want to program using librairies then write your program just like if it was
for SOS.
Here is an piece of the Readme file from SOS by Joe Wingbermuehle:
.nolist
#include "sos.inc" ;
contains the lib/vector definitions
.list
.org $9327
;----> This code is required for ALL SOS programs:
ccf ; make this program SOS
compatable
jr Program
; jump to the start of the program
.dw Libraries-$9327 ; pointer to a
list of libraries used ($0000 if none used)
.dw Description ; pointer to a
description (0 terminated)
;----> end required code
Program:
call vector1 ; call library ZLIB
routine 0
call vector0 ; call library ZLIB
routine 3
ret
Description:
.db "THE Ultimate Game by BOB!",$00
Libraries:
.db "ZLIB",0,0,0,0,lib0,vect1
; set up vector 2 to be ZLIB routine 0
.db "ZLIB",0,0,0,0,lib3,vect0
; set up vector 0 to be ZLIB routine 3
.db $FF ;
end of libraries
.end
END
The library format:
-First 8 bytes are the library name (use 0s if less than 8 bytes).
-Library routine (lib0....libF)
-Vector number (vect0....vectF)
- [ $FF if end of list, otherwise continue the list...]
*---->All asm programs MUST be compressed!
*---->DO NOT USE THE MEMORY AREA CMDSHADOW!!!!!
Using the cmdshadow could cause the calc to crash!
(if you use only the first 13 bytes at the beginning no harm will be
done). |
Don't use cmdshadow memory area because the loader and the
librairies pointer are stored in it.
If a program requires a librairie that is not in your calc,
then you'll see an "ERROR:[libname]" message at the bottom of the screen.
You won't have to clear the screen and the graph buffer since
ZeS does it when a program is started.
Programming without using
librairies
Things are really easy here. Just write your program (no special header is
required, no description) and use Devpac83 on a computer to compile it or use SQUISH.83p
on-calc.
Then send CONVERT.83p to your calc and your own program and type at home screen:
"PROGNAME
Send(9prgmCONVERT
That's it! You can now execute your program via commandline just like you would for
a basic program (ZeS must be installed!).
|