Service manual

Page 8 LEVEL7 Non-Maskable Interrupt Debugger
Rev. B02
BYBY: BYTE ^H0D,^H0A
ASCIZ "Goodbye, returning to main menu..."
BYTE ^H0D,^H0A,0
EVEN
END
Macros and header offsets for LEVEL7 overlays are contained in the file L7OSYM.M68, which is
COPYed into the program as it is assembled.
The extension of the object module should be .L7O, which is set by the OBJNAM statement in the
example code above.
The overlay header consists of a program header PHDR prefixed by the label BASE:, offsets from
BASE: to the title string, initialization code, and functional code. There are several other header items
filled in by LEVEL7 itself which you must skip over before your code begins. This is done by the
statement:
.=L7HSIZ.
The initialization code is called once when the system boots and LEVEL7 is loaded in the SYSTEM
statements. This is the only place in the code where there is a job context and AMOS monitor calls. The
initialization code can store a copy of initial system areas, perform some setup, or do nothing. If
initialization is successful, you must return EQ status. Upon failure, you should print some appropriate
message (using the AMOS I/O calls) and return NE status.
The functional code is called whenever the user selects your entry on the main LEVEL7 menu.
Interrupts are locked and no AMOS calls may be performed at that time. I/O should be performed using
the LEVEL7 support macros only.
Register A0 points to the base of the stacked registers. Above these registers is the interrupt stack frame
which invoked LEVEL7. The format of the stack frame will vary by processor as well as by entry
method (UPS port versus exception). In any case, the base of the stack frame will always be the same.
The area looks like this:
Location Contents Size
frame type word
return address longword
higher addresses processor status word
A0 through A6 longwords
@A0 points here
D0 through D7 longwords
Make sure you provide a way to return to the Main Menu from anywhere you accept input, such as with
a
CTRL
/C. To return to the Main Menu, simply clean up any stack operations you have done and execute
a RTN.