Moving from AT&T to Intel syntax (help!)
Posted: Tue Aug 07, 2007 5:42 pm
Hi, I recently decided to move to Intel but I encountered a problem. What's wrong with this code:
NASM says it's got errors in lines 7 and 13, but it looks right to me. It says "comma or end of line expected". In AT&T I just put:
What am I doing wrong?
Thanks
Oh, also what does 'db' 'dw' 'dorwd' mean or stand for? My guess is byte, word, and double word but what does the 'd' mean?
Code: Select all
section .data
items db 12, 34, 56, 34, 23, 33, 78, 51, 0
section .text
global _start
_start:
mov edi, 0
mov eax, items[edi]
mov ebx, eax
start_loop:
cmp eax, 0
je end_loop
inc edi
mov eax, items[edi]
cmp ebx, eax
jle start_loop
mov ebx, eax
jmp start_loop
end_loop:
push ebx
mov eax, 1
call _syscall
_syscall:
int 0x80
ret
Code: Select all
movl items(, %edi, 4), %eax
Thanks
Oh, also what does 'db' 'dw' 'dorwd' mean or stand for? My guess is byte, word, and double word but what does the 'd' mean?