首页 > 试题广场 >

以下是一段汇编代码,请用C语言实现相同功能。

[问答题]
以下是一段汇编代码,请用C语言实现相同功能。
.data
SourceStringdb "Hello, World!",0
.code
start:
cld
xoreax, eax
movedi, offset SourceString
mov al, 'd'
movecx, 13
repnescas
jz wow
invokeExitProcess, 0
wow:
invokeExitProcess, 1
end start

推荐
这段代码是在固定字符串里面搜索字符 ‘d’
用C语言实现
if (strstr (“Hello, World!”, “d”) != NULL))
    exitProcess(1);
exitProcess (0);

编辑于 2014-12-05 10:27:00 回复(1)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h> 
int main(){
    char ss[]="Hello World!";
    char *p=strchr(ss,'d');
    if(p) 
        ExitProcess(0);  //在kernel32.dll中,need windows.h 
    else 
        ExitProcess(1);
    return 0; 

发表于 2019-03-02 21:46:44 回复(0)
xxj头像 xxj
if (strstr (“Hello, World!”, “d”) != NULL))
    exitProcess(1);
exitProcess (0);
发表于 2014-12-11 11:32:48 回复(0)
xxj头像 xxj
if (strstr (“Hello, World!”, “d”) != NULL))
    exitProcess(1);
exitProcess (0);
发表于 2014-12-11 11:31:54 回复(0)
xxj头像 xxj
if (strstr (“Hello, World!”, “d”) != NULL))
    exitProcess(1);
exitProcess (0);
发表于 2014-12-11 11:31:04 回复(0)
发色 爱上
发表于 2014-12-04 17:19:36 回复(0)