Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly 装配-更换箱_Assembly_Att_I386 - Fatal编程技术网

Assembly 装配-更换箱

Assembly 装配-更换箱,assembly,att,i386,Assembly,Att,I386,我在用AT&T的语法写作。 这个循环应该检查,如果大小写在61-7A ASCII范围内(它的意思是这个小写字母)-如果否,则将其转换为空格“” change: movb (%esi), %bh #move case temporary to bh register cmp $0x61,%bh #compare 'a' ASCII and case from bh register jge nothing #if a

我在用AT&T的语法写作。 这个循环应该检查,如果大小写在61-7A ASCII范围内(它的意思是这个小写字母)-如果否,则将其转换为空格“”

change:
    movb (%esi), %bh        #move case temporary to bh register
    cmp $0x61,%bh           #compare 'a' ASCII and case from bh register
    jge nothing             #if ascii from bh is greater than 'a', jump to nothing
    cmp $0x7A,%bh
    jle nothing             #same, if is in range 61-7A jump to nothing
    movb $0x20,%bh          #if wasn't in range, change to 20 ASCII (space)
nothing:
    movb %bh, (%esi)        #put case back into string
    addl $1,%esi            #move pointer to the next case
    loop change
这是我的循环。ESI是指向字符串的指针


我的问题很简单——这不起作用,我不知道为什么

第一个条件跳转错误

change:
    movb (%esi), %bh        #move case temporary to bh register
    cmp $0x61,%bh           #compare 'a' ASCII and case from bh register
    jl space             #if ascii from bh is greater than 'a', jump to nothing
    cmp $0x7A,%bh
    jle nothing             #same, if is in range 61-7A jump to nothing
space: 
   movb $0x20,%bh          #if wasn't in range, change to 20 ASCII (space)
nothing:
    movb %bh, (%esi)        #put case back into string
    addl $1,%esi            #move pointer to the next case
    loop change

您的
nic
标签在哪里定义?您也可以只说
inc%esi
而不是
addl$1,%esi
。保存一些指令字节/周期。:)我的错误,抱歉-nic的意思是“没什么”,我把它从波兰语翻译过来,忘了更改。