最好能翻译成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
endmdchar proc near
mov bh,1
mov ah,0eh
int 10h
ret
dchar endpdbyte 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 endpdsword proc near
push ax
mov al,ah
call dbyte
pop ax
call dbyte
ret
dsword endpdreturn proc near
mov al,0ah
call dchar
mov al,0dh
call dchar
ret
dreturn endpinitialize:
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先谢谢了
要是能说明他的都做了些什么也行我在汇编区也发了
解决问题分数一起给
代码如下;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
endmdchar proc near
mov bh,1
mov ah,0eh
int 10h
ret
dchar endpdbyte 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 endpdsword proc near
push ax
mov al,ah
call dbyte
pop ax
call dbyte
ret
dsword endpdreturn proc near
mov al,0ah
call dchar
mov al,0dh
call dchar
ret
dreturn endpinitialize:
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先谢谢了
这个是从网上下下来的
题目是
一个简单实用的病毒检测程序
好象是在DOS上检测的谁给我翻译一下吧
应该是
mov ax,es:[bx]
我的结果为
PSP SEGMENT ADDRESS: 05D2
FREE MEMORY SIZE: 9A2D
TOTAL MEMORY SIZE: 9FFF
----------------------------------
我觉得研究这种DOS的程序对一个初学者,意义不大
谁能给我细讲下谢谢啊
如果非法,则很可能感染了引导区病毒……