?? main.txt
字號:
extrn list:far
extrn insert:far
extrn delete:far
data segment
dta db 80h dup(?)
data ends
vars segment
m_l db 0ah,0dh," listall$"
m_i db 0ah,0dh,"insert$"
m_d db 0ah,0dh," delete$"
prompt db 0ah,0dh,"FPAN>>$"
vars ends
show macro addrs
;display a line started at addrs.
push ds
mov ax,es
mov ds,ax
lea dx,addrs
mov ah,09h
int 21h
pop ds
endm
show_item macro addrs,count1,count2
local iloop,spacelp
mov bx,0
;display (count1)chars begin at addrs,end
;followed by (count2) spaces.
iloop:
mov dl,es:&addrs&[bx]
mov ah,2
int 21h
inc bx
cmp bx,count1
jl iloop
mov cx,count2
spacelp:
mov dl," "
mov ah,2
int 21h
loop spacelp
endm
getin macro addrs,count
local lp,zeroit,input_end,exit
push ds
mov ax,es
mov ds,ax
mov bx,0
;get (count) chars from keyboard,and put then
;to adrs.
zeroit:
mov &addrs&[bx],0
inc bx
cmp bx,count
jl zeroit ;let (count) num.of byte
;starting at addrs be zero.
mov bx,0
lp:
mov ah,1
int 21h
cmp al,0dh
jz input_end
cmp al,0ah
jz input_end
mov &addrs&[bx],al
inc bx
cmp bx,count
jl lp
input_end:
cmp al,0dh
jz exit
cmp al,0ah
jz exit
mov ah,1
int 21h
jmp input_end
exit:
pop ds
endm
code segment
assume cs:code,ds:data,es:vars
main proc far
start:
push ds
sub ax,ax
push ax
mov ax,vars
mov es,ax
main_loop:
show prompt
;receive commands(l,i,p)and call the
;responding subroutine.
cmd_loop:
mov ah,01h
int 21h
cmp al,"l"
jnz n1
;show m_l
call list
jmp main_loop
n1:
cmp al,"i"
jnz n2
;show m_i
call insert
jmp main_loop
n2:
cmp al,"d"
jnz n3
;show m_d
call delete
jmp main_loop
n3:
cmp al,"q"
jnz cmd_loop
ret
main endp
code ends
end start
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -