hts.StevenWood.com

Machine Code

Home ] Up ] [ Machine Code ] Simple Program ] Assignment 2-2 ] Syntax Errors ] Logic Errors ] Assignment ][ Last Page ]

The machine codes for a make-believe computer are list below ...

 

Machine code
(binary #)
decimal # Description of instruction
00000001 1 load up a memory  address into X and execute instruction found there
00000010 2 halt execution (stop running program)
00000011 3 move data into register A 
00000100 4 move contents of register A to register B
00000101 5 add contents of A to what is found in B and store answer in A
00000110 6 subtract A from B and store answer in A
00000111 7  divide A by B and store answer in A
00001000 8  multiply A by B and store answer in A
00001001 9 compare two things (A and B) and jump to line #X if A = B
00001010 10 compare two things (A and B) and jump to line #X if A > B
00001011 11 compare two things (A and B) and jump to line #X if A >= B
00001100 12 compare two things (A and B) and jump to line #X if A < B
00001101 13 compare two things (A and B) and jump to line #X if A <= B
00001110 14 load memory address of a variable into register Y 
00001111 15 get data from memory location found in Y and store in register A
00010000 16 store data that is found in register A at memory location found in Y 
00010001 17 get data from memory location found in Y and store in register B
00010010 18 store data  that is found in register B at memory location found in Y

* A, B, X and Y are registers - registers are memory units located right on the CPU

 

 

Source: P. Vegoda. Advanced Topics in Java

Home ] Up ] [ Machine Code ] Simple Program ] Assignment 2-2 ] Syntax Errors ] Logic Errors ] Assignment ][Last Page]
All material on this site is copyright © 1997- by Steven Wood or as credited. All right reserved. Use of this site indicates you agreement with the  terms of use.
Send comments or questions to about this page.
Every attempt has been made to credit work under copyright. If there are any claims that copyright has been missed please contact the .
+SDG+