c++代码急急急翻译成汇编格式50分回答的好再奖励100

来源:百度知道 编辑:UC知道 时间:2024/06/21 19:25:53
在线等,
SYSTEMTIME hi;
int iCounter;
GetLocalTime(&hi);
iCounter = hi.wSecond;
if( iCounter >49 )
iCounter=iCounter-50;
else
iCounter=iCounter+10;
while(1)
{

GetLocalTime(&hi);
if(hi.wSecond == iCounter)
break;
}
要翻译成汇编格式,就是在反汇编里可以用,原来有那个翻译软件,现在一般又能够不着,就没装,

.386
.model flat, stdcall ;32 bit memory model
option casemap :none ;case sensitive
include kernel32.inc
includelib kernel32.lib
include windows.inc
.data?
hi dd SYSTEMTIME
.code
start:
invoke GetLocalTime,addr hi
assume eax:ptr SYSTEMTIME
mov eax,offset hi
movzx ebx,[eax].wSecond
.if ebx>49
sub ebx,50
.else
add ebx,10
.endif

@@:
push ebx
invoke GetLocalTime,addr hi
pop ebx
movzx eax,[eax].wSecond
cmp ebx,eax
je over
jmp @B
over:
ret
end start
;代码写得不漂亮,呵呵

mov ah,2ch ;Dos 2c号功能调用,获取系统时间,ch,cl,dh分别存放小时,分钟,秒.
int 21h
要上课,没时间做了

直接用VS带的反汇编吧,我想帮你翻来着,不过我知道你那里面用的的是哪个头文件,所以…