Assembly Programming - Where To Start

Started by
15 comments, last by bakery2k1 17 years, 11 months ago
Very insightful, I did not pause and think that I could frack up my system by messing around with asm. The emulation method sounds like the smart way to go about this.

Thanks,
Advertisement
Quote:I did not pause and think that I could frack up my system by messing around with asm


You can mess it up just as much as you could with say a C++ program, as it's still the same machine code running on the same machine. Modern operating system (such as windows) use the protection features of the x86 architecture so you won't be able to directly access hardware, write to memory however you want etc. The potential for screwing things up is pretty much exactly the same as it is for any other language. Using an emulator seems pretty pointless IMO.

Quote:in fact, about 10 yrs ago I actually managed to make my harddrive unusable by corrupting its FAT when writing in assembly language...


You can play with the FAT in pretty much any language provided you have the API calls available, screwing up the FAT doesn't happen because you're using asm, it happens because you wrote your code wrong which you can do in any language.

Quote:Mainly because Win32 is not a particularly forgiving OS when fooling around with low level stuff, meaning you are not that unlikely to possibly manage to crash your OS or seriously affect it when playing around with assembly language.


As I stated above programs written in assembly are subject to the same protection mechanisms programs written in any other language are, there's nothing special about asm that makes it easy to bring down your OS or screw it up in some way. If you can do it easily in asm, you can do it easily in another language as well.
Thats calmed my nerves, thanks. I've done some pretty dumb stuff with C++ and my computer still lives.

One thing which came up, how do I avoid going HLA? I want to stay as low level asm as possible. Can I still use NASM and FASM and just turn off any macros which do the nitty gritty stuff for you?
i would like to tinker around doing some programming for the NES. i have looked at the documentation for this and i believe they used a Motorola 68000 or something close to that.

looking through the code just to add a 8x8 pixel image in assembly really makes you appreciate high level languages and high end API's like OpenGL. i cant imagine what the code for a game like Mega Man for the NES, would look like. thousands upon thousands of code.. these were the hdefinition of the hard core programmers to me...no cutting corners there.
heh
Quote:Original post by RedKMan
Thats calmed my nerves, thanks. I've done some pretty dumb stuff with C++ and my computer still lives.

without trying to scare you, but it is definitely easier to do "dumb stuff" in asm than in C++, simply because it is much more low level and doesn't necessarily require any sort of explicit APIs to get access otherwise unavailable resources/functionality.

Quote:Original post by RedKManOne thing which came up, how do I avoid going HLA? I want to stay as low level asm as possible. Can I still use NASM and FASM and just turn off any macros which do the nitty gritty stuff for you?


don't worry too much about HLL macros in NASM or FASM, if you don't use such macros you won't learn to depend on them. There are many good tutorials out there, and it will be made quite clear which assembly insructions are in fact low level INSTRUCTIONS, and which ones are assembler-specific macros/extensions. Likewise, if you check out an IA32 asm manual, there won't be any word about assembler-specific stuff!
Quote:Original post by OpenGL_Guru
i would like to tinker around doing some programming for the NES. i have looked at the documentation for this and i believe they used a Motorola 68000 or something close to that.

Do you really want to to assembly programming, or are you generally looking for a way to run your stuff on the NES? If it's mainly the latter, why don't you simply use a cross compiler (such as i.e. gcc) to compile HLL sources to your specific platform/architecture?


Quote:Original post by Anonymous Poster
without trying to scare you, but it is definitely easier to do "dumb stuff" in asm than in C++, simply because it is much more low level and doesn't necessarily require any sort of explicit APIs to get access otherwise unavailable resources/functionality.


That's not true. If you're writing assembly programs to run under Windows, they will run with exactly the same protection mechanisms in place as with any C++ program. If you're writing assembly to run under DOS, however, it is certainly possible to mess up your system by doing "dumb stuff", but it is also possible in C++ under DOS.

In other words, don't worry about messing anything up, it's no more likely to happen in assembly than in C++.

Quote:
i would like to tinker around doing some programming for the NES. i have looked at the documentation for this and i believe they used a Motorola 68000 or something close to that.


The NES used a 6502. You can get lots of infomation on this chip at 6502.org. There also appears to be a C compiler here.

This topic is closed to new replies.

Advertisement