Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

x86 assembly: How does the 'subl' command work in AT&T syntax

Tags:

x86

assembly

att

%edx has a value of 0x3, and %eax has a value of 0x100. Then we have the instruction: subl %edx, %eax What's the result value of %eax?

like image 919
WhiteTherewasproblem Avatar asked Mar 09 '26 05:03

WhiteTherewasproblem


1 Answers

You have

movl $3, %edx
movl $0x100, %eax

as input values. The instruction

subl %edx, %eax

just subtracts 3(dec) in EDX from 100(hex) in EAX resulting in 100h-3h=0FDh.

like image 162
zx485 Avatar answered Mar 12 '26 03:03

zx485



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!