Re: A92: serious help here please


[Prev][Next][Index][Thread]

Re: A92: serious help here please




You need to download the fargo toolkit to be able to program in 92 assembly.
It contains an assembler and a linker (among other things).  You can't just
type in the assembly code and send it, you have to assemble + link it first.
Theoretically you could do it in a hex editor, type in the opcodes, find out
all the relative addresses and hardcode them in, but you'd still have to make
your brain output (compressed?) relocation data.  In short, you'd waste all
your time if you memorized the numbers of the opcodes and typed them in like
that, and you wouldn't be getting yourself anywhere.  So use assembly
language, not machine code, and you probably will never need to know the
opcode numbers, unless you write a debugger or something like that.  The fargo
docs (they come with the fargo toolkit) detail the format of .asm files you
need to use, as well as how to make library calls (which include rom calls, as
rom calls are treated as calls to the tios lib (which isn't really a lib, but
you use it like one...just read the docs to see)).  The VAT is very hard to
use, and certainly not for a beginning programmer.  No matter how experienced
you are with other languages, assembly is an almost completely new and
different adventure from them, and you can't assume that just because you can
do file access in C that you can do it in 92 assembly.  Also, file access
under Fargo will not be stable until Fargo 0.3.0, which I suspect will be
released simultaneously for the 92 and for the 92+ (I think that's why it
hasn't come out yet).  Anyhow, in 92 assembly data can be stored in the
executable and will be retained from one run to the next.  Then you quote
something about making a romcall, which you then pass off as being badly
written, and non explanatory.  This it may be, I don't know, because that is
detailing making a rom call for a TI-8X calc (I couldn't tell you which, I've
never programmed one).  HL is something on a z80, hence not for the 92.  You
might be less confused if you only read docs about assembly on the 92.  Rom
calls on the 92 are made by pushing the parameters backwards onto the stack,
and then doing a "jsr tios::romcallname", then popping the parameters back off
the stack.  As a side note, rom calls often destroy registers d0, d1, a0, and
a1, so you should prepare for that before calling one.  However, you can learn
all this from the docs that come with fargo, and the tutorials (the one I used
was 68kguide.txt  I don't know if it has been updated for fargo II.  However,
the only difference for a beginning is the file format...the explanation of
the individual instructions and other programming issues is still very
helpful).  After you get these, you can also download some simple code from
the TI-92 assembly source directory on ticalc.org.  Reading source always
helps in learning the language (although it can be very hard to read
uncommented assembly source...try to find some that is commented.)  Finally, I
would like to advise you that assembly language has a very steep learning
curve.  On one hand I want like to say don't give up, but on the other hand if
you're getting impatient with it before even getting an assembler, maybe it
just isn't the thing for you.