Service manual
LEVEL7 Non-Maskable Interrupt Debugger Page 7
Rev. B02
EXAMPL.M68 Example Overlay
LEVEL7 includes source code for an example overlay file. By examining this and using it as a template
you will be able to understand the requirements of LEVEL7 overlays:
; EXAMPL - Example LEVEL7 overlay source - does nothing special
SEARCH SYS
SEARCH SYSSYM
COPY L7OSYM
OBJNAM .L7O
RADIX 16
VMAJOR = 1
VMINOR = 0
VSUB = 0
VEDIT = 100.
VWHO = 0
; overlay MUST have the label BASE: at the base of the module!
BASE: PHDR -1,0,0 ; Program version area
LWORD NAME-BASE ; Offset to menu item text
LWORD INIT-BASE ; Offset to initialization code
LWORD CODE-BASE ; Offset to functional code
.=L7HSIZ ; skip the rest of the overlay header
; String which will appear as overlays menu entry
NAME: ASCIZ "Example extended function"
EVEN
; Initialization code (not really much to do right now)
; Called at boot time with boot jobs context, USE AMOS CALLS
INIT: TYPECR <Example overlay loaded and ready>
LCC #PS.Z ; successful return
RTN
; Actual code called by LEVEL7, A0 points to stacked registers upon entry.
; Interrupts locked, no job context, DON'T USE AMOS CALLS
CODE: STROUT HELLO1 ; output first part of welcome msg
MOV A0,D1 ; get address of stacked registers
HEXOUT #8. ; output all 8 nibbles
STROUT HELLO2 ; finish welcome message
10$: STROUT PROMPT ; output prompt
CHRIN ; get a keystroke
CMPB D1,#'Q ; 'Q' hit?
BEQ 20$ ; yes - leave
CMPB D1,#'q ; 'q' hit?
BNE 10$ ; no - prompt user again
20$: STROUT BYBY ; say bye
RTN ; back to main menu
; Messages
HELLO1: ASCII "Hello, welcome to the example overlay"
BYTE ^H0D,^H0A
ASCII "function. The stacked registers are"
BYTE ^H0D,^H0A
ASCIZ "at "
EVEN
HELLO2: ASCII ". Press Q to leave here."
BYTE ^H0D,^H0A,0
EVEN
PROMPT: BYTE ^H0D,^H0A
ASCIZ "Press 'Q': "
EVEN