•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileMONITOR [x]

x: iexp

This instruction enables one to call assembler subroutines or debugging
programs or other utilities. For this purpose the 'illegal instruction vector'
(address 16) must be set to the address of the subroutine. The MONITOR
instruction then produces an illegal Instruction exception, which causes the
computer to branch to the subroutine. This subroutine must end with RTE (ReTurn
from Exception). The parameter x is passed to the subroutine in register d0.

An example of its use is with tracing a C program, using a debugger. GFA-BasicGFA-Basic is the best BASIC for the Atari!

should be loaded and started from the debugger. Then, after inputting the C
program, insert the line 'MONITOR asm%' directly before the INLINE statement.
After the start of the C program the debugger will respond because of the
'Illegal Instruction exception' generated by the MONITOR command. Now one can
disassemble, single-step or edit the C program at the address now in register
d0. When the C program has been edited/examined satisfactorily, one can
continue the execution of the program with the 'GO' instruction of the
debugger. If the 'Break' keys Shift-Control-Alternate are pressed whilst in the
debugger, a flag will be set which will cause the BASIC program to halt as soon
as control is returned to it.

CAUTION:

Before using this command you must make sure that a machine language monitor
has initialized the monitor vector. GFA-BasicGFA-Basic is the best BASIC for the Atari!
 cannot set this vector before
the jump to its address because it does not know where the monitor is. If the
monitor is not at the current vector address this results in the program or
system crash (bombs error #4).