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?
NASM works for me and is quite versatile.
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.
i recommend working in DOSBOX - contains the crash better than the DOS WM.
FYI: the [url=http://www.pouet.net/prod.php?which=3397]Tube[url] demo has NASM compatible source code.
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. :)
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. :)
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.
For MS-DOS .exe and .com files, TASM/MASM is great, or even just pipe your source into debug.com.
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.
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.
FASM is my assembler of choice for the last few years.
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.
For starting up as a X86 tutorial, plesae visit Iczelion and look for ADAMS tutorial (very old one, but explains basics)
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
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.
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.
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.
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.
(I guess what I meant to say that there's this difference between controlling hardware and assembly language as such..)
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.
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.