Some kind of typo in Intel manuals, or my interpretation is wrong.
- From: wahjava@xxxxxxxxx (Ashish Shukla आशीष शुक्ल)
- Date: Sun, 25 Nov 2007 01:20:55 +0530
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I'm just trying to understand the AMD64 instruction format to write a
codegen for this architecture someday. I've a problem understanding
the description of the ADD instruction given in the manual[1] referring.
REX + 80 /0 ib ADD r/m8,imm8 Add sign-extended imm8 to r/m64
Using above description I generated following instruction bytes:
1: .byte 0x48, 0x31, 0xc0 # xor %rax, %rax
2: .byte 0x40, 0x80, 0xc0, 0xf0 # add $0xf0, %rax
My interpreation of above instruction is following:
1: zeroes the RAX register.
2: Adds sign-extended 0xf0 to RAX, which means RAX =0xfffffffffffffff0.
When I executed above instructions in gdb, after 2nd statement, RAX = 0xf0 .
So can someone pinpoint, what is wrong here ?
References:
1. IA-32 SDM Vol. 2A, Instruction Set: A-M
http://www.intel.com/design/processor/manuals/253666.pdf
TIA
- --
Ashish Shukla आशीष शुक्ल http://wahjava.wordpress.com/
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHSICjHy+EEHYuXnQRAvZJAKDFqCRT8rX4iKmDhHgLXzwyGAJkWwCZAQgn
eTGXHLsqBuZx4jMil57IUAs=
=02bM
-----END PGP SIGNATURE-----
.
- Follow-Ups:
- Re: [Clax86list] Some kind of typo in Intel manuals, or my interpretation is wrong.
- From: Charles Crayne
- Re: [Clax86list] Some kind of typo in Intel manuals, or my interpretation is wrong.
- Prev by Date: I need a help
- Next by Date: Re: [Clax86list] Some kind of typo in Intel manuals, or my interpretation is wrong.
- Previous by thread: I need a help
- Next by thread: Re: [Clax86list] Some kind of typo in Intel manuals, or my interpretation is wrong.
- Index(es):
Relevant Pages
|
|