newmif.asm
来自「开放源码的编译器open watcom 1.6.0版的源代码」· 汇编 代码 · 共 550 行 · 第 1/2 页
ASM
550 行
_GetButRel ENDP
; ****************************************************************
; * F U N C T I O N 7 :
; ****************************************************************
PUBLIC _SetHorizontalLimits
;
; SetHorizontalLimits (minPos, maxPos)
; int minPos, maxPos;
;
_SetHorizontalLimits PROC FAR
do_enter
mov cx, 6[bp] ; cx = minPos
mov dx, 8[bp] ; dx = minPos
mov ax, 7 ; function 7
int 33h ; call mouse driver function
do_leave
_SetHorizontalLimits ENDP
; ****************************************************************
; * F U N C T I O N 8 :
; ****************************************************************
PUBLIC _SetVerticalLimits
;
; SetHorizontalLimits (minPos, maxPos)
; int minPos, maxPos;
;
_SetVerticalLimits PROC FAR
do_enter
mov cx, 6[bp] ; cx = minPos
mov dx, 8[bp] ; dx = minPos
mov ax, 8 ; function 8
int 33h ; call mouse driver function
do_leave
_SetVerticalLimits ENDP
; ****************************************************************
; * F U N C T I O N 9 :
; ****************************************************************
PUBLIC _SetGraphicCursor
;
; typedef struct {
; unsigned int screenMask[16],
; cursorMask[16];
; int hotX,
; hotY;
; } GraphicCursor;
;
; SetGraphicCursor (cursor)
; GraphicCursor *cursor;
;
_SetGraphicCursor PROC FAR
do_enter
les di, 6[bp] ; address of screenMask
mov dx, di ; es:dx = address of screenMask
mov bx, es:64[di] ; bx = hotX
mov cx, es:66[di] ; cx = hotY
mov ax, 9 ; function 9
int 33h ; call mouse driver function
do_leave
_SetGraphicCursor ENDP
; ****************************************************************
; * F U N C T I O N 10 :
; ****************************************************************
PUBLIC _SetTextCursor
;
; SetTextCursor (selectedCursor, screenMaskORscanStart, cursorMaskORscanStop)
; unsigned int selectedCursor,
; screenMaskORscanStart,
; cursorMaskORscanStop;
;
_SetTextCursor PROC FAR
do_enter
mov bx, 6[bp] ; bx = selectedCursor
mov cx, 8[bp] ; cx = screenMaskORscanStart
mov dx, 10[bp] ; dx = cursorMaskORscanStop
mov ax, 10 ; function 10
int 33h ; call mouse driver function
do_leave
_SetTextCursor ENDP
; ****************************************************************
; * F U N C T I O N 11 :
; ****************************************************************
PUBLIC _ReadMotionCounters
;
; ReadMotionCounters ( horizontal, vertical )
; int *horizontal, *vertical;
;
_ReadMotionCounters PROC FAR
do_enter
mov ax, 11 ; function 11
int 33h ; call mouse driver function
les di, 6[bp] ; address of horizontal
mov es:[di], cx ; horizontal = cx
les di, 10[bp] ; address of vertical
mov es:[di], dx ; vertical = dx
do_leave
_ReadMotionCounters ENDP
; ****************************************************************
; * F U N C T I O N 12 :
; ****************************************************************
PUBLIC _SetEventHandler
;
; SetEventHandler (mask, handler)
; int mask;
; int *handler();
;
hand_offset dw ?
hand_segment dw ?
saveAX dw ?
PrivateHandler PROC FAR
process_event: cli ; prevent a further interrupt
; which would change registers
; ax, bx, cx, dx
push ds ; save mouse driver ds
mov ds, cs:CDataSeg ; set up C data seg
push dx ; set up params for c function
push cx
push bx
push ax
sti ; enable interrupts
;call far [dword ptr cs:hand_segment] ; masm4
call dword ptr cs:hand_offset ; wasm - 93/07/09 MEP
add sp, 8
pop ds ; restore mouse driver ds
ret
PrivateHandler ENDP
_SetEventHandler PROC FAR
do_enter
push es
mov cx, 6[bp] ; cx = mask
les dx, 8[bp] ; handler
mov hand_segment, es
mov hand_offset , dx
push cs
pop es
lea dx, cs:PrivateHandler
mov ax, 12 ; function 12
int 33h ; call mouse driver function
pop es
do_leave
_SetEventHandler ENDP
; ****************************************************************
; * F U N C T I O N 13 :
; ****************************************************************
PUBLIC _LightPenOn
;
; LightPenOn ();
;
_LightPenOn PROC FAR
do_enter
mov ax, 13 ; function 13
int 33h ; call mouse driver function
do_leave
_LightPenOn ENDP
; ****************************************************************
; * F U N C T I O N 14 :
; ****************************************************************
PUBLIC _LightPenOff
;
; LightPenOff ();
;
_LightPenOff PROC FAR
do_enter
mov ax, 14 ; function 14
int 33h ; call mouse driver function
do_leave
_LightPenOff ENDP
; ****************************************************************
; * F U N C T I O N 15 :
; ****************************************************************
PUBLIC _SetMickeysPerPixel
;
; SetMickeysPerPixel (horPix, verPix)
; unsigned int horPix, verPix;
;
_SetMickeysPerPixel PROC FAR
do_enter
mov cx, 6[bp] ; cx = horPix
mov dx, 8[bp] ; dx = verPix
mov ax, 15 ; function 15
int 33h ; call mouse driver function
do_leave
_SetMickeysPerPixel ENDP
; ****************************************************************
; * F U N C T I O N 16 :
; ****************************************************************
PUBLIC _ConditionalOff
;
; ConditionalOff (left, top, right, bottom)
; int left, top, right, bottom;
;
_ConditionalOff PROC FAR
do_enter
mov cx, 6[bp] ; cx = left
mov dx, 8[bp] ; dx = top
mov si, 10[bp] ; si = right
mov di, 12[bp] ; di = bottom
mov ax, 16 ; function 16
int 33h ; call mouse driver function
do_leave
_ConditionalOff ENDP
; ****************************************************************
; * F U N C T I O N 19 :
; ****************************************************************
PUBLIC _SetSpeedThreshold
;
; SetSpeedThreshold (threshold)
; unsigned int threshold;
;
_SetSpeedThreshold PROC FAR
do_enter
mov dx, 6[bp] ; dx = threshold
mov ax, 19 ; function 19
int 33h ; call mouse driver function
do_leave
_SetSpeedThreshold ENDP
_TEXT ENDS
END
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?