.model small, c
.586p
.data
teax dd ?
tebx dd ?
tecx dd ?
tedx dd ?
msg db "EAX: 00000000h ", '$' ;
msg1 db "EAX: 00000001h ", '$' ;
msg2 db "EAX: 00000002h ", '$' ;
msg3 db "EAX: 00000003h ", '$' ;
.code
.startup
mov eax,00000000h
cpuid
mov teax,eax
mov tebx,ebx
mov tecx,ecx
mov tedx,edx
mov dx, offset msg ;
mov ah, 09h ;
int 21h ;
call newline
call dispd
call newline
mov eax,tebx
mov teax,eax
call dispc
mov eax,tedx
mov teax,eax
call dispc
mov eax,tecx
mov teax,eax
call dispc
call newline
call newline
mov eax,00000001h
cpuid
mov teax,eax
mov tebx,ebx
mov tecx,ecx
mov tedx,edx
mov dx, offset msg1 ;
mov ah, 09h ;
int 21h ;
call newline
call dispd
call newline
mov eax,tebx
mov teax,eax
call dispd
call newline
mov eax,tedx
mov teax,eax
call dispd
call newline
mov eax,tecx
mov teax,eax
call dispd
call newline
call newline
mov eax,00000002h
cpuid
mov teax,eax
mov tebx,ebx
mov tecx,ecx
mov tedx,edx
mov dx, offset msg2 ;
mov ah, 09h ;
int 21h ;
call newline
call dispd
call newline
mov eax,tebx
mov teax,eax
call dispd
call newline
mov eax,tedx
mov teax,eax
call dispd
call newline
mov eax,tecx
mov teax,eax
call dispd
call newline
call newline
mov eax,00000003h
cpuid
mov teax,eax
mov tebx,ebx
mov tecx,ecx
mov tedx,edx
mov dx, offset msg3 ;
mov ah, 09h ;
int 21h ;
call newline
call dispd
call newline
mov eax,tebx
mov teax,eax
call dispd
call newline
mov eax,tedx
mov teax,eax
call dispd
call newline
mov eax,tecx
mov teax,eax
call dispd
call newline
call newline
.exit
dispd proc near
mov ch,08h
mov cl,04h
up: mov eax,teax
rol eax,cl
mov teax,eax
and al,0fh
cmp al,0ah
jc digit
add al,06h
digit: add al,30h
mov dl,al
mov ah,02h
int 21h
dec ch
jnz up
ret
endp dispd
dispc proc near
mov ch,03h
mov cl,08h
mov eax,teax
mov dl,al
mov ah,02h
int 21h
up1: mov eax,teax
ror eax,cl
mov teax,eax
mov dl,al
mov ah,02h
int 21h
dec ch
jnz up1
ret
endp dispc
newline proc near ;
mov dl, 13 ;
mov ah, 02h ;
int 21h ;
mov dl, 10 ;
mov ah, 02h ;
int 21h ;
ret ;
endp newline ;
end
Comments
Post a Comment