Re: understanding opcodes




cr88192 wrote:

[...]

odd as it is, my assembler can also use a similar convention, though it is
by reverse-extension, simply the amd convention...

Base Regs:
Byte: r0b r1b r2b r3b r4b r5b r6b r7b
Word: r0w r1w r2w r3w r4w r5w r6w r7w
DWord: r0d r1d r2d r3d r4d r5d r6d r7d
QWord: r0 r1 r2 r3 r4 r5 r6 r7

where:
DWord: r0d r1d r2d r3d r4d r5d r6d r7d
=: eax ecx edx ebx esp ebp esi edi

I also went the other way as well:

DWord: r8d r9d r10d r11d r12d r13d r14d r15d
=: eex efx egx ehx eix ejx ekx elx

I'm not sure about the last line may become popular :)

But almost as I use it, except I decided hex-numbering,
not only to keep the eyes familiar with three letters for REG:

syntax |encoded|
RL0...RLF [00..0f] (low bytes AL..r15Lb)
RH0...RH3 [10..13] (high bytes AH,CH,DH,BH)
RW0...RWF [20..2F] (words 0..15)
RD0...RDF [40..4f] (dw)
RQ0...RQF [80..8f] (qw)
[14..1f,90..] (other regs: SEG,EFL,IDT,GDT,TR,CRn..)

You can watch all combinations on my HEXTUTOR
(set KESYS-default and HEX_WORK REG-names,
start with 40 8a 00 until 4d 8b fe or try whatsoever)

[..]
so, yes, in my assembler:
'push eax' and 'push r0d' are equivalent.

Yes, but I found the register number at the end makes
it faster readable (at least for me).

__
wolfgang





.