- [zaixuexi] 我以为是a0=0,a1=1,没仔细看 02/12 09:23
- [yang5731] 不对吧 我的结果应该是对的 N=9时 确实得217 你自己算算。你帮我看看论坛 算法上的程序吧 题 02/11 23:49
- [zaixuexi] 递归不是这么写的哦,我想你肯定没调试过自己写的这代码. 先看C代码吧: unsigned int 02/11 22:58
- [游客] <a href="http://www.playren.com/">整人方法</a> 12/15 17:11
- [wisji8] mov ax,0a0h mul dh mov bx,ax mov ax,2 mul 10/03 16:56
- [yang5731] 谢谢了 课程设计一做出来了 确实不能调用着个····· 08/25 02:50
- [mywiil] 课程设计一要用到这个子程序,这里暂不做评论。 赶紧完成课程设计一吧。 08/21 03:33
[2011-03-25 20:56] 程序驻留
PUBLIC time
.model SMALL
.data
hhhh db ?,?,':'
mmmm db ?,?,':'
ssss db ?,?
.code
;子程序名:time
;入口参数:
;功能:按ctrl+f8显示时间
;出口参数:
;说明:远过程
time proc far
push ax
push bx
push cx
push dx
push es
push bp
push ds
mov ax,_data
mov ds,ax
mov es,ax
mov bx,10
mov ah,2ch ;取时间
int 21h
mov ax,cx
and ax,0ffh
div bl
add ax,3030h
mov WORD ptr mmmm,ax
xchg cl,ch
mov ax,cx
and ax,0ffh
div bl
add ax,3030h
mov WORD ptr hhhh,ax
xchg dl,dh
mov ax,dx
and ax,0ffh
div bl
add ax,3030h
mov WORD ptr ssss,ax
mov ax,1300h
mov bx,7
mov cx,8
mov dx,1848h ;在24行最后8列显示时间
mov bp,offset hhhh
int 10h ;为什么用ah=9,int21h就出错
;INT21H优先级应该高于INT9H,纠结了好长时间还是没搞明白,悲剧
pop ds
pop bp
pop es
pop dx
pop cx
pop bx
pop ax
ret
time endp
end
;先把上面time.asm生成目标文件(.obj)
;建立个mylib.lib的子程序库文件
;再lib mylib +time
;把下面的2-0.asm生成目标文件
;link 2-0,,,mylib;
buff_head=1ah
buff_tail=1ch
ctrl_f8=6500h
.model small
.code
old9 dd ?
new9: extrn time:far ;声明标号在模块外
pushf
call DWORD ptr cs:old9
sti
push ax
push ds
push bx
@@1: mov ax,40h
mov ds,ax
mov bx,ds:[buff_head]
cmp bx,ds:[buff_tail]
jz over
mov ax,ds:[bx]
cmp ax,ctrl_f8
jz yes
over: pop bx
pop ds
pop ax
iret
yes: call time
jmp over
start:
push cs
pop ds
cli
mov ax,3509h
int 21h
mov WORD ptr old9,bx ;保存旧中断
mov WORD ptr old9+2,es
mov dx,offset new9
mov ax,2509h ;置新的中断
int 21h
sti
mov dx,offset start
add dx,15
mov cl,4
shr dx,cl
add dx,10h ;驻留节数
mov ah,31h ;结束并驻留
int 21h
end start
.model SMALL
.data
hhhh db ?,?,':'
mmmm db ?,?,':'
ssss db ?,?
.code
;子程序名:time
;入口参数:
;功能:按ctrl+f8显示时间
;出口参数:
;说明:远过程
time proc far
push ax
push bx
push cx
push dx
push es
push bp
push ds
mov ax,_data
mov ds,ax
mov es,ax
mov bx,10
mov ah,2ch ;取时间
int 21h
mov ax,cx
and ax,0ffh
div bl
add ax,3030h
mov WORD ptr mmmm,ax
xchg cl,ch
mov ax,cx
and ax,0ffh
div bl
add ax,3030h
mov WORD ptr hhhh,ax
xchg dl,dh
mov ax,dx
and ax,0ffh
div bl
add ax,3030h
mov WORD ptr ssss,ax
mov ax,1300h
mov bx,7
mov cx,8
mov dx,1848h ;在24行最后8列显示时间
mov bp,offset hhhh
int 10h ;为什么用ah=9,int21h就出错
;INT21H优先级应该高于INT9H,纠结了好长时间还是没搞明白,悲剧
pop ds
pop bp
pop es
pop dx
pop cx
pop bx
pop ax
ret
time endp
end
;先把上面time.asm生成目标文件(.obj)
;建立个mylib.lib的子程序库文件
;再lib mylib +time
;把下面的2-0.asm生成目标文件
;link 2-0,,,mylib;
buff_head=1ah
buff_tail=1ch
ctrl_f8=6500h
.model small
.code
old9 dd ?
new9: extrn time:far ;声明标号在模块外
pushf
call DWORD ptr cs:old9
sti
push ax
push ds
push bx
@@1: mov ax,40h
mov ds,ax
mov bx,ds:[buff_head]
cmp bx,ds:[buff_tail]
jz over
mov ax,ds:[bx]
cmp ax,ctrl_f8
jz yes
over: pop bx
pop ds
pop ax
iret
yes: call time
jmp over
start:
push cs
pop ds
cli
mov ax,3509h
int 21h
mov WORD ptr old9,bx ;保存旧中断
mov WORD ptr old9+2,es
mov dx,offset new9
mov ax,2509h ;置新的中断
int 21h
sti
mov dx,offset start
add dx,15
mov cl,4
shr dx,cl
add dx,10h ;驻留节数
mov ah,31h ;结束并驻留
int 21h
end start
评论次数(0) |
浏览次数(842) |
类型(章节要点) |
收藏此文 |