![]() |
![]()
Custom Search
|
Computer History
|
|||||||||||
|
Assembly languagesHumans use mnemonic codes to refer to machine code instructions. A more readable rendition of the machine language is called an assembly language and consists of both binary numbers and simple words whereas machine code is composed only of the two binary digits 0 and 1. For example, on the Zilog Z80 processor, the machine code 00000101 causes the CPU to decrement the B processor register. In assembly language this would be written as DEC B. ExampleThe MIPS architecture provides a specific example for a machine code whose instructions are always 32 bits long. The general type of instruction is given by the op (operation) field, the highest 6 bits. J-type (jump) and I-type (immediate) instructions are fully specified by op. R-type (register) instructions include an additional field funct to determine the exact operation. The fields used in these types are: 6 5 5 5 5 6 bits [ op | rs | rt | rd |shamt| funct] R-type [ op | rs | rt | address/immediate] I-type [ op | target address ] J-type rs, rt, and rd indicate register operands; shamt gives a shift amount; and the address or immediate fields contain an operand directly. For example adding the registers 1 and 2 and placing the result in register 6 is encoded: [ op | rs | rt | rd |shamt| funct] 0 1 2 6 0 32 decimal 000000 00001 00010 00110 00000 100000 binary Loading a value from the memory cell 68 cells after the one register 3 points to into register 8: [ op | rs | rt | address/immediate] 35 3 8 68 decimal 100011 00011 01000 00000 00001 000100 binary Jumping to the address 1025: [ op | target address ] 2 1025 decimal 000010 00000 00000 00000 10000 000001 binary Resources |