⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 monvisi.inc

📁 VRTX 商用嵌入式实时操作系统
💻 INC
字号:
;---------------------------------------------------------------------------
;	@(#)monvisi.inc	7.2	11/25/91
; monvisi.inc - XRAYMON visible declarations
;
; $Author:   Kjell_Christenson,_Digitailor_AB  $
;
; ------- MRI REVS -------
;
;	Rev 7.2		G. Boehm, MRI, November 25, 1991
;			Unify register numbering between XHM & XDM
;
;	Rev 7.1		G. Boehm, MRI, November 12, 1991
;			Digitailor Merge (RTOS)
;			(merge Digitailor Revs 1.3-1.4)
;
;	New rev #1.1	J. Fuchigami, MRI, March 19, 1991
;			Put under SCCS
;
; ------- DIGITAILOR REVS -------
; 
;    Rev 1.4   19 Jul 1991 11:07:20   kjell
; New breakpoint status defined: STAT_IA, used to report hardware breakpoints
;   when the execution is stopped *after* the execution of the instruction.
; 
;    Rev 1.3   14 Jun 1991 15:59:58   kjell
; New constants: UTL_SETREG, UTL_GETREG, UTL_RESET, UTL_REINIT, EXE_EVENT, 
;   CORTOS, CH_FIRST, EXE_GO_MODE, EXE_TRACE_MODE, MODE_NORM, MODE_RTOS, 
;   IDLE_RX, IDLE_TX, IDLE_SUM, IDLE_INI, ER_TOUT, MON_MESSAGE, ER_MESSAGE, 
;   MON_PARSE, ER_PARSE, MON_VALUE, ER_VALUE.
; New fields in config-table: cfutlhk, cfsushk (replaced cfrmbz2, cfrmbz3)
; The definitions for all register numbers (REG_xx) are now available.
; 
;    Rev 1.2   26 May 1990 14:56:58   Kjell_Christenson,_Digitailor_AB
; New config field CFEXTHK for extension hook (RMBZ2).
; New config field CFUSRCODE (RMBZ3) to supply start address of monitor-
;  support-code. This is only provided if it is immediately before mon_start.
;  It is used to protect writes into the Monitor and support code by XRAY.
; Two new reserved field added to config table (RMBZ2 & RMBZ3).
; 
;    Rev 1.1   21 May 1990 17:49:18   Kjell Christenson, DIGITAILOR AB
; Correction of bad valued for constants CCPUV20 and up.
; New constants: INI_INIT, INI_REINIT, MOREINIT, COCALLRST..
; 
;    Rev 1.0   06 Apr 1990 15:46:40   Kjell Christenson, DIGITAILOR AB
; Initial revision.
; 
;---------------------------------------------------------------------------
; configuration table
MCFTBL struc
    CFWORKSP 	dd	0	; pointer to workspace
    CFWSSIZ	dd	0	; workspace size (bytes)
    CFCODESP 	dd	0	; pointer to codespace
    CFCSSIZ 	dd	0	; codespace size
    CFOPTS	dw	0	; options
    CFCPUTYP 	dw	0	; cpu type
    CFDELAY 	dw	0	; delay loops before timeout
    CFMAXBP 	dw	0	; max number of breakpoints
    CFBPINSTR 	dd	0	; breakpoint instruction
    CFBPVECT 	dd	0	; breakpoint vector
    CFAUXVECT 	dd	0	; auxiliary monitor invoke vector
    CFENALVL	db	0	; interrupt enable level
    CFRMBZ1	db	0	; reserved must be zero
    CFMBUFSIZ 	dd	0	; message buffer size
    CFIBUFSIZ 	dd	0	; input buffer size
    CFSCHEME 	dw	0	; max encoding scheme
    CFABVECT	dd	0	; abort vector
    CFOUTPOLL 	dd	0	; output poll routine
    CFINPOLL 	dd	0	; input poll routine
    CFSETBPHK 	dd	0	; set breakpoint hook
    CFAFFBPHK 	dd	0	; affect breakpoint hook
    CFINITHK 	dd	0	; initialization hook
    CFIDLEHK 	dd	0	; idle hook
    CFINTRHK 	dd	0	; interrupt enable/disable hook
    CFAUXMHK	dd	0	; auxiliary monitor hook
    CFEXECHK	dd	0	; start/stop execution hook
    CFHUMAN 	dd	0	; human component pointer
    CFEXTHK	dd	0	; extension hook
    CFUSRCODE 	dd	0	; start of user mon code area (for protect)
    CFUTLHK 	dd	0	; utility hook
    CFSUSHK 	dd	0	; suspend hook
    CFAUTOSTHK 	dd	0	; autostart hook
MCFTBL ends
; configuration options
COIBPSP	  equ	01H		; call bp-hook for instr bp
COIBPROM  equ	02H		; call bp-hook is instr bp set in ROM
COINIVECT equ	04H		; initialize the IVT (all vectors)
COHUMAN	  equ	08H		; start in human mode
COAUXMON  equ	20H		; auxiliary monitor used
COAUX2CH  equ	40H		; auxiliary monitor on separate channel
COFPU	  equ	80H		; floating point unit avail. (80x87)
COXIDLE	  equ	100H	; call idle hook during init & checksum calc.
COCALLRST equ	200H	; call command used to reach MORESTART
;CORTOS	  equ	400H	; run in RTOS (multitasking) mode (not impl.)
CORTOS	  equ	800H	; run in RTOS (multitasking) mode (not impl.)
CORTOS_EX equ	0C00H	; run in RTOS (multitasking) mode (not impl.)
COINTRPT  equ   2000H	;interupts allowed for communications  */
; cpu types
CCPU386   equ	206H		; 80386
CCPU486   equ	207H		; 80486
CCPUPENTIUM equ 218H
CCPUI386EX  equ	219H
CCPUNS486   equ 220H
; monitor call return codes
RET_OK	equ	0		; ok
ER_IHK	equ	1		; bad return from init hook
ER_NEW	equ	2		; not enough workspace
ER_CFG	equ	3		; bad config table, missing or bad entries
ER_HUM	equ	4		; bad or missing human component
ER_TMB	equ	5		; too many breakpoints reported
ER_HLT	equ	6		; halt message was received (from MORXCHR)
ER_IBF  equ	7		; interrupt input buffer full
ER_SUM	equ	8		; bad monitor code checksum found at init
; input codes to some monitor calls and hooks
CH_NORM	  equ	0		; normal chr in a msg (polled input/output)
CH_LAST	  equ	1		; last chr in a message (polled input/output)
CH_FIRST  equ	2		; first chr in a message (polled input/output)
AFF_CLR   equ	0		; clear breakpoint (affect brp hook)
AFF_ARM   equ	1		; arm breakpoints (affect brp hook)
AFF_DIS	  equ	2		; disarm breakpoints (affect brp hook)
INT_DIS   equ	0		; disable interrupts (intr hook)
INT_ENA   equ	1		; enable interrupts (intr hook)
AUX_ENTER equ	0		; enter auxiliary monitor (auxmon hook)
AUX_EXIT  equ	1		; exit auxiliary monitor (auxmon hook)
EXE_STOP  equ	0		; stop execution (exec hook)
EXE_START equ	1		; start execution (exec hook)
EXE_EVENT equ	2		; start execution + wait for event (exec hook)
EXE_GO_MODE    equ 0		; full speed execution (exec hook)
EXE_TRACE_MODE equ 1		; single step execution (exec hook)
UTL_GETREG equ	0		; get register (utility hook)
UTL_SETREG equ	1		; set register (utility hook)
UTL_RESET  equ	2		; reset command issued (utility hook)
UTL_REINIT equ	3		; monitor re-initialized (utility hook)
EXT_REPEAT equ	0		; repeat previous command (extension hook)
EXT_STAT   equ	1		; show status (extension hook)
EXT_SS	   equ	2		; set status (extension hook)
EXT_BC 	   equ	3		; break complex (extension hook)
IDLE_RX	   equ  0		; waiting for rec-char (idle hook)
IDLE_TX	   equ	1		; waiting for xmit-char (idle hook)
IDLE_SUM   equ  2		; calculating checksum (idle hook)
IDLE_INI   equ	3		; initializing (idle hook)
; output codes, retunred by hooks
ER_TBF	   equ	1		; output:UART transmit buffer full, try again
ER_REC	   equ	1		; input: rec err,bad-chr,parity,overrun etc.
ER_NCA     equ	2		; input: no character available
ER_TOUT    equ	9		; input: timeout (in RTOS mode only)
ER_BAD_DATA equ 2		; extension: bad data
ER_LIMIT   equ	4		; extension: monitor limitation
ER_MESSAGE equ	12 		; extension: message returned
ER_PARSE   equ	13		; extension: parse & invoke again
ER_VALUE   equ	14		; extension: value returned
; modes returned from MORXCHR
MODE_NORM  equ	0		; normal mode
MODE_RTOS  equ	1		; in RTOS mode
; breakpoint types (input to set/affect breakpoint hooks)
FLAG_I	equ	01H		; instruction breakpoint
FLAG_IT	equ	11H		; temporary instruction breakpoint
FLAG_R	equ	02H		; read breakpoint
FLAG_W	equ	04H		; write breakpoint
PORT_I	equ	08H		; port input breakpoint
PORT_O	equ	80H		; port output breakpoint
; breakpoint types (to report special breakpoints with the MOSPBREAK call)
STAT_I	equ	10H		; break on instruction fetch
STAT_IA	equ	11H		; break on instruction fetch,when stop after BP
STAT_R	equ	20H		; break on read
STAT_W	equ	40H		; break on write
STAT_PI	equ	08H		; break on port input
STAT_PO	equ	80H		; break on port output
; get_status status bits
COMINCNF equ 	8000H		; minimum monitor conf (output option bit)
; stop info status
STAT_NOINFO equ 0		; no more info
STAT_BRKP   equ 1		; breakpoint info
STAT_EXCP   equ 2		; exception info
; return codes, from monitor commands
MON_OK	     equ  0		; ok result
MON_BAD_ADDR equ  1		; bad address
MON_BAD_DATA equ  2		; bad data
MON_ROM_ADDR equ  3		; dest address is rom
MON_LIMIT    equ  4		; monitor limitation
MON_BAD_REG  equ  5		; bad register
MON_BUF_OFL  equ  6		; I/O buffer overflow, too much data
MON_HALT_    equ  7		; exec stopped due to user halt
MON_EXCP_    equ  8		; exec stopped due to exception
MON_BRKP     equ  9		; exec stopped due to instr breakp
MON_SP_BRKP  equ  10		; exec stopped due to special breakp
MON_SUM_WSP  equ  11		; workspace checksum error
MON_MESSAGE  equ  12		; message returned (ext cmd)
MON_PARSE    equ  13		; parse string & invoke again (ext cmd)
MON_VALUE    equ  14		; value returned (ext cmd)
MON_IO	     equ  15		; I/O request from monitor (running target) */
MON_MTASK    equ  16		; monitor multi-tasking enabled */
MON_NOCURR   equ  17		; no current task to execute */
MON_BREAKSET equ  18        ; breakpoint already set */
; exception types (internal codes)
EXCP_UNKN    equ  8000H		; unknown exception 
EXCP_BUS     equ  8001H		; bus exception (68K) 
EXCP_ADDR    equ  8002H		; address exception (68K) 
EXCP_OPC     equ  8003H		; illegal opcode 
EXCP_DIVZ    equ  8004H		; division with zero 
EXCP_BND     equ  8005H		; bound/chk exception 
EXCP_OVFL    equ  8006H		; overflow exception 
EXCP_PRIV    equ  8007H		; privilege exception 
EXCP_TRC     equ  8008H		; trace (single step) exception 
EXCP_COPR    equ  8009H		; coprocessor exception 
EXCP_DBLE    equ  800AH		; double fault exception 
EXCP_NMI     equ  800BH		; nmi trap 
EXCP_ALIN    equ  800CH		; A-line exception (68K)
EXCP_FLIN    equ  800DH		; F-line exception (68K)
EXCP_FORM    equ  800EH		; Format exception (68K)
EXCP_BRP     equ  800FH		; unknown breakpoint exception
EXCP_BASE    equ  8100H		; unknown exception vector base (+0..+FF)
; XRAY register numbers (same definitions as in i86cpu.h) 
; GRB 11/25/91: Reduced all by 1 to truly be the same as i86cpu.h
REG_AX	  equ	0
REG_CX	  equ	1
REG_DX	  equ	2
REG_BX	  equ	3
REG_SP	  equ	4
REG_BP	  equ	5
REG_SI	  equ	6
REG_DI	  equ	7 
REG_IP	  equ	8
REG_ES	  equ	9
REG_CS	  equ	10
REG_SS	  equ	11
REG_DS	  equ	12
REG_FLAGS equ	13
REG_FS    equ	14
REG_GS    equ	15
; 14-46 reserved
REG_FPST  equ	47	; floating point registers
REG_FPST1 equ	48
REG_FPST2 equ	49
REG_FPST3 equ	50
REG_FPST4 equ	51
REG_FPST5 equ	52
REG_FPST6 equ	53
REG_FPST7 equ	54
REG_FPCW  equ	55	; floating point control word
REG_FPSW  equ	56	;   status word
REG_FPTW  equ	57	;   tag word
REG_FPIP  equ	58	;   instruction ptr
REG_FPOP  equ	59	;   operand ptr
%SET (xtra_mo_start,0)
%IF (%xtra_mo_start EQ 0 ) THEN (
; monitor calls (offset from start)
; monitor calls (offset from start) redone for 386 FLAT MODEL
 MOINIT	  equ	04H		; initialize
 MORXCHR  equ	0AH		; receive char ready
 MOHALT	  equ	10H		; user halt
 MOSPBRK  equ	16H		; report special breakpoint
 MOSPEXCP  equ	1CH		; report special exception
 MOBREAK  equ	22H		; stop after breakpoint/exception
 MOUNEXCP equ	28H		; unknown exception
 MODOUBLE equ	2EH		; double fault exception
 MONMI	  equ	34H		; NMI exception
 MOILLOPC equ	3AH		; illegal opcode
 MODIVZ	  equ	40H		; division by zero
 MOBOUND  equ	46H		; bound/chk exception
 MOOVFL	  equ	4CH		; overflow exception
 MOPRIV	  equ	52H		; privilege/protection exception
 MORXINT  equ	64H		; 386 irq3 & irq4 
 MOTRACE  equ	58H		; trace/single-step exception
 MOCOPROC equ	5EH		; coprocessor exception
 MORESTART equ	76H		; restart from auxiliary monitor
 MOREINIT equ	7CH		; monitor re-initialize
) ELSE (
MOINIT	  equ	8		; initialize
MORXCHR	  equ	0EH		; receive char ready
MOHALT	  equ	14H		; user halt
MOSPBRK	  equ	1AH		; report special breakpoint
MOSPEXCP  equ	20H		; report special exception
MOBREAK	  equ	26H		; stop after breakpoint/exception
MOUNEXCP  equ	2CH		; unknown exception
MODOUBLE  equ	32H		; double fault exception
MONMI	  equ	38H		; NMI exception
MOILLOPC  equ	3EH		; illegal opcode
MODIVZ	  equ	44H		; division by zero
MOBOUND	  equ	4AH		; bound/chk exception
MOOVFL	  equ	50H		; overflow exception
MOPRIV	  equ	56H		; privilege/protection exception
MOTRACE	  equ	5CH		; trace/single-step exception
MOCOPROC  equ	62H		; coprocessor exception
MORESTART equ	7BH		; restart from auxiliary monitor
MOREINIT  equ	80H		; monitor re-initialize
) FI

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -