Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Go INP 9. Translate the following assembly program into machineSUB SUB VAL JZR BYE JMP GO language. Check with Super Simple CPU Instructions Set. BYE

image text in transcribed
image text in transcribed
image text in transcribed
Go INP 9. Translate the following assembly program into machineSUB SUB VAL JZR BYE JMP GO language. Check with Super Simple CPU Instructions Set. BYE STP VAL | DAT : 21 Binary Opcode Description 1111 STP this stops the computer, no more fetch/decode/execute cycles until you reset. 0001 ADD fetch a number from memory and add it to the contents of the accumulator, replacing the value in the accumulator. E.g. 0001000000001111-get the value at memory location 15 and add that to accumulator 0010 SUB just like ADD, only subtract. 9011 LOD fetch a number from memory and store it into the accumulator, replacing its old value. E.g. 0011000000001111-get the value at memory location 15 and store that value into the accumulator 0100 LDI load immediate; the value (data) to be put into the accumulator is the operand (the rightmost 12 bits of the instruction); do not go to memory like LOD E.g. 0100000000001111 0101 STO store the accumulator's value into memory at the indicated location E.g. 0101000000001111 -store the accumulator's value into memory location 15 Binary Opcode Description 0110 0111 1000 INP ask the user for one number and store that into the accumulator OUT send the value in the accumulator to the output area. JMP jump to the instruction at the indicated memory address. E.g. 1000000000001111 put the value 15 into the PC which will cause the next instruction to be taken from location 15 of memory 1001 JNG jump to the instruction at the indicated memory location if the accumulator's value is negative; otherwise just add 1 to the PC. E.g. 1001000000001111put the value 15 into the PC if accumulator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions

Question

explain the concept of strategy formulation

Answered: 1 week ago