Assemblecode translation

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Poseidon

Assemblecode translation

Post by Poseidon »

I'm quite a n00b at assemble code (especially at AT&T), could somebody translate these lines from Intel syntax to AT&T?

Code: Select all

mov [ebx + (isr0.1 - isr0 + 1)], eax
dd idt /* don't know what dd is in AT&T */
mul byte [ebp + 12]
mov [idt + ebx + 5], al
Thanks in advance
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Assemblecode translation

Post by Candy »

Poseidon wrote: I'm quite a n00b at assemble code (especially at AT&T), could somebody translate these lines from Intel syntax to AT&T?

Code: Select all

mov [ebx + (isr0.1 - isr0 + 1)], eax
dd idt /* don't know what dd is in AT&T */
mul byte [ebp + 12]
mov [idt + ebx + 5], al
Thanks in advance
The dd is equal to .dword (if I'm not mistaking). the plus, minus and allt he others do as you expect in Intel syntax (add, substract etc.), so if you know how to write that in AT&T syntax you can do that. I don't for one :)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Assemblecode translation

Post by Pype.Clicker »

Poseidon

Re:Assemblecode translation

Post by Poseidon »

.dword doesn't work.. is it possibly .long? also, I'm still unable to translate this line:

Code: Select all

mul byte [ebp + 12]
and, why are %al and %bl allowed by mov but not by movl ???
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Assemblecode translation

Post by Solar »

Poseidon wrote: .dword doesn't work.. is it possibly .long?
The problem with virtually all such "translation requests" is that those who know Intel syntax only ask for a translation to AT&T without explaining what their Intel syntax source actually does. :-[ ;)

GNU as for i386 knows .byte, .short, .long, and .word (with various synonyms such as .hword). .dword is only available for a couple other architectures AFAIR.
also, I'm still unable to translate this line:

Code: Select all

mul byte [ebp + 12]
As I said above, you don't know how to express it in AT&T and I don't know (exactly) what it does in the first place... multiplying with the value located at the address in ebp plus 12? That would be...

Code: Select all

mul 12(%ebx)
...out of the top of my - terribly out-of-experience - head and not double-checked.
And, why are %al and %bl allowed by mov but not by movl ???
movl is "move long", which works on %eax and %ebx...
Every good solution is obvious once you've found it.
Poseidon

Re:Assemblecode translation

Post by Poseidon »

I think this is my very last question then..

From this line (intel syntax):

Code: Select all

LINEAR_DATA_SEL   equ   $-gdt
I made this (at&t):

Code: Select all

LINEAR_DATA_SEL      =   $-gdt
but the $ has also to be translated.. I'm not sure what it means, but i think to get the mem address of that current line, but what is it in AT&T?

Thanx
AR

Re:Assemblecode translation

Post by AR »

I'm guessing here but I think from memory that '$' is '.' (full stop) in AT&T
Post Reply