找到一个检测病毒的汇编程序 看不懂,谁给翻译下
最好能翻译成C++
要是能说明他的都做了些什么也行
代码如下
;file name:dispmem.asm
;tasm dispmeem;
;tlink dispmem/t;
cseg segment
assume cs: cseg,ds:cseg
org 100h
start:
jmp initialize
;-------DATA AREA-----------------------
hextab db '0123456789ABCDEF'
msg1 db 'PSP SEGMENT ADDRESS: $'
msg2 db 'FREE MEMORY SIZE: $'
msg3 db 'TOTAL MEMORY SIZE: $'
msg4 db 'PARA.$'
print macro msg
mov ah,09h
lea dx,msg
int 21h
endm
dchar proc near
mov bh,1
mov ah,0eh
int 10h
ret
dchar endp
dbyte proc near
push ax
shr al,1
shr al,1
shr al,1
shr al,1
and ax,000fh
mov si,ax
mov al,cs:hextab[si]
call dchar
pop si
and si,000fh
mov al,cs:hextab[si]
call dchar
ret
dbyte endp
dsword proc near
push ax
mov al,ah
call dbyte
pop ax
call dbyte
ret
dsword endp
dreturn proc near
mov al,0ah
call dchar
mov al,0dh
call dchar
ret
dreturn endp
initialize:
print msg1
mov ax,ds
call dsword
call dreturn
print msg2
mov ax,es
sub ax,1
mov es,ax
mov bx,3
mov ax,ea:[bx]
call dsword
call dreturn
print msg3
mov ax,ds
mov bx,3
add ax,es:[bx]
call dsword
call dreturn
int 20h
cseg ends
end start
先谢谢了