Thats true, But there are many types of assembly. I'm learning 16-bit real mode assembly. And, It's pretty hard for me.
Which processor? Ease of programming in ASM varies widely with the instruction set. I did most of my ASM for PDP-11, which is a very clean 16-bit architecture. The Motorola 68000 is based on PDP-11, so it's likewise pretty clean though you do have to distinguish between address and data registers. x86 is a nightmare, since it's source-code compatible with Intel 8008 :-) ARM is a decent ASM, but if you look at the instruction set coding it's a dog's breakfast with each architecture version fitting new instructions into the holes of the previous versions. If you like railroad time schedules with lots of footnotes, you'll love the ARM quick-reference guide.
I've been intrigued by the TI MSP430 instruction set. It's clearly based on PDP-11, with some RISC concepts tossed in. Looks very clean.
Is there any particular reason why - it seems a bit odd because mostly one codes in assembler for the best possible optimisation so why not use a 32 bit processor and be quicker anyway ?
Write macro's to remove some of the repetitive coding! Just like creating libraries for C code.
I once wrote a recursive macro in PDP-11 Macro-11 just to prove to myself that I could do it. It generated all permutations of a sequence of data bytes. 5 bytes took 1 minute to assemble. 6 bytes took 6 minutes to assemble. Generating them at run time was instantaneous.
You should not try assembly until you're a programming expert. Its very complicated, I recommend python or C/C++
IMO assembly language is very simple. You have very simple instructions that do very simple things. It's when you combine instructions that things get complicated It's kind of like circuit theory. Basic circuit elements like resistors and capacitors are simple, but when you put them together the number of simultaneous equations quickly overwhelms you. (I do believe in Kirchhoff's Laws, I do I do I do.)
Personally, I think one should learn ASM before C. In many ways C is a portable assembly language, and at run time programs fail at the machine language level. If you haven't experienced (or preferably mastered) assembly language, you'll have a dreadful time understanding some bugs like clobbering the run-time stack.
Also, if you're going to write a compiler IMO you should be one for a while first so you know the challenges first-hand.
That's an interesting observation. I detested Assembly when I learned it in the early 1990's precisely because I didn't understand the hardware-software interface. (I was coming at it from a coding background.) Approaching it years later with some basic knowledge of CPU architecture, how physical memory actually works, etc made it more intelligible, if not exactly intuitive.
I learned pretty quickly that I lack the disposition to be a great coder, but I have nothing but respect for those who are.
Top Comments