-
-
[旧帖]
[求助]帮忙看个打印dos版本信息的汇编
0.00雪花
-
发表于:
2009-9-25 15:35
2725
-
[旧帖] [求助]帮忙看个打印dos版本信息的汇编
0.00雪花
;;;;;;;;;;;;;;;;;;;;;;;;a.asm;;;;;;;;;;;;;;;;;;;;;;;;;;
dseg segment public 'data'
mess db 'dos version is'
mess1 db ?
db '.'
mess2 db 2 dup(?)
db 0dh,0ah,'$'
verm db 0
vern db 0
dseg ends
public verm,vern
extrn getver:far,todasc:far
cseg segment public 'code'
assume cs:cseg,ds:dseg
start: mov ax,dseg
mov ds,ax
call getver
mov al,verm
mov bx,length mess1
call todasc
mov al,vern
mov bx,length mess2
mov si,offset mess2
call todasc
mov dx,offset mess
mov ah,9
int 21h
mov ax,4c00h
int 21h
cseg ends
end start
;;;;;;;;;;;;;;;;;;;;b.asm;;;;;;;;;;;;;;;;;;;;;;;;;;
public getver ,todasc
extrn verm:BYTE ,vern:BYTE
func segment public 'code'
assume cs:func
getver proc far
mov ah,30h
int 21h
mov verm,al [COLOR="Red"] ; 这里有问题, debug -t 的时候,这里为什么是nop [/COLOR]
mov vern,ah
getver endp
todasc proc far
mov cl,10
toasc1: xor ah,ah
div cl
add ah,30h
mov [si+bx-1],ah
dec bx
jnz toasc1
ret
todasc endp
func ends
end
ml /c a.asm
ml /c b.asm
link a + b
帮忙看看,为什么会出错了! 尤其是 执行 21h 中断后为什么 mov verm,al 会是nop
呢?
[课程]Linux pwn 探索篇!