Sunday, 13 November 2011

Example

The MIPS architectonics provides a specific archetype for a apparatus cipher whose instructions are consistently 32 $.25 long. The accepted blazon of apprenticeship is accustomed by the op (operation) field, the accomplished 6 bits. J-type (jump) and I-type (immediate) instructions are absolutely defined by op. R-type (register) instructions accommodate an added acreage funct to actuate the exact operation. The fields acclimated 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 | ambition abode ] J-type

rs, rt, and rd announce annals operands; shamt gives a about-face amount; and the abode or actual fields accommodate an operand directly.

For archetype abacus the registers 1 and 2 and agreement the aftereffect in annals 6 is encoded:

[ op | rs | rt | rd |shamt| funct]

0 1 2 6 0 32 decimal

000000 00001 00010 00110 00000 100000 binary

Load a amount into annals 8, taken from the anamnesis corpuscle 68 beef afterwards the area listed in annals 3:

[ op | rs | rt | address/immediate]

35 3 8 68 decimal

100011 00011 01000 00000 00001 000100 binary

Jumping to the abode 1024:

[ op | ambition abode ]

2 1024 decimal

000010 00000 00000 00000 10000 000000 binary

No comments:

Post a Comment