[A83] Re: RST Command


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

[A83] Re: RST Command



> Van: Brian Laferriere <BMagickle@hotmail.com>
> 
> In all the documentation I have searched through I cannot find what the
> RST command does. I know it varies depending on the value passed to it,
> and I know there are only certain valid values. Can anyone tell me what
> they do?
> 
> RST 0, RST 8H, RST 10H, RST 18H, RST 20H, RST 28H, RST 30H, RST 38H

It's simple, RST is just like a call. It pushes the current adress to the
stack and jumps. Calls take up 3 bytes in memory, RSTs only 1 byte, but
they can only call the adresses you stated.

If you are really interested, the 'normal' usage for RST is when using
interrupt mode 0. In IM0 a device (keyboard, etc.) can stop the Z80 and
give it a one-byte instruction. Since calls are bigger than 1 byte, they
made a smaller instruction. You needed to put a jump or something to the
interrupt-handling (ex, for the keyboard) at the adresses you can RST to.

Neither of the Ti8xs make use of IM0 though... Actually your calc will
crash if you execute "im 0".

Since there are no IM0-devices, Ti could put some jumps to frequently used
instructions at the RST adresses. It is shorter/faster to use the RST
commands.

These are the descriptions of the RSTs on the Ti83-:

+- Startup, __bank_jump, __bank_entry, __bank_call,
__bank_ret------+-------+
|                   |  0000 |  0000 |  0000 |  0000 |  0000 |  0000 |  0000
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
| Jump to:          |  ???? |  ???? |  ???? |  ???? |  ???? |  ???? |  017D
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
input: none
result: This is the place where the processor starts executing
instructions,
        after it has been reseted, this is almost always because of power-
        failure, e.g. batteries taken out.
   !!!CALLING THIS ROUTINE MEANS RESETTING YOUR CALC!!!
NOTE: Although you may think your calc should be resetted by this call, it
      just simply crashes, even if no interrupt program is installed. This
is
      maybe because Ti suspects that all registers are zeroed when the CPU
      is executing this code, like after a power-failure. If it isn't like
      that after executing a program, this ROMcall will 'fail'...

+- RST 8h ----------+
+  RST _OP1TOOP2   
+-------+-------+-------+-------+-------+-------+-------+
|                   |  0008 |  0008 |  0008 |  0008 |  0008 |  0008 |  0008
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
| Jump to:          |  ???? |  ???? |  ???? |  ???? |  19A5 |  ???? |  19E4
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
input: OP1
output: OP2 = OP1
destroyed: ????
description: Copy OP1 to OP2

             -Linus Akkeson/Jimmy Conner

+- RST 10h ---------+
+  RST _FINDSYM    
+-------+-------+-------+-------+-------+-------+-------+
|                   |  0010 |  0010 |  0010 |  0010 |  0010 |  0010 |  0010
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
| Jump to:          |  ???? |  ???? |  ???? |  ???? |  ???? |  ???? |  224C
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
input: OP1
output: DE = pointer to sizebytes
        HL = pointer to VAT-entry
destroyed: ????
description: Find variable in VAT ??program and non-program??

             -Linus Akkeson/Jimmy Conner

+- RST 18h ---------+
+  RST RPUSHREALO1 
+-------+-------+-------+-------+-------+-------+-------+
|                   |  0018 |  0018 |  0018 |  0018 |  0018 |  0018 |  0018
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
| Jump to:          |  ???? |  ???? |  ???? |  ???? |  ???? |  ???? |  29BE
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
input: OP1
output: OP1 is pushed onto the FP-stack
destroyed: ????
description: Same as "call _PUSHREALOP1", but RST is 2 bytes shorter.

             -Linus Akkeson/Jimmy Conner

+- RST 20h ---------+
+  RST _MOV9TOOP1  
+-------+-------+-------+-------+-------+-------+-------+
|                   |  0020 |  0020 |  0020 |  0020 |  0020 |  0020 |  0020
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
| Jump to:          |  ???? |  ???? |  ???? |  ???? |  ???? |  ???? |  1AB6
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
input: HL = pointer to 9 bytes
output: OP1 = the 9 bytes at (HL)
      ??HL  = HL + 9??
destroyed: ??HL, DE??
description: Move 9 bytes at HL to OP1

             -Linus Akkeson/Jimmy Conner

+- RST 28h ---------+
+  RST _FPMULT     
+-------+-------+-------+-------+-------+-------+-------+
|                   |  0028 |  0028 |  0028 |  0028 |  0028 |  0028 |  0028
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
| Jump to:          |  ???? |  ???? |  ???? |  ???? |  0983 |  ???? |  09C2
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
input: OP1, OP2
output: OP1 = OP1 * OP2
destroyed: ????
description: OP1 * OP2 -> OP1

             -Linus Akkeson/Jimmy Conner

+- RST 30h ---------+
+  RST _FPADD      
+-------+-------+-------+-------+-------+-------+-------+
|                   |  0030 |  0030 |  0030 |  0030 |  0030 |  0030 |  0030
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
| Jump to:          |  ???? |  ???? |  ???? |  ???? |  0896 |  ???? |  08D5
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
input: OP1, OP2
output: OP1 = OP1 + OP2
destroyed: ????
description: OP1 + OP2 -> OP1

             -Linus Akkeson/Jimmy Conner

+- RST 38h
---------+-------+-------+-------+-------+-------+-------+-------+
|                   |  0038 |  0038 |  0038 |  0038 |  0038 |  0038 |  0038
|
+-------------------+-------+-------+-------+-------+-------+-------+-------
+
input: none (although a bunch of flags affect the system interrupt)
output: none
destroyed: none
description: Begin of TIOS interrupt.

	Henk Poley <><




Follow-Ups: