Disassembler questions



Hello,
I have been recently trying to see how some simple c programs translate
into assembly but my efforts have led to endless segfaults after
reassembling them

so i started with a simple hello world program
int main(){
printf("Hello, World!\n");
}
which to my surprise "ndisasm -b 32" returned a asm file that was 30000+
lines long
so i thought hmm that wasn't right
so i did the simple hello world with nasm
section .data
msg db "Hello, World!","$"
len equ $ - msg
section .code
global _start

_start:
mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int 21h

mov eax,1
mov ebx,0
int 21h

also returned code with several thousands of line (mostly 'add [eax], al')

any way i was wondering if there was a disassembler that if you reassemble
it it works like the first program


also i get stuff that doesn't work right like 'loopne 0x154f38'

i also tried udis but that worked less than ndisasm

-dylan

.



Relevant Pages