Write small C programs, and study the output of say
gcc -S prog.c
Then compare with
gcc -S -O2 prog.c
Printable View
Write small C programs, and study the output of say
gcc -S prog.c
Then compare with
gcc -S -O2 prog.c
Also, it is a MAJOR pain in the rear if, say, the program is BIOS (pulling a random example from the air) that just happens to be screwing with a piece of hardware. . . BIOS is not arranged in any type of logical manner that can be easily disassembled. . . so, no, disassembling is no fun at all.
Cool stories =)
Haha, i'm using VC++ Express though, and running windows xp, can that compiler show me the assembly?
Well it can, if you RTM.
RTM?
Read The Manual (i.e., the documentation).
lol alrighty
Okay... so i downloaded the MASM which is supposed to integrate with VC++ Express Edition (MASM 8.0), but does anyone know how to make Asm files with VC++ Express?
thanks!
And i tried googling it and looking for it on MSDN =(
anyone?
For Visual C++ 2005:
Project -> Properties -> Configuration Properties -> C/C++ -> Output Files -> Assembler Output
You could choose "Assembly-Only Listing (/FA)". After compilation, you should find the appropriate .asm files in your output directory.
Incidentally, I found the hint on MSDN: /FA, /Fa (Listing File).
Alrighty well i downloaded WinASM (www.winasm.net) and installed MASM32 and added all those files and all.
And i went to make a 16-bit COM DOS file, but it wouldn't work. Kept saying i needed another link.exe file, so i got it and put it int hte directory it said to, but still it keeps saying it cant find the link.war file.
Anyone got any ideas?
thanks!
Might want to try Borland's command line tools. If you're not obsessed with fancy IDEs or flashy features, it's easy enough to get around. You might have to find some files for the assembler separately.
You can call C-library functions quite easily. Something simplified like this:
Code:.386
.model flat
public _main
extern _printf:near
.data
msg db "Hello World!",0ah,00h
.code
_main proc
push offset msg
call _printf
add esp, 4
ret
_main endp
end
Yeah i just hate TASM in dos, it's soooooo slow when you type, and i like programs with highlighting and such cause i think it helps me to learn better.
I'm getting an IDE with the book that should come (today hopefully) so maybe i'll just wait for that, but i do like this WinASM thing, i just cant get it to work for 16-bit DOS COM and EXE files =(
Thanks!
I tend to stay away from IDE's when I can. I stick with a fancy text editor that does all the highlighting and a terminal window for compiling and executing. Simplifies everything greatly for me.