zhjipt
初级用户
 
积分 40
发帖 16
注册 2006-12-3
状态 离线
|
『楼 主』:
求助!请将以下程序编制为COM文件
此程序按COM文件格式编制,通过汇编、链接并转换为COM文件即可
*****
:13.asm(13.com)
:1993.11.28
code segment
assume cs:code:ds:code
org 100h
be: jmp intt
popp macro
pop ds
pop es
pop di
pop si
pop dx
pop cx
pop bx
pop ax
popf
endm
:16进制数值转换为ACII码
hexasc macro
add al,090h
daa
adc al,040h
daa
endm
buff db 0
dat db 'CH:'
chl db 0
ch2 db 0
db'CL:'
c11 db 0
c12 db 0
db 'DH:'
dh1 db 0
dh2 db 0
mseg db'(请选择w/r/空格)'
oldint13 dd 0
newint13:
sit
pushf
push ax
push bx
push cx
push dx
push si
push di
push es
push ds
push cs
pup ds
cmp ah,03
jz jxl
jmp old
jxl: cmp dl,80h
jx jx2
jmp old
jx2:
push cx
mov buff,ch
mov cl,4
mov al,buff
shr al,cl
hexasc
mov ch1,al
mov al,buff
and al,0fh
hexasc
mov ch2,al
pop cx
mov buff,cl
mov al,cl
mov cl,4
shr al,cl
hexasc
mov cl1,al
mov al,buff
and al,0fh
hexasc
mov c12,al
mov buff,dh
mov al,dh
shr al,cl
hexasc
mov dhl,al
mov al,buff
and al,0fh
hexasc
mov dh2,al
lea si,dat
mov ah,03h
mov bh,0
int 10h
push dx
mov dx,0029h
mov cx,34
loopl:
mov ah,02h
int 10h
mov bl,70h
mov ah,09h
lodsb
int 10h
inc dl
loop loopl
mov ah,02h
pop dx
int 10h
wair:mov ah,0
int 16h
cmp al,'w'
jz old
cmp al,'r'
jz rett
cmp al,' '
jnz wair
cli
mov ah,4ch
int 21h
rett:
popp
cli
iret
jmp cs:oldint13
intt:
mov ax,3513h
int 21h
lea di,oldint13
mov[di],bx
mov[di+2],es
mvo dx,offset newint13
mov ax,2513h
int 21h
mov dx,offset intt
inc dx
int 27h
code ends
end be
*****
|
|