📄 stone.mac
字号:
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
; equ's
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
_cf equ 0000000000000001b ; carry flag
_pf equ 0000000000000100b ; parity flag
_af equ 0000000000010000b ; auxilary flag
_zf equ 0000000001000000b ; zero flag
_sf equ 0000000010000000b ; sign flag
_tf equ 0000000100000000b ; trap flag
_if equ 0000001000000000b ; interrupt flag
_df equ 0000010000000000b ; direction flag
_of equ 0000100000000000b ; overflow flag
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
; macro's
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
beep macro
mov ax,0E07h
int 10h
endm
readkey macro ; output: ah=scancode, al=ascii
xor ah,ah
int 16h
endm
keypressed macro ; output: ah=scancode, al=ascii, zf
mov ah,01h
int 16h
endm
exit macro returncode
IFNB <returncode>
mov ax,4C00h+returncode
int 21h
ELSE
mov ax,4C00h
int 21h
ENDIF
endm
inivbase macro vbase ; vbase = global
LOCAL mono,verder
int 11h
or ax,30h
cmp ax,30h
je mono
mov vbase,0b800h
jmp verder
mono: mov vbase,0b000h
verder: endm
setcursor macro x,y
mov dx,y*100h+x
mov ah,2
xor bh,bh
int 10h
endm
cls macro
mov ax,3
int 10h
endm
delay macro
LOCAL lusje
xor ax,ax
int 16h
mov bx,dx
lusje: xor ax,ax
int 16h
cmp dx,bx
jne lusje
endm
showstr macro string
mov dx,offset string
mov ah,9
int 21h
endm
showstrc macro string ; si is destroyed
mov si,offset string
call writestring
endm
showstrn macro ; lots of things destroyed..
mov dword ptr [number], eax
call store_size
endm
showstrz macro string
LOCAL d1
mov di,offset string
d1: mov dl,[di]
mov ah,2
int 21h
inc di
cmp byte ptr [di],0
jne d1
endm
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
; FillMem - FillMem start_adr, end_adr, byte
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
fillmem macro fm_start, fm_end, fm_byte
push ds es ax di
push cs cs
pop ds es
mov al, fm_byte
mov cx, offset fm_end - offset fm_start
lea di, fm_start
rep stosb
pop di ax es ds
endm
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
; File macros. Hmm, haven't used them at all. :)
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
_FOpen macro
mov ax, 3D02h
int 21h
endm
_FRead macro
mov ax, 3f00h
int 21h
endm
_FWrite macro
mov ax, 4000h
int 21h
endm
_FCreate macro
mov ax, 3c02h
mov cx, 00100000b
int 21h
endm
_FClose macro
mov ah, 3eh
int 21h
endm
_FPoint macro
mov ah, 42h
int 21h
endm
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -