Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

Any sufficiently advanced bug is indistinguishable from a feature. -- Rich Kulawiec


programming / alt.lang.asm / Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?

SubjectAuthor
* Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?Veek M
+- Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?Robert Wessel
+* Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use theHerbert Kleebauer
|`* Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use theRod Pemberton
| `- Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use theHerbert Kleebauer
`* Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use theRod Pemberton
 `- Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use theVeek M

1
Subject: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
From: Veek M
Newsgroups: alt.lang.asm
Organization: A noiseless patient Spider
Date: Tue, 31 Dec 2019 18:10 UTC
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: vee...@dont-use-this.com (Veek M)
Newsgroups: alt.lang.asm
Subject: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
Date: Tue, 31 Dec 2019 18:10:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <qug2uu$8r2$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 31 Dec 2019 18:10:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="89eedcfaf0af3ceedb932b1b84586ced";
logging-data="9058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187jLV5/5Qm3xTs6GQ8kY31"
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
Cancel-Lock: sha1:k46i4JwlbRfyWmg1hCxtYEhGg94=
View all headers
what's the '55' in
   8b 55 08  mov 0x8(%ebp),%edx  

I checked
   http://ref.x86asm.net/coder32.html#x0F8B

there's a
    8B r MOV r16/32 r/m16/32
but.. is he following Intel Syntax for naming operands? and there's no
mention of a multibyte opcode here?

Could someone suggest a good ref for both types of syntax.


Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
From: Robert Wessel
Newsgroups: alt.lang.asm
Organization: Forte - www.forteinc.com
Date: Tue, 31 Dec 2019 20:53 UTC
References: 1
Path: i2pn2.org!i2pn.org!aioe.org!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx11.iad.POSTED!not-for-mail
From: robertwe...@yahoo.com (Robert Wessel)
Newsgroups: alt.lang.asm
Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
Message-ID: <gfcn0f5vqa7ci37k31kclj8cql3n7trtdt@4ax.com>
References: <qug2uu$8r2$1@dont-email.me>
User-Agent: ForteAgent/7.20.32.1218
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 31
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 31 Dec 2019 14:53:33 -0600
X-Received-Bytes: 1924
X-Received-Body-CRC: 1934978524
View all headers
On Tue, 31 Dec 2019 18:10:38 -0000 (UTC), Veek M
<veek@dont-use-this.com> wrote:

what's the '55' in
  8b 55 08  mov 0x8(%ebp),%edx  

I checked
  http://ref.x86asm.net/coder32.html#x0F8B

there's a
   8B r MOV r16/32 r/m16/32
but.. is he following Intel Syntax for naming operands? and there's no
mention of a multibyte opcode here?

Could someone suggest a good ref for both types of syntax.


The 55 is the mod/RM byte.  It defines the parameters to the
instruction.  There's a reference at the top of the page you linked.

The mod/RM byte has three fields, which are interpreted as follows:

aa.bbb.ccc = 01.010.101 (0x55)

The bbb bits are either an opcode extension or (in this case) a
register specified for the first operand.  010 specifies edx.  The aa
specifies a type of memory reference or a register source.  In this
case 01 specifies a memory operand with an 8-bit displacement.  The
ccc specifies the register for the second operand (or points to
extended data in the SIB byte), 101=ebp.  The (8-bit) offset follows
the mod/RM byte.


Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
From: Herbert Kleebauer
Newsgroups: alt.lang.asm
Organization: Aioe.org NNTP Server
Date: Tue, 31 Dec 2019 21:09 UTC
References: 1
Path: i2pn2.org!i2pn.org!aioe.org!.POSTED.XxlwlYi2FBt2bJJpMI0Yrw.user.gioia.aioe.org!not-for-mail
From: kle...@unibwm.de (Herbert Kleebauer)
Newsgroups: alt.lang.asm
Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the
ref?
Date: Tue, 31 Dec 2019 22:09:18 +0100
Organization: Aioe.org NNTP Server
Lines: 85
Message-ID: <qugdds$1j24$1@gioia.aioe.org>
References: <qug2uu$8r2$1@dont-email.me>
NNTP-Posting-Host: XxlwlYi2FBt2bJJpMI0Yrw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.3.1
Content-Language: de-DE
X-Notice: Filtered by postfilter v. 0.9.2
View all headers
On 31.12.2019 19:10, Veek M wrote:
what's the '55' in
    8b 55 08  mov 0x8(%ebp),%edx

That is:  mov src,dest


I checked
    http://ref.x86asm.net/coder32.html#x0F8B

there's a
     8B r MOV r16/32 r/m16/32

That is:  mov dest src

55 means: r16/32   -> edx
           r/m16/32 -> disp8[ebp]


but.. is he following Intel Syntax for naming operands? and there's no
mention of a multibyte opcode here?

Could someone suggest a good ref for both types of syntax.


 From the 386 processor manual:

Table 17-3. 32-Bit Addressing Forms with the ModR/M Byte


r8(/r)                     AL    CL    DL    BL    AH    CH    DH    BH
r16(/r)                    AX    CX    DX    BX    SP    BP    SI    DI
r32(/r)                    EAX   ECX   EDX   EBX   ESP   EBP   ESI   EDI
/digit (Opcode)            0     1     2     3     4     5     6     7
REG =                      000   001   010   011   100   101   110   111

    Effective
┌───Address──┐ ┌Mod R/M┐ ┌─────────ModR/M Values in Hexadecimal───────┐

[EAX]                000   00    08    10    18    20    28    30    38
[ECX]                001   01    09    11    19    21    29    31    39
[EDX]                010   02    0A    12    1A    22    2A    32    3A
[EBX]                011   03    0B    13    1B    23    2B    33    3B
[--] [--]        00  100   04    0C    14    1C    24    2C    34    3C
disp32               101   05    0D    15    1D    25    2D    35    3D
[ESI]                110   06    0E    16    1E    26    2E    36    3E
[EDI]                111   07    0F    17    1F    27    2F    37    3F

disp8[EAX]           000   40    48    50    58    60    68    70    78
disp8[ECX]           001   41    49    51    59    61    69    71    79
disp8[EDX]           010   42    4A    52    5A    62    6A    72    7A
disp8[EPX];          011   43    4B    53    5B    63    6B    73    7B
disp8[--] [--]   01  100   44    4C    54    5C    64    6C    74    7C
disp8[ebp]           101   45    4D    55    5D    65    6D    75    7D
disp8[ESI]           110   46    4E    56    5E    66    6E    76    7E
disp8[EDI]           111   47    4F    57    5F    67    6F    77    7F

disp32[EAX]          000   80    88    90    98    A0    A8    B0    B8
disp32[ECX]          001   81    89    91    99    A1    A9    B1    B9
disp32[EDX]          010   82    8A    92    9A    A2    AA    B2    BA
disp32[EBX]          011   83    8B    93    9B    A3    AB    B3    BB
disp32[--] [--]  10  100   84    8C    94    9C    A4    AC    B4    BC
disp32[EBP]          101   85    8D    95    9D    A5    AD    B5    BD
disp32[ESI]          110   86    8E    96    9E    A6    AE    B6    BE
disp32[EDI]          111   87    8F    97    9F    A7    AF    B7    BF

EAX/AX/AL            000   C0    C8    D0    D8    E0    E8    F0    F8
ECX/CX/CL            001   C1    C9    D1    D9    E1    E9    F1    F9
EDX/DX/DL            010   C2    CA    D2    DA    E2    EA    F2    FA
EBX/BX/BL            011   C3    CB    D3    DB    E3    EB    F3    FB
ESP/SP/AH        11  100   C4    CC    D4    DC    E4    EC    F4    FC
EBP/BP/CH            101   C5    CD    D5    DD    E5    ED    F5    FD
ESI/SI/DH            110   C6    CE    D6    DE    E6    EE    F6    FE
EDI/DI/BH            111   C7    CF    D7    DF    E7    EF    F7    FF


