GNU Assembler not making sense
Posted: Sun Aug 29, 2010 2:00 pm
For reasons unknown I have to rewrite my startup assembly code for my kernel compatible for the GNU toolchain. I used the Netwide before, with Intel syntax, and my chums told me they want to stick strictly to the GNU chain. So I thought of it as a very nice opportunity to get familiar with AT&T syntax. But now it drives me mad.
I worked through a small reference on Memory Reference in Intel and in AT&T, but the hints there just give me errors I cannot work out.
This is the code I need to translate:
And my tries look like this:
So. The problem is basically: Any position I try for the references either makes AS tell me it's a wrong syntax or a wrong scale.
Please help...
I worked through a small reference on Memory Reference in Intel and in AT&T, but the hints there just give me errors I cannot work out.
This is the code I need to translate:
Code: Select all
mov eax, _isr%1
mov word [idt + 8 * %1], ax
mov word [idt + 8 * %1 + 2], OS_CODE_DESC
mov word [idt + 8 * %1 + 4], 0x8e00
shr eax, 16
mov word [idt + 8 * %1 + 6], ax
Code: Select all
movl isr\num, %eax
movl idt, %ebx
movw %ax, 0(%ebx, 8, \num)
movw $OS_CODE_DESC, 2(%ebx, 8, \num)
movw $0x8e00, 4(%ebx, 8, \num)
shrl $16, %eax
movw %ax, 6(%ebx, 8, \num)
Please help...