Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.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_X86 - Fatal编程技术网

Assembly 组件-如果条件和大写字母

Assembly 组件-如果条件和大写字母,assembly,x86,Assembly,X86,我想检查“ep”是否是大写字母 所以我在ascii表中检查它,我发现它是从0x41到0X40&您可以使用两个检查来实现这一点。大概是这样的: cmp ep, 0x40 jl not_capital cmp ep, 0x54 jg not_letter # if we arrive here, it's a capital letter not_letter: # continue execution flow 或者,您可以减去下限并检查该值是否小于差值,即: # Note: 0x54 -

我想检查“ep”是否是大写字母


所以我在ascii表中检查它,我发现它是从0x41到0X40&您可以使用两个检查来实现这一点。大概是这样的:

cmp ep, 0x40
jl not_capital
cmp ep, 0x54
jg not_letter

# if we arrive here, it's a capital letter

not_letter:
# continue execution flow
或者,您可以减去下限并检查该值是否小于差值,即:

# Note: 0x54 - 0x40 = 0x14
mov ep, <reg>     # replace <reg> with the register of your choice
sub 0x40, <reg>
cmp <reg>, 0x15   # if it's 0-0x14, we're ok. 0x15 or more is bad
jb letter         # we want unsigned check here (jb not jl)
#注:0x54-0x40=0x14
mov ep,#替换为您选择的寄存器
子0x40,
cmp,0x15#如果是0-0x14,我们没事。0x15或更高是坏的
jb信函#我们需要未签名支票(jb而非jl)
免责声明:我不知道您的程序集格式(不过我试图复制它)。但不要相信我的语法是准确的

# Note: 0x54 - 0x40 = 0x14
mov ep, <reg>     # replace <reg> with the register of your choice
sub 0x40, <reg>
cmp <reg>, 0x15   # if it's 0-0x14, we're ok. 0x15 or more is bad
jb letter         # we want unsigned check here (jb not jl)