C 在部件x86中遍历二维数组
可能重复:C 在部件x86中遍历二维数组,c,assembly,x86,C,Assembly,X86,可能重复: 在我的问题中,我有一个2d字符数组,我需要将所有内容都更改为小写 char list[100][20] = {{"ArtUro"}, {"Bryan"}, {"chris"}, {"David"}, {"Jon"}, {"Mark"}, {"shane"}, {"SIMON"}, {"Thomas"}, {"TONY"}}; 我有 int b_search (char list[100][20], int count, char* token) { __asm { mov
在我的问题中,我有一个2d字符数组,我需要将所有内容都更改为小写
char list[100][20] = {{"ArtUro"}, {"Bryan"}, {"chris"}, {"David"}, {"Jon"}, {"Mark"}, {"shane"}, {"SIMON"}, {"Thomas"}, {"TONY"}};
我有
int b_search (char list[100][20], int count, char* token)
{
__asm
{
mov eax, 0 ; zero out the result
mov esi, list ; move the list pointer to ESI
mov ebx, count ; move the count into EBX
mov edi, token ; move the token to search for into EDI
MOV ecx, 0
LOWERCASE_ARRAY: ;for(ecx = 0, ecx<ebx; ecx++), loops through each name
CMP ecx, ebx
JGE GET_OUT
INC ecx ;ecx++
MOV edx, 0; ;edx = 0
LOWERCASE_STRING: ;while next char != 0, loop through each byte to convert to lower case
OR [esi+edx],20h ;change to lower case
INC edx
CMP [esi+edx],0 ;if [esi+edx] not zero, loop again
JNZ LOWERCASE_STRING
JMP LOWERCASE_ARRAY ;jump back to start case change of next name
GET_OUT:
int b_搜索(字符列表[100][20],整数计数,字符*标记)
{
__asm
{
mov eax,0;将结果归零
mov esi,列表;将列表指针移动到esi
mov ebx,计数;将计数移到ebx
mov edi,令牌;将要搜索的令牌移动到edi中
MOV-ecx,0
小写_数组:;for(ecx=0,ecx
我把它放在第二个循环中的两个跳转指令之间。不过感谢那些阅读我问题的人
LEA esi, [esi+20]