───────────────────────────────────────────────────────────────────────────
NOTES:
   [--] [--] means a SIB follows the ModR/M byte. disp8 denotes an 8-bit
   displacement following the SIB byte, to be sign-extended and added to the
   index. disp32 denotes a 32-bit displacement following the ModR/M byte, to
   be added to the index.
───────────────────────────────────────────────────────────────────────────




Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
From: Rod Pemberton
Newsgroups: alt.lang.asm
Organization: Aioe.org NNTP Server
Date: Wed, 1 Jan 2020 08:00 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!aioe.org!.POSTED.+15yR2JuBIwiofOqK4kSZw.user.gioia.aioe.org!not-for-mail
From: nomaili...@trgzxcqvbe.cpm (Rod Pemberton)
Newsgroups: alt.lang.asm
Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the
ref?
Date: Wed, 1 Jan 2020 03:00:36 -0500
Organization: Aioe.org NNTP Server
Lines: 41
Message-ID: <quhjdk$q4s$1@gioia.aioe.org>
References: <qug2uu$8r2$1@dont-email.me>
<qugdds$1j24$1@gioia.aioe.org>
NNTP-Posting-Host: +15yR2JuBIwiofOqK4kSZw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
X-Notice: Filtered by postfilter v. 0.9.2
View all headers
On Tue, 31 Dec 2019 22:09:18 +0100
Herbert Kleebauer <klee@unibwm.de> wrote:

Could someone suggest a good ref for both types of syntax. 

 From the 386 processor manual:

Table 17-3. 32-Bit Addressing Forms with the ModR/M Byte

[table]

Wow Herbert, you typed that in for him?  That was nice of you.


a) I would've just linked to a .pdf of the x86 manuals with a page
number, e.g., perhaps one of them on Bitsaver's:

See _dataBooks, 8086, 80186, ... 80486, IA32_IA64 etc directories for
Intel processor manuals as .pdf's:
http://bitsavers.org/components/intel/

Bitsavers.org
"Bitsavers.org Documents Library" for computer materials
http://www.bitsavers.org/


b) Or, I might've provided a link to Sandpile's x86 reference page:

"16-bit mod R/M byte"
https://www.sandpile.org/x86/opc_rm16.htm

Sandpile.org
"The world's leading source for technical x86 processor information."
https://www.sandpile.org


Rod Pemberton
--
"It's OK to be White." <-- investigated by FBI as a hate crime
"Black Lives Matter." <-- not being investigated ...



Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
From: Rod Pemberton
Newsgroups: alt.lang.asm
Organization: Aioe.org NNTP Server
Date: Wed, 1 Jan 2020 08:32 UTC
References: 1
Path: i2pn2.org!i2pn.org!aioe.org!.POSTED.+15yR2JuBIwiofOqK4kSZw.user.gioia.aioe.org!not-for-mail
From: nomaili...@trgzxcqvbe.cpm (Rod Pemberton)
Newsgroups: alt.lang.asm
Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the
ref?
Date: Wed, 1 Jan 2020 03:32:44 -0500
Organization: Aioe.org NNTP Server
Lines: 58
Message-ID: <quhl9r$q4s$4@gioia.aioe.org>
References: <qug2uu$8r2$1@dont-email.me>
NNTP-Posting-Host: +15yR2JuBIwiofOqK4kSZw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
X-Notice: Filtered by postfilter v. 0.9.2
View all headers
On Tue, 31 Dec 2019 18:10:38 -0000 (UTC)
Veek M <veek@dont-use-this.com> wrote:

what's the '55' in
   8b 55 08  mov 0x8(%ebp),%edx  

I checked
   http://ref.x86asm.net/coder32.html#x0F8B

there's a
    8B r MOV r16/32 r/m16/32
but.. is he following Intel Syntax for naming operands? and there's
no mention of a multibyte opcode here?

Could someone suggest a good ref for both types of syntax.

Yes.


First, there are 3 basic types of syntax for x86 processor: Motorola,
Intel, and NASM.  Motorola syntax came from the 68000 series Motorola
processors.  IIRC, Motorola syntax is sometimes called AT&T syntax.

Motorola syntax assemblers:
GNU GAS  (which is their assembly backend for their GCC C compiler)

Intel syntax assemblers:
Microsoft MASM
OpenWatcom WASM
Japheth's JWasm
GNU GAS  (with a .intel_syntax directive)

NASM syntax assemblers:
NASM
FASM


Second, you could have entered "gas syntax vs intel syntax" without
quotes into Google's search.  Four or so results on the first page look
good to me:

http://www.cs.cmu.edu/afs/cs/academic/class/15213-f01/docs/gas-notes.txt
https://en.wikibooks.org/wiki/X86_Assembly/GAS_Syntax
https://developer.ibm.com/articles/l-gas-nasm/
http://web.mit.edu/rhel-doc/3/rhel-as-en-3/i386-syntax.html

There appear to be a few more good results on the second page too.

Sometimes, you'll find some additional excellent results within later
result pages for Google's search, up to about page 20 or so, but it's
time consuming to go through that many results.


Rod Pemberton
--
"It's OK to be White." <-- investigated by FBI as a hate crime
"Black Lives Matter." <-- not being investigated ...



Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
From: Herbert Kleebauer
Newsgroups: alt.lang.asm
Organization: Aioe.org NNTP Server
Date: Wed, 1 Jan 2020 09:45 UTC
References: 1 2 3
Path: i2pn2.org!i2pn.org!aioe.org!.POSTED.Q9XHt6j97vBHIKK2Iiuk5w.user.gioia.aioe.org!not-for-mail
From: kle...@unibwm.de (Herbert Kleebauer)
Newsgroups: alt.lang.asm
Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the
ref?
Date: Wed, 1 Jan 2020 10:45:19 +0100
Organization: Aioe.org NNTP Server
Lines: 17
Message-ID: <quhpne$1mk6$1@gioia.aioe.org>
References: <qug2uu$8r2$1@dont-email.me> <qugdds$1j24$1@gioia.aioe.org>
<quhjdk$q4s$1@gioia.aioe.org>
NNTP-Posting-Host: Q9XHt6j97vBHIKK2Iiuk5w.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.3.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
View all headers
On 01.01.2020 09:00, Rod Pemberton wrote:
On Tue, 31 Dec 2019 22:09:18 +0100
Herbert Kleebauer <klee@unibwm.de> wrote:

Could someone suggest a good ref for both types of syntax. 

 From the 386 processor manual:

Table 17-3. 32-Bit Addressing Forms with the ModR/M Byte

[table]

Wow Herbert, you typed that in for him?  That was nice of you.

That was just copied from the 386 manual which is available
in pure text form (using the standard DOS font, so better
don't open it with a Windows editor but within a CMD shell).


Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the ref?
From: Veek M
Newsgroups: alt.lang.asm
Organization: A noiseless patient Spider
Date: Sat, 4 Jan 2020 07:31 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: vee...@dont-use-this.com (Veek M)
Newsgroups: alt.lang.asm
Subject: Re: Multibyte opcodes: 8b 55, what's the 55 and how do you use the
ref?
Date: Sat, 4 Jan 2020 07:31:27 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <qupf0f$i50$3@dont-email.me>
References: <qug2uu$8r2$1@dont-email.me> <quhl9r$q4s$4@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 4 Jan 2020 07:31:27 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="f3256a5f54575ce9277b22f1c2171c34";
logging-data="18592"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sC10IbEQJdBtkT6gQ4RG9"
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
Cancel-Lock: sha1:NDv/LTwqqQxoKTSJYfxm/V+H3WM=
View all headers
On Wed, 01 Jan 2020 03:32:44 -0500, Rod Pemberton wrote:


FASM

thanks for the .intel_syntax directive - I was wondering about that


1
rocksolid light 0.7.2
clearneti2ptor