pouët.net

Go to bottom

Best place to start with x86 assembler?

category: general [glöplog]
 
Well, I've decided to stop fucking around with the bullshit for now, and I'm wanting to get a start in x86 assembler. I have my old 486 DOS machine with TASM and Turbo Pascal on it, as well as my Windows 7 laptop. Hmm, where to begin. Could anyone possibly point me in the right direction?
depends, what do you want to use it for? inline code or standalone 100% ASM products?
added on the 2009-12-11 13:43:56 by Gargaj Gargaj
NASM works for me and is quite versatile.
added on the 2009-12-11 13:48:16 by trc_wm trc_wm
Standalone 100% ASM products for MS-DOS and maybe Windows.
I used Programmers Notepad as an editor when fiddling with tiny shit. You can use VisualStudio too though. NASM and MASM are fine.
added on the 2009-12-11 13:51:34 by raer raer
i recommend working in DOSBOX - contains the crash better than the DOS WM.
added on the 2009-12-11 13:54:25 by Gargaj Gargaj
FYI: the [url=http://www.pouet.net/prod.php?which=3397]Tube[url] demo has NASM compatible source code.
added on the 2009-12-11 13:54:42 by trc_wm trc_wm
retry:

FYI: the Tube demo has NASM compatible source code.
added on the 2009-12-11 13:55:10 by trc_wm trc_wm
Thanks! Perhaps a peek at the code and a few pokes at it will reveal a few things.
Dude, if you want to stop fucking around with the bulshit for now, you should chose asm and linux os. Why?

1. 32/64bits addresses - stop with crap 16bit, it is ancient history!
2. Clear sys calls, which provides you easy common functions. Ex.: fork for using multi thread solutions (it costs about 10bytes!)
3. tons of documentations and examples.
4. stable LIVE platform. You can use it for making 256byte (45bytes elf header) intro for fun, and for your daily work in company for money.
5. gnu toolchain for free, for default - if you will start use it, you will dump any other commercial st... crap.

Of course, you can use your win32 os for receive mails and making word documents. :)
added on the 2009-12-11 14:01:30 by krzyzan krzyzan
Getting Visual Studio to work with MASM isn't hard at all. The support is basically there already, just hidden away a bit. You won't get syntax highlighting (although there is a patch that enables it, but then ASM keywords will be highlighted in all your sources, which can be annoying), but compiling, linking and debugging all works, even stuff like cycling through errors/warnings with F8, and it all integrates nicely with Crinkler.

For MS-DOS .exe and .com files, TASM/MASM is great, or even just pipe your source into debug.com.
added on the 2009-12-11 14:12:50 by doomdoom doomdoom
And of course use GNU Emacs and VI for this purpose.
It has clearly support for Email and Latex and also you can play games in it, even visit your psychotherapist, so virtually there is no escape (use META instead of Esc please).
So use Linux 32 bits protected mode for your 256B, equipped with a decent GAS mode for Emacs, and shell embedded in it.

added on the 2009-12-11 14:17:50 by sp3c sp3c
FASM is my assembler of choice for the last few years.
added on the 2009-12-11 14:20:52 by Intrinsic Intrinsic
I used fasm, i used tasm, i used nasm, (and i used masm) but now my choice is GAS + M4.:) If you prepared to stump on the mine.
added on the 2009-12-11 14:23:00 by sp3c sp3c
For starting up as a X86 tutorial, plesae visit Iczelion and look for ADAMS tutorial (very old one, but explains basics)
added on the 2009-12-11 14:25:31 by sp3c sp3c
t$ of Alcatraz has sth useful here and here !
Adams has some good info there, a lot using INT's though. It's circa mid 90s though from what i remember so a lot of it is totally obsolete. But will show you how to make a nice fire effect! :D
added on the 2009-12-11 16:47:22 by Intrinsic Intrinsic
Yes, it is kind of obsolete, but helps to understand basic principles and some common patterns, and I have mastered assembly in just one night using this tutorial:)

Look also at the Art of Assembly book, and later at Agner's fog optimisations techniques documents.

It is also good to look at some point at Intels Manuals, if you prefer to be more hardcorish.

For SSE/MMX/3DNow! Look just at the SDKs.


added on the 2009-12-11 16:54:28 by sp3c sp3c
Well when it comes to the 486, take an old (old being somewhere in the 90s) proper book on assembler and start making little things. First in "real" mode, then get yourself PMODE/W and nail that. I second that when it comes to more advanced use of x86 assembler (and compiler code generation in C++ and so on), Agner Fog's stuff is brilliant. I always used TASM on the 486.

I guess it just depends on which direction you want to go in. There's a lot of stuff you can possibly learn (like initializing Vesa video modes with real-mode callbacks or writing a 32-bit extender for DOS) that you practically will not need if your goal is to optimize graphics loops or what have you.
added on the 2009-12-11 17:34:39 by superplek superplek
(I guess what I meant to say that there's this difference between controlling hardware and assembly language as such..)
added on the 2009-12-11 17:36:04 by superplek superplek
Yes, I agree that learning by prototype is the best way to learn, but I would not to go to P-Mode now. I did it once with Vesa support many years ago.

Proper thing now to do from my point of view, is too bootstrap a proper VM from assembly, learn about size optimisation, make a language backend.

Those things are pretty useful even now and cannot be coded in C. (well at least it is fun to do it in assembly). It is also useful for making small demos.



added on the 2009-12-11 17:54:22 by sp3c sp3c

login

Go to top