
Originally Posted by
Auxilium
48-bit is way cooler than 64 bit anyways
Just clarifying, address bus size does not mean the bits of a processor. The 20 bit address bus of the 8088 doesn't mean it was a 20 bit processor.
Some things to add.
You also need to add subtraction in the operand types
lea eax, [ebp - 4] is an example
Yeah, I'm extremely new to the hardware side of programming. I barely know what 'address bus' is/does, and definitely don't know it well enough to understand how it relates to other systems. It's a learning process: basically trying to RE the instruction set without knowing anything about assembly. For example, I know 'lea' stands for 'load effective address', but have no idea how/when to use it (vs. 'mov' ?). I'm starting to study the 'easy' instructions like push/pop, and mov as it seems the most important: will start looking at more once I understand the basics (of asm) well enough.
For the negative number thing: I'll add it once I understand the rest more. From what I thought, basically neg. numbers are just in the "two's compliment" format, and the instruction byte(s) stays the same. For example..
mov eax,+1234; =
B8 34120000
mov eax,-1234; =
B8 CCEDFFFF
Details are a little fuzzy (been doing this 2 days: you'd think with only 8 general-purpose register it'd be easy, but everything being in hex, and so similar, it's a slow process). Thnx for the reminder. Once I get it to efficiently support what I consider to be the basic commands I'll upload it and ask people to try it out with their code-caves and tell me which things are missing/needed.
edit:
I noticed for example,
Code:
Any time an operand is [reg+reg] , reg+reg is a constant where...
eax,eax = 00
eax,ecx = 08
eax,edx = 10
eax,ebx = 18
eax,esp = 04
eax,ebp = 28
eax,esi = 30
eax,edi = 38
etc
..
And for
any instruction (any that I've tested obviously), if there is [reg+reg] as one operand, that 'constant' byte will be in the instruction! For example..
(you can see all the reg+reg constants in the 'wide' pic above)

example: mov [eax+ecx],edx ;
89 14 08
where 08 = the constant r+r
and 14 = constant from the pic (not sure what to call them)
I'm not sure what these relationships means exactly, or why I'm posting it, but I feel it's important. I think I see a way to accomplish what I want, but it involves
tons of select statements / cases - I think there is more structure to it than that. Cisc vs risc type stuff. ? Anyway.
----
Question:
The thing that 'threw me off' most was (not being aware of)..the different types the operands can be? For example
Code:
mov reg,reg;
mov reg,num
mov reg,[reg]
mov reg,[num]
mov reg,[reg+num]
mov reg,[reg+reg]
mov reg,[reg+reg+1byte]
mov reg,[reg+reg+4byte]
mov reg,[reg+reg*2] , mov reg,[reg+reg*4], mov reg,[reg+reg*8]
Does that sum up all the possible combinations of 'sub expressions' able to be in an operand
?
(excluding addition/subtraction-of-number cases)