Re: A86: Learning ASM by A Simple Method
[Prev][Next][Index][Thread]
Re: A86: Learning ASM by A Simple Method
3. the z80 chip understands nothing but compiled machine code, not ascii.
the source code is obviously written in ascii, but it is then converted into
machine code by the compiler.
4. wrong. .org tells the compiler what the address offset is. you could
have code without a .org, but all the addresses would be messed up. .org
_asm_exec_ram makes it so that the compiler assumes that you're starting at
_asm_exec_ram (that's where the program is run on the calculator).
5. ret is from any call, not just the initial one made by the rom.
subroutines will end in ret also.
In a message dated 4/21/99 21:25:25 Eastern Daylight Time,
warhorse@bellatlantic.net writes:
> In an attempt to make myself known, and for colleges to like me, I am
> going to make a small series of ASM tutorials. The difference between
> these and say, ACZ's is that I am a beginner too. If you are new to ASM,
> I hope you can benifit from this, since it is not as indepth as a
> tutorial made by a full fledged expert.
>
> 1. Get ASM Studio. It is a compiler made by some genius. I think it is
> at ACZ's website.
> 2. Try to get an Emulator. I could never get the damn things to work, so
> I just send the programs to my calc every time to test it.
> 3. Include files. To learn a programming language, it is best to
> understand why, and not as "it just is." Include files are always at the
> top of the document. #include "Ti86asm.inc" is the most common one. They
> are essentially tables of equates. The Z80 chip understands ASCII only
> (I think?). Therefore you have to change your text commands into ASCII
> numbers. For example, if you type call_clrLCD, then compile it, the
> compiler looks at the include files for that command then writes the
> ASCII code for it into the ASM file for your calc (The equate for the
> ASCII code for clearing the screen is call_clrLCD. Without these, you
> would have a hell of a time trying to remember the ASCII numbers and
> letters that tells the calc. to clear the screen.)
> call_clrLCD-->compile-->ASCII code the computer reads. Obviously,
> include files are important!
> 4. .org _asm_exec_ram This is the equate that tells the calc. that the
> program is starting.
> 5. ret This tells the calc. to return to the operating
> system, home screen, AShell, Rascall, etc. Without it, you go into an
> endless loop.
> 6. .end The end of the program source. Does not tell the
> calc. to end the program. That was number 5
> 7. comments are made after a semicolon (;)
> Might want to back up your calc files before trying this just incease ;)
>
> Review program:
> #include "Ti86asm.inc"
> .org _asm_exec_ram
> call _clrLCD ;note the indentation. This is called "white space"
> more later..
> ret
> .end
>
> This program clears the screen.
> Note: You must type this into a compiler on your computer. If you type
> it into your calc, it won't work. Remember, the compiler converts the
> above into machine code. If you use chmasc by Kirk Meyer, notice the
> RESTORE program is letters and numbers.... you are lucky to have the
> compiler on your computer. Typing letters and numbers in to write a
> program would be a bitch.
> All for now!
> Did I make a mistake? LMK!!
> Terrence Wong
>
Follow-Ups: