📄 common.asm
字号:
.model small
.code
Cls proc far ;清屏
mov ax,0600h
mov bh,07h
xor cx,cx
mov dx,184fh
int 10h
ret
Cls endp
GetKey proc far ;读键盘输入
mov ah,07h
int 21h
ret
GetKey endp
GetCursor proc far ;读光标位置
mov ah,03h
mov bh,0
int 10h
ret
GetCursor endp
HideCursor proc far ;隐藏光标
mov cx,1000h
mov ah,01h
int 10h
ret
HideCursor endp
ShowCursor proc far ;显示光标
mov cx,0e0fh
mov ah,01h
int 10h
ret
ShowCursor endp
GetCh proc far ;读光标位置的字符和属性
mov ah,08h
mov bh,0
int 10h
ret
GetCh endp
HighLight proc far ;允许背景加亮
mov ax,1003h
mov bl,0
int 10h
ret
HighLight endp
Glitter proc far ;允许背景闪烁
mov ax,1003h
mov bl,1
int 10h
ret
Glitter endp
;GetText proc far
; mov di,offset TextBuffer
; mov al,_CurX
; mov ah,_CurY
; push ax
; mov _CurX,0
; mov _CurY,2
; mov cx,1760
;lpget: GotoXY _CurX,_CurY
; Call GetCh
; mov word ptr [di],ax
; add di,2
; inc _CurX
; .if _CurX==80
; inc _CurY
; mov _CurX,0
; .endif
; loop lpget
; pop ax
; mov _CurY,ah
; mov _CurX,al
; ret
;GetText endp
;
;PutText proc far
; mov bp,offset TextBuffer
; mov cx,1760
; mov dx,0200h
; mov ax,1303h
; mov bh,0
; int 10h
; ret
;PutText endp
;
GetSound proc far
push ax
push bx
push cx
push dx
push di
mov di,896
mov al,0b6h
out 43h,al
mov dx,12h
mov ax,533h*896
div di
out 42h,al
mov al,ah
out 42h,al
in al,61h
mov ah,al
or al,3
out 61h,al
mov bx,1500
wait1: mov cx,2801
delay: loop delay
dec bx
jnz wait1
mov al,ah
out 61h,al
pop di
pop dx
pop cx
pop bx
pop ax
ret
GetSound endp
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -