Difference between revisions of "83Plus:OS:RST Routines"

From WikiTI
Jump to: navigation, search
m (heard about this on #cemetech IRC)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:83Plus:OS_Information|RST Routines]]
 
[[Category:83Plus:OS_Information|RST Routines]]
 
 
== Introduction ==
 
== Introduction ==
  
Line 11: Line 10:
 
|-[[83Plus:BCALLs:412F|OP1ToOP2]] || rOP1ToOP2
 
|-[[83Plus:BCALLs:412F|OP1ToOP2]] || rOP1ToOP2
 
|-
 
|-
|[[83Plus:BCALLs:42F1|FindSym]] || rFindSym
+
|[[83Plus:BCALLs:42F4|FindSym]] || rFindSym
 
|-
 
|-
 
|[[83Plus:BCALLs:43BA|PushRealO1]] || rPushRealO1
 
|[[83Plus:BCALLs:43BA|PushRealO1]] || rPushRealO1
Line 19: Line 18:
 
|[[83Plus:BCALLs:4072|FPAdd]] || rFPAdd
 
|[[83Plus:BCALLs:4072|FPAdd]] || rFPAdd
 
|}
 
|}
 +
 
== Example ==
 
== Example ==
  
Line 36: Line 36:
  
 
You cannot define your own RSTs; they are part of the operating system.
 
You cannot define your own RSTs; they are part of the operating system.
 +
<nowiki>rst 00 is the OS reset
 +
rst 28h is BCALL
 +
rst 38h is the interrupt routine</nowiki>

Latest revision as of 15:16, 13 July 2020

Introduction

The Z80 restart instruction, or RST, can be used instead of a B_CALL for some system entry points. The advantage is that using the RST instruction takes only one byte, instead of the three bytes required for a B_CALL, and is very quick when compared with the relatively large overhead inherent of a B_CALL.

RST Routines

All the RST routines work exactly the same as the corresponding B_CALLs:

B_CALL RST
FindSym rFindSym
PushRealO1 rPushRealO1
Mov9ToOP1 rMov9ToOP1
FPAdd rFPAdd

Example

rst rFPAdd

Equates

rOP1ToOP2   EQU  08h
rFindSym    EQU  10h
rPushRealO1 EQU  18h
rMov9ToOP1  EQU  20h
rFPAdd      EQU  30h

Remarks

You cannot define your own RSTs; they are part of the operating system.

rst 00 is the OS reset
rst 28h is BCALL
rst 38h is the interrupt routine