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

📄 ibmunv.inc

📁 Dos6.0
💻 INC
📖 第 1 页 / 共 2 页
字号:
;***
;ibmunv.inc - 20-Mar-86
;***
	.XLIST
;***
;
;	Copyright <C> 1986, Microsoft Corporation
;
;Purpose:
;
;******************************************************************************

;******************************************************************************

;	Chess ROS I/O Macro Definitions for the IBM PC

;******************************************************************************

;	VECTOR INTERRUPT EQUATES

;******************************************************************************

	I_SCNIO=10H 		;VIDEO_IO
	I_CASIO=15H 		;CASSETTE_IO
	I_KYBIO=16H 		;KEYBOARD_IO
	I_PTRIO=17H 		;PRINTER_IO
	I_DOSIO=21H 		;MSDOS_IO

;******************************************************************************

;	ROS MONITOR INTERRUPT CALL MACRO DEFINITIONS

;******************************************************************************

; The ROSMAC macro is used to define other macros. These new macros can then
; be used to access the IBM ROM bios level services. Refer to the IBM TechRef
; Manual for additional information.

ROSMAC	MACRO	NAM,REG
NAM	MACRO	FUNC
IFNB	<REG>
	PUSH	BP
	PUSH	SI
	PUSH	DI
ENDIF				;IFNB <REG>
IFNB	<FUNC>
	MOV	AH,FUNC
ENDIF				;IFNB <FUNC>
	INT	I_&NAM
IFNB	<REG>
	POP	DI
	POP	SI
	POP	BP
ENDIF				;IFNB <REG>
	ENDM			;&NAM	MACRO
	ENDM			;ROSMAC	MACRO

; The SCNIOS macro is used to save a bit of code. Invoking this macro
; causes a call to the B$SCNIO routine rather than invoking the SCNIO
; macro directly. This saves 3 PUSHes and 3 POPs for all screen
; related activity.

SCNIOS	MACRO	FUNC		;;VIDEO_IO
IFNB	<FUNC>
	MOV	AH,FUNC
ENDIF
	CALL	B$SCNIO
	ENDM

KYBIO	macro	func		;;[1]
	PUSH	BP		;;[1]
	PUSH	SI		;;[1]
	PUSH	DI		;;[1]
ifnb	<func>			;;[1]
	MOV	AH,FUNC		;;[1]
  ifndef	b$RcoFlg	;;[1]
	extrn	b$RcoFlg:byte	;;[1]
  endif				;;[1] ifndef
	OR	AH,b$RcoFlg	;;[1] b$RcoFlg is either 0 or 10H in DOS3
endif				;;[1] ifnb <func>
	INT	I_KYBIO		;;[1]
	POP	DI		;;[1]
	POP	SI		;;[1]
	POP	BP		;;[1]
ENDM				;;[1] KYBIO

	ROSMAC	SCNIO,R		;;VIDEO_IO
	ROSMAC	CASIO		;;CASSETTE_IO
	ROSMAC	PTRIO,R		;;PRINTER_IO
	ROSMAC	DOSIO		;;MSDOS_IO

;******************************************************************************

;	BIOS Video Support Functions (use with SCNIO macro):

;******************************************************************************

	vSetMode EQU	0		;set screen mode
	vSetCursorType EQU	1	;set cursor type
	vSetCursorPos EQU	2	;set cursor position
	vReadCursorPos EQU	3	;read cursor position
	vReadLightPen EQU	4	;read light pen position
	vSelActivePage EQU	5	;select active display page
	vScrollPageUp EQU	6	;scroll active page up
	vScrollPageDown EQU	7	;scroll active page down
	vReadChar EQU	8		;read character and attribute
	vWriteChar EQU	9h	;write character and attribute
	vWriteCharOnly EQU	0ah	;write character only
	vSetPalette EQU	0bh	;set color palette
	vWritePixel EQU	0ch	;write pixel to screen
	vReadPixel EQU	0dh	;read pixel from screen
	vWriteTTY EQU	0eh	;write tty to active page
	vGetVideoState EQU	0fh	;gets current video state
	vSetEgaPalette EQU	010h	;set palette registers
	vCharGen EQU	011h	;character generator routine
	vAltSelect EQU	012h	;alternate select - get ega info
	vWriteString EQU	013h	;write string to screen
	vGetVgaInfo EQU 01bh	;[5]get vga information

;******************************************************************************

;	BIOS Cassette Support Functions (use with CASIO macro):

;******************************************************************************

	cMotorOn EQU	0		;turn cassette motor on
	cMotorOff EQU	1		;turn cassette motor off
	cReadCassette EQU	2	;read block from cassette device
	cWriteCassette EQU	3	;write block to cassette device

;******************************************************************************

;	BIOS Keyboard Support Functions (use with KYBIO macro):

;******************************************************************************

	kReadKeyboard EQU	0	;read character from keyboard
	kPollKeyboard EQU	1	;poll keyboard for presence of character
	kReadShiftKeys EQU	2	;get status of shift keys

;******************************************************************************

