|

CyberSlug Rules!
Classes
Class
Syllabus
Grading Policy
Labs
Interact
Login
-
enter system
-
get attendance
-
submit work
-
take lab quiz
-
check scores
Help
Help me!
Links
Staff only
Datacare Ahshay
| |
Machine Language and instruction codes
Machine language:
- Is the only language a computer can understand
- It is extremely simple, but very tricky for humans
- Each computer type may have a different machine language
- In the computer memory, there is no difference between a number or an instruction code.
They all look the same.
Example: The slug computer
- Each memory location can accomodate 4 digits ( plus sign)
- First two digits - may represent an instruction code
- Next two digits - may represent an address in memory
- In the above example the code is: 03, the address is 29
Practice with the slug computer
OP codes for the slug computer
| OP code |
Operation |
| 0 |
NOP - next instruction |
| 1 |
Load accumulator |
| 2 |
Store accumulator to memory |
| 3 |
Add memory to accumulator |
| 4 |
Subtract memory from accumulator |
| 5 |
Multiply memory by accumulator |
| 6 |
Divide accumulator by memory |
| 7 |
Jump unconditionally |
| 8 |
Jump if ACC <=0 |
| 9 |
Input value |
| 10 |
Output (display) value |
| 99 |
Stop |
| any other |
NOP |
|