strcomp.s

来自「汇编代码示例」· S 代码 · 共 44 行

S
44
字号
# strcomp.s - An example of comparing strings.section .datastring1:   .ascii "test"length1:   .int 4string2:   .ascii "test1"length2:   .int 5.section .text.globl _start_start:   nop   lea string1, %esi   lea string2, %edi   movl length1, %ecx   movl length2, %eax   cmpl %eax, %ecx   ja longer   xchg %ecx, %eaxlonger:   cld   repe cmpsb   je equal   jg greaterless:   movl $1, %eax   movl $255, %ebx   int $0x80greater:   movl $1, %eax   movl $1, %ebx   int $0x80equal:   movl length1, %ecx   movl length2, %eax   cmpl %ecx, %eax   jg greater   jl less   movl $1, %eax   movl $0, %ebx   int $0x80

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?