;	BIOS Printer Support Functions (use with PTRIO macro):

;******************************************************************************

	lptPrintChar EQU	0	;print character on printer
	lptInitPrinter EQU	1	;initialize printer device
	lptReadStatus EQU	2	;read status of printer device

;******************************************************************************

;	BIOS RS232C COM Port Support Functions:

;******************************************************************************

	comInitPort EQU	0	;initialize COM port
	comSendByte EQU	1	;send byte to COM port
	comRecByte EQU	2	;receive byte from COM port
	comGetStatus EQU	3	;get COM port status info

;******************************************************************************

;	Interrupts / Interrupt Vectors / I/O Ports / Misc Constants

;	The following Offsets are for Cells assuming DS:0

;******************************************************************************

;	Timer Constants:

	TIMINT	= 8H		;timer interrupt
	CLKINT	= 20h		;X'20' Clock Interrupt Vector
	CLKVEC	= 3C0h		;X'3C0' (ROM) Clock Interrupt vector
	ROMCLK	= 240		;ROM Clock Interrupt number
	TIMADR	= 70H		;X'70' Timer Int Vector
	TICSAV	= 512H		;X'512-515' Clock Int Vec save area
	TMRCTL	= 1CH		;timer control interrupt
	TIMER0	= 40h		;X'40' Timer 0 Port Address
	TIMER2	= 42h		;X'42' Timer 2 Port Address
	TMRCMD	= 43h		;X'43' Timer Control Port

;	8259 constants:

	INTA0	= 20h		;X'20' 8259 Interrupt Control Port
	INTA1	= 21H		;8259 Interrupt Mask Register Port
	EOI	= 20h		;X'20' 8259 End-of-Interrupt ACK
	MSKREG	= 21H		;8259 interrupt mask register

;	Joystick Event Constants:

	GAMECD	= 201H		;Game Card I/O address
	TRIG_A1	= 10H		;Trigger 'A1' Mask, Active Low
	TRIG_A2	= 20H		;Trigger 'A2' Mask, Active Low
	TRIG_B1	= 40H		;Trigger 'B1' Mask, Active Low
	TRIG_B2	= 80H		;Trigger 'B2' Mask, Active Low

;	Music / Sound constants:

	SPEAKER	= 61h		;X'61' Speaker Latch Port Address.
	SpkrOn	= 3		;Speaker On Mask
	SpkrEn	= 10h		;Speaker Enable/Disable Mask
	SQUARE	= 0B6h		;X'B6' Timer 2, Square Wave (Mode 3).
	SND_MAX	= 32		;Max number of Notes Que can hold
	TIADDR	= 0C0H		;X'C0' TI sound chip address

;	Keyboard Constants:

	KBDINT	= 24H		;X'24' Keyboard Interrupt Vector
	KBDVEC	= 3BCH		;X'3BC' (ROS) KBD Int Vector
	KYBINT	= 9H		;keyboard interrupt
	ROMKBD	= 239D		;ROM KBD INT vectors saved at 239*4
	KBDFLG	= 417H		;keyboard special status flag
	KBDATA	= 60H		;keyboard data

;	Screen related constants:

	PALSIZ	= 16		;palette size
	CHREXT	= 7Ch		;X'7C' Extended Character Set pointer.
	CRT_LEN = 44Ch		;[12] crt page length
	CRT_START= 44eh		;crt start address
	ACTIVE_PAGE = 462H	;[4] Active page# is stored here by BIOS
	BIOS_CursorPos = 450H	;[9]start of BIOS cursor position table
	CGA_STATUS = 3DAH	;[9]CGA card status port
	VERT_SYNC = 8		;[9] 1 on status port means vertical sync
	HORZ_SYNC = 1		;[9] 1 on status port means horizontal sync
	MEMRIO	= 23Ch		;Port for MS Jr Booster Card signature byte
	CR	= 13D		;ASCII carriage return
	LF	= 10D		;ASCII  line feed
	BiosEquip= 410h		;bios equipment register


;[7]	This macro is used to choose between word OUTs and byte OUTs when
;[7]	writing to the EGA card.  The routine B$OutWord does the equivalent
;[7]	of a word out 1 byte at a time because of rumoured problems with
;[7]	word OUTs.  Currently, the AT&T 6300 is the only machine known to
;[7]	have problems with word OUTs.  If it is decided that the speed gained
;[7]	by using word OUTs is more important than supporting the AT&T thing,
;[7]	change this macro and remove B$OutWord from LLCGRP.

OutWord MACRO
	CALL	B$OutWord	; or this line can read "OUT DX,AX"
;	OUT	DX,AX		; or this line can read "CALL B$OutWord"
	ENDM



;	EGA (Enhanced Graphics Adapter) constants:


	OFFSCN=6D60H 		;first even off-screen location
				;we need an off-screen location in
				; video memory for writing a tiling
				; pattern

;	Accessing screen memory through the EGA card is handled by reading
;	or writing either directly from/to memory or through a set of latch

⌨️ 快捷键说明

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