views:

146

answers:

4

Is there a technical limitation of what kind of programs I can write with assembler (NASM)?
For now I've only seem some program that do arithmetic operations, like adding two numbers.

Is it possible to write complex assembler programs, that provide a GUI, access the file system, plays sounds et cetera?

I know I wouldn't write such programs, but I'm curious, if there are technical limitations on what kind of programs I can write with assembler.

+3  A: 

There are no limitations as such. Programs written in C or C++ pass through a stage as assembler source code during compilation, so by definition you could write anything from a complete operating system such as Windows to an application like AutoCAD in assembler. It wouldn't be particularly fun or productive though, and the number of bugs would likely be substantial.

calmh
+7  A: 

Given sufficient knowledge of the target system, it's possible to do whatever you would like through ASM. However, there are other things at play that make it difficult to manage. But I've seen many GUIs that were done in ASM. They weren't particularly nice to look at, but they did. I've seen a guy write a video game (that game with the asteroids and you have a little ship in the middle of the screen that shoots a machine gun or laser) in pure ASM. He wanted to test himself, and had already done some ASM before. So yes, it can be done, whatever you would like.

Need I remind you that ASM is merely pseudo-machine instruction, to which all other code must eventually be reduced?

drachenstern
"Need I remind you that ASM is merely pseudo-machine instruction, to which all other code must eventually be reduced?" <= Yes you did have to =)
citronas
@citronas ~ so long as you remember that ASM does not mean machine instruction. ASM is often analogous to machine instruction, but usually machine instruction is in the form of specific HEX encoding, and ASM is usually alphanumeric. Programs do not first "compile to ASM" although once upon a time that did happen. #JustSayin
drachenstern
+2  A: 

No, no limitations on what CAN be done with assembler. Whether it's practical to write a GUI, access the file system, play sounds, etc, in assembler is another matter.

High Performance Mark
+1  A: 

Back in the day I think a number of computer games were programmed in assembler. I'm thinking in particular of the "Air Traffic Controller" game that came out for the TRS-80 in 1978. It had a character-based UI, beep sounds, and quite a bit of game logic all in a "realtime" game simulation that ran in 4k of RAM. Here's link to site with some info on that game, as well as a screenshot: http://atc.fastie.com/index.htm

Herbert Sitz
As referenced in my comment, the fellow that I've seen write a video game in ASM was done two years ago. Sound, video, cursor, keyboard input, and a helluva lot faster than I've seen others run. He didn't make it to run windowed so he just captured the display directly. Meant a reboot after the game, but for what he was doing on XP, pretty slick.
drachenstern