logs archiveIRC Archive / Undernet / #asm / 2007 / February / 1 / 1
LimoDrive
Greetings, #asm!
Inode
lo
LimoDrive
I'm writing a tiny program in GoAsm, for win32...
The usual practice, when ending the program is to either call ExitProcess(..) or do a ret, cos if the stack is intact, there should be a return to Kernel32's ExitThread or something...
What I'm not sure is... If I do an ExitProcess, it says that "All of the object handles opened by the process are closed."
So I don't need to CloseHandle every one of them.
Is this also true if I exit via the "ret" to kernel32?
( xor eax, eax / ret ) instead of ExitProcess( 0 )...
Inode
i don't know win32
LimoDrive
kk, thanx anyway
Just for the record: The OS cleans up my mess.
dextre
hi
how do i shift left?
Inode
in which cpu's asm?
dextre
80x86
i'm using vc2005, is there a way i can format all my asm code in 1 line
it's taking an awful lot of vertical space
Inode
SHL (SHift Left)
i don't know about vc2005... some assemblers will let you seperate instructions on the same line with '|' or ';'
         

dextre
are all operations 6 bytes long ?
Inode
if you mean x86 instructions... no
the smallest seem to be 1 byte
CyberWarrior
the smallest IS 1 byte ;]
dextre
i'm writing a program that parses its own program code to sift out the binaries for every op code i deem useful
CyberWarrior
but some can be 10 bytes
and some can be even bigger
dextre
i am quite unfamiliar with how my machine works
Ashe`
Just #include the code, it'll be one line
dextre
i'm coding it write now,, it seems pretty interesting, show u what i get in a bit
http://cpp.sourceforge.net/?show=28476
i want to find the format to the opcodes in asm
but i think each command is 6 bytes
are all ops 2 bytes, or 1 byte long?
Inode
opcodes themselves, usually vary in width between 4 to 8 bits... i guess some may even be 16 bits... depending on what you consider to be an operand
when the opcodes are shorter than 8 bits, the remaining bits are used to indicate 'direction' (which operand is the source and which is the destination)
'width' (operand width... 8, 16, or 32 bits)
and 'register' (3 bits used to represent a register)
which of those actually get used in the remaining bits, depends on the operation
dextre
on my machine.. mov arg1 arg2 makes up 5 bytes
2 bytes for arg1, 2 bytes for arg2
and 1 byte for the op
CyberWarrior
opcodes vary even more
dextre
actually
CyberWarrior
1 byte till 2+8+8 bytes (for 64 bit)
dextre
i'm a bit confused because i can't seem to get the addresses to the registers
CyberWarrior
get an intel reference
it shows opcodes & the meaning
90 == nop
60h = pushad
those are small ones
big ones are like jmp 12345678:12345678
dextre
the memory of "mov eax, 1" looks like "187, 1, 0, 0, 0"
CyberWarrior
jmp segment:offset
yeah
opcode for mov
bitset for the register
and 4 values for the "1"
dextre
actually that was mov ebx
CyberWarrior
if u are using 16bit in a 32bit segment and 32bit in a 16bit segment u 'll find a 66h infront of the opcode
anyways
y u need the info about that ?
hehe
dextre
187=10111011 in binary
which of those is ebx ?
         

CyberWarrior
dunno
check instruction references
b8 == opcode
rest is the register
which is 3
ok
dextre
okay.. it looks like the last 2 or last 3
CyberWarrior
last 3
0 = ax
dextre
so mov is 10111
CyberWarrior
1= cx
2=dx
nah
dextre
184=10111000,187=10111011,185=10111001,186=10111010
mov eax; mov ebx; mov ecx; mov edx
CyberWarrior
10111 == mov r32,imm32
:-P
there are 14 different opcodes for mov
dextre
what does that mean
you gotta be kidding
CyberWarrior
32bit register 32 bit value
like i said
get yourself an instruction table
opcodes are listened in them
dextre
wait.. i thought there was only 1 type of mov
CyberWarrior
why u need those infos anyways?
Ashe`
Funny people who want to make their OS but don't understand asm
CyberWarrior
he wants to make an os ???
hahaha
dextre
..
no
CyberWarrior
but actually he doesnt need to know about registers and sh*t
thats cpu crap
not os crap
its funny to see ppl trying to asm single instructions
to view their bits
hehehehe
downloading an intel or amd reference 'd be easier
Ashe`
(Action) ordered the intel reference when it could still be ordered
dextre
will 10111 always mean storing stuff in eax ?
CyberWarrior
dextre:
dextre
i mean
CyberWarrior
http://adm1n.cjb.net/bla1.jpg
dextre
mov
Ashe`
Now it's a bit outdated though, lacks SSE3, 4 and x86-64
CyberWarrior
http://adm1n.cjb.net/bla2.jpg
http://adm1n.cjb.net/bla3.jpg
have fun
its all info about mov and the registers u need
and for sure im not going to copy all 900 pages of it
its an intel reference btw
all 14 opcodes for mov on pic 1
all registers and sh*t on 2 and 3
dextre
thanks!
CyberWarrior
so what are you trying to do ?
dextre
i'm trying to sift out the op codes programmatically
CyberWarrior
?
u want to code a dasm ?
hehehe
Ashe`
CyberWarrior: you don't wanna know
dextre
ashe makes fun of me whereever i go
Ashe`
Because it's so easy
CyberWarrior
ashe: probably he doesnt know too ;]
hahaha
Ashe`
I prefer when it's 3D though
CyberWarrior
dextre: so you are coding a dasm ?
Ashe`
The fun is more... visual
CyberWarrior
hehe
(Action) points @ hexplorer
hexplorer is cool
dextre
so.. tell me if this is right.. will any of the opcodes be 2 BYTEs?
the arguments seem to take up 2 bytes each
CyberWarrior
no
no2
dextre
hmm
CyberWarrior
its not static
each opcode got different size
even mov can be 10 bytes
Ashe`
dextreOS, the OS that never crashes (nor boots)
CyberWarrior
;]
dextre
ashe: i am not writing an os
Ashe`
I'm not sure what you're writing can be given a name
dextre
lol
i'm not sure either
to tell u the truth
the opcodes can be different bit lengths.. and they add up to 8 bits along with the register code
CyberWarrior
...
1 2 next »