Assembly Code Tutor on Processor Families Used At Universities


Assembly Code TutorWhen I started programming in assembly language it was on the 6502 which was an 8 bit processor, and the computer had 32K of RAM. You could write code using a hex monitor which was complicated especially when working out the destination addresses for branches, the BBC computer actually had an assembler built into the BASIC and you could easily write small routines in assembly language. I started programming professional on the Atari 8 bit computers and had an assembly cartridge and wrote full scale programs (on tape, so you had to rewind the tape between each pass). The difficulties of programming an 8 bit computer are the fact that you only had a very limited number of registers, and also to deal with any value more than 255 you needed to use multiple instructions which made arithmetic pretty complicated. You are unlikely to need to use 8 bit processors but they are interesting in a historical context.

The next processor was the 68000, which is still in use in education and is a joy to program in as it is a very clean architecture. It could access 16MB of memory (although no computers actually had that much memory at the time), and could do arithmetic operations with 32 bits at a time which made programming much simpler. If you look at the early C compilers they were designed to operate on a PDP-11 which is similar to the 68000, and many features in C compile to simple instruction sequences such as the pre and post increment and decrements.

The x86 series was really horrible to program as you needed to worry about segment registers, and if you are programming on 8086 using DosBox then you need to take those into account. You don’t need to worry about them if you are using programs that will run on Windows (using the Irvine library for example) as all the memory is mapped the same and you don’t need to change the segment registers.

The ARM series of processors are also used a lot, and they provide an example of a RISC processor. There are a few interesting things with the ARM, it can use 2 different instructions sets (the thumb mode provides a cut down instruction set that encodes each instruction in 16 bits rather than 32 bits), and in the normal instruction set all instructions can be conditional, so the traditional way you would write an abs function would be if (reg >= 0) goto skip; reg = -reg; skip: which involves a branch, instead you get the equivalent of if (reg < 0) reg = -reg and for small procedures you don’t need to use the stack at all and simple branch to the link register.

I’ve also worked on other processors as part of the work here, including SPARC, MIPS (both RISC processors similar in many ways to the ARM) and LC3 which is simplified instruction that is only used in simulation and exclusively for teaching students.

You can rely on Programming Assignment Experts to provide any Assembly code tutoring help you may need.


Please enter your comment!
Please enter your name here