📄 ibmunv.inc
字号:
; registers which represent each of the four color memory planes which
; are supported. This access is controlled by sending information in
; the form of binary numbers or bit patterns to the data port associated
; with the graphics registers. The graphics register selected to receive
; the data is specified as an offset index, this offset being written to
; an address port associated with a particular data port.
; The following definitions and routines are a convenient means for
; coding these staged interactions with the hardware.
; Addresses of, or offsets to, registers used :
; SEQUENCER -----------------------------------------------------
SEQADD=3C4H ;sequencer address register(takes index)
SEQDAT=3C5H ;sequencer data port (receives data for
; register indexed above)
MMREG=2 ;offset to map mask register
;/ ENABLES PLANES 0-3
;/ FOR 32-BIT WRITE
MMDREG=4 ;memory mode register
; GRAPHICS --------------------------------------------------------
GRPADD=3CEH ;graphics address register
GRPDAT=3CFH ;graphics data port
SRSREG=0 ;set/reset register
;/ IF WRITE MODE 0, BINARY
;/ VALUE OF COLOR TO WRITE
ENBREG=1 ;enable set/reset register
;/ BITS 0-3 ENABLE PLANES
;/ FOR WRITING FROM SETRES
;/ IF 0, WRITE IS FROM
;/ PROCESSOR DATA
CLCREG=2 ;color compare register
;/ BITS 0-3 ARE COLOR VALUE
;/ TO BE COMPARED
DTRREG=3 ;data rotate register
;/ BITS 0-2 = POSITIONS TO
;/ ROTATE FOR WRITE
;/ BITS 3-4 = LOGICAL OPS
;/ WITH LATCHED DATA
RMPREG=4 ;read map select register
;/ BINARY REP OF PLANE FOR
;/ READ
RWMREG=5 ;read/write mode register
;/ WRITES : BITS 1 0
;/ 00 = DATA WRITE FROM
;/ PROCESSOR OR SET-RESET
;/ 01 = LATCH WRITE
;/ 10 = BYTE <-- COLOR
;/ READS : BIT 3
;/ 0 = READ FROM PLANE
;/ SPECIFIED BY READMP
;/ 1 = COMPARE PIXEL COLOR
;/ WITH COLOR COMPARE
;/ ODD/EVEN : BIT 4
;/ 1 = ODD/EVEN ADDRESS MODE
CDCREG=7 ;color don't care register
;/ BITS 0 - 3 REPRESENT 4
;/ PLANES; 0 SPECIFIES IGNORE
;/ PLANE WHEN DOING COLOR
;/ COMPARE READ
BMKREG=8 ; bit mask register
;/ BITS 0 - 7 WHEN SET TO
;/ 0 PROTECT BIT FROM WRITE
; ATTRIBUTE -----------------------------------------------------
ATTADD=3C0H ;attribute address register - used also for data
;via alternating OUTs
;[8] Constants and macros used by EGAINT10 interface.
EGAINT MACRO FUNC ;[8]run EGA outs through egaint10 interface
IFNB <FUNC>
MOV AH,FUNC
ENDIF
INT 10H
ENDM
EGAINT10CLI MACRO ;[8]disable interrupts if HG_EGAINT10
ENDM
EGAINT10STI MACRO ;[8]enable interrupts if HG_EGAINT10
ENDM
; COM port constants:
IRQ3 = 11d*4 ;COM2 interrupt level - Int loc for COM card @ 2xxh
IRQ4 = 12d*4 ;COM1 interrupt level - Int loc for COM card @ 3xxh
RS232B = 400H ; X'400' RS232 Card(s) I/O addr Save area.
RDAIE = 1 ; Read Data Available Interrupt Enable
TBEIE = 2 ; Transmit Buffer Empty Interrupt Enable
MSRIE = 8 ; Modem Status Interrupt Enable
CTS = 10H ;Clear To Send
DSR = 20H ;Data Set Ready
RLSD = 80H ;Received Line Signal Detect (CD)
XMIT_BUF_SIZE = 80H ;[6] length of output buffer
PAGE
;******************************************************************************
; enable and disable
;******************************************************************************
ENABLE EQU STI
DISABLE EQU CLI
;******************************************************************************
; The PAUSE macro is required because a number of Intel's early 286 processors
; had defects. The PAUSE macro is required whenever there is a number of
; IN and OUT instructions in close proximity to each other.
; This macro insures that an instruction fetch occurs between IN and/or OUT
; instructions on the IBM PC AT machine.
; Note: OEMs should be able to disregard this macro by removing the JMP
; instruction.
;******************************************************************************
PAUSE MACRO ;macro to insure that an instruction
JMP $+2 ;fetch occurs between IN and/or OUT
ENDM ;instructions on the IBM PC AT machine
;***************************************************************************
;
; 8086 Interrupt Handling Macros
; MS-DOS 1.0 does not have INT 21 to GET a vector
; hence SAVINT just moves interrupts around.
;
;***************************************************************************
SVINT MACRO savloc,intloc,reg
IFB <reg>
SVINT savloc,intloc,AX
ELSE
MOV reg,intloc
MOV savloc,reg
MOV reg,intloc+2
MOV savloc+2,reg
ENDIF
ENDM
;****************************************************************************
;
; The following macros use the MS-DOS INT 21 call to change
; interrupt vectors.
;
;****************************************************************************
savint macro savloc,intvec
MOV AX,3500H+INTVEC/4 ;;[2]AH=get int - AL=interrupt number
int 21h
mov word ptr savloc,bx ;;savloc = offset
mov word ptr savloc+2,es ;;savloc+2 = segment
endm
setvec macro interrupt,offset_adr ;;set interrupt vector function call
mov dx,offset offset_adr
MOV AX,2500H+INTERRUPT ;;[2]AH=set int call - AL=interrupt
int 21h
endm
rstvec macro interrupt,save_adr ;;restore interrupt from saved
lds dx,dword ptr save_adr
MOV AX,2500H+INTERRUPT ;;[2]AH=set int call - AL=interrupt
int 21h
endm
XFRINT MACRO TOINT,FROMINT ;;move FROMINT to TOINT
PUSH ES ;;save register...
MOV AX,3500H+FROMINT ;;want to get FROMINT
INT 21H ;;vector now in ES:BX
MOV AX,ES ;;keep segment around
POP ES ;;restore register...
MOV DX,BX ;;move offset for put
PUSH DS ;;save register...
MOV DS,AX ;;segment for put
MOV AX,2500H+TOINT ;;want to put TOINT
INT 21H ;;vector now in DS:DX
POP DS ;;restore register
ENDM
;******************************************************************************
; Queue Structures for music and communications
;******************************************************************************
; This queue structure is used by the MUSIC queues and
; the COM buffer queues (both input and output). The
; field QUNOTE is not used by the COM buffer queues
; but will be present as a dummy field so that the same
; queue manipulation routines may be used.
;******************************************************************************
QUE_CTRL_BLOCK STRUC
QUNOTE DW ? ; Number of notes in Bkgnd queue
QUETOP DW ? ; Top of Queue Location
QUEBOT DW ? ; Bot of Queue Location
QUELEN DW ? ; Length of Queue
QUENUM DW ? ; Number of bytes in Que
QUEGET DW ? ; Queue get pntr
QUEPUT DW ? ; Queue put pntr
QUE_CTRL_BLOCK ENDS
QUSIZE = SIZE QUE_CTRL_BLOCK
QLENTH = 32*6 ;room for 32 notes (exactly)
QUE_CTRL_LEN = QUSIZE ;Length of Queue Control Block
SPCSIZ= QLENTH+16*3 ;non-IBMPCJr queue size
;one full size; two 16-byte
;for SYNC's; NOISE queue
HALSIZ= QLENTH*3+QLENTH/2 ;PC Jr queue size; Three full
;size queues; half size
;queue for noise
;******************************************************************************
; EQUates for $DONOTE input value in AL
; The value of these equates is quite important as $DONOTE depends on
; them.
; Function codes to be passed to B$DONOTE
;******************************************************************************
QUERST=0D ;[3] Queue an internote pause (rest)
QUENOT=1D ;[3] Queue a note
TSTVOC=2D ;[3] Test if voice is active
QUESYN=3D ;[3] Queue synchronization mark
SETESH=4D ;[3] Queue an envelope shape request
SETEPR=5D ;[3] Queue an envelope period request
MKNOIS=6D ;[3] Support NOISE statement
SNDONF=252D ;[3] SOUND ON/OFF
BEPONF=253D ;[3] BEEP ON/OFF
STRSND=254D ;Start sound
STPSND=255D ;Stop sound and flush the queues
DFLVOL=-1 ;[3] Default Volume (-1)
;******************************************************************************
.LIST
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -