From: Frank K. <fbk...@co...> - 2010-10-13 11:13:29
|
Tyler Littlefield wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello all, Hi Tyler, > I'm looking for a few things, and maybe someone can help me out some. > I've been toying with asm for a while, but I'd really like to dive in. > One of my problems is proper information on what things like enter and > leave do, etc. Is there a good reference somewhere? Jakob's given you probably the best answer - Intel and/or AMD manuals. Since I was used to it, I "rescued" the instruction set reference chapter from the old Nasm Manual: http://home.myfairpoint.net/fbkotler/nasmdocr.html This has the advantage of being in Nasm syntax, but doesn't include any information on effect of instructions on flags (among other shortcomings). Another alternative: http://ref.x86asm.net/ If what you need is more information on where, how, and why you'd use enter, leave, etc. maybe a tutorial would be more help: http://www.drpaulcarter.com/pcasm/ > I'm also curious of the output of a .lst file, and how it's organized: > There don't seem to be column headers, so I'm having issues figuring out > what's what with my reader. Jakob's answered that, too (Thanks, Jakob!). Perhaps an example... 18 00000000 55 push ebp 19 00000001 89E5 mov ebp, esp 20 00000003 83EC08 sub esp, 8 21 22 23 24 00000006 89D874020407 foo The leftmost column is just line numbers in the source file. Next is the address. When the linker's had its way with it, these addresses will be relocated - this is what Nasm knows at the time the list file is generated. Next is the byte(s) that Nasm will emit, and then the source code. The last line is what you get from "%macro foo 0.nolist" - the macro doesn't get expanded into "source code" at all. Without the ".nolist", the output is a little "too" cluttered (depending on your taste). Some more discussion on the forum: http://forum.nasm.us/index.php?topic=906.0 > Also, are there some good nasm samples out there to play with? Iseen a > text editor, but that might just confuse me, then confuse me again. Nothing worse than being confused twice! Unless it's being confused three times... or more. :) There are a few dos examples on my web page - not very good ones. Starting off with dos isn't a bad idea (IMO), but you don't want to waste too much time with it. There's a selection of examples here: http://codewiki.wikispaces.com/ Not all for Nasm, but you can find 'em. The !YAHOO! win32-nasm-users group has got a bunch of examples in the "files" section. For those who don't want to join a Yahoo group, I liberated them and put them on SourceForge: <http://sourceforge.net/projects/nasm/files/example%20code/yahoowin/yahoowin.zip/download> It's a bit of a "code bomb" - you'll have to unzip individual directories and sort out what's what. Probably easier to join the group (though that won't help all that much). Needs to be "indexed"! Nasm versions of the code from Iczelion's Windows tutorials are in there, if that's what you're looking for. The Tutorials themselves are here: http://win32assembly.online.fr/ Pretty old, but a good start in Windows, if that's what you're after. There are examples in the forum... http://forum.nasm.us/index.php?board=3.0 ... but fairly "random". If you're not finding anything at the right "level" - somewhere between "hello world" and the text editor - maybe make some suggestions and we'll see if we can work up something... Best, Frank |