Question: 1.) a.) Using the simplified instruction set shown for part b, write code for the following. Suppose memory locations 1400 to 1449 contain 16-bit words.

1.)

a.) Using the simplified instruction set shown for part b, write code for the following. Suppose memory locations 1400 to 1449 contain 16-bit words. Each word represents 2 ASCII characters. Write code to read in and write out these 100 characters. Left-side character from location 1400 should be first, right-side character from location 1400 should be second, and remaining characters follow in numeric order. Assume you have access to 4 registers: R1, R2, R3, R4. Each register holds one word (16 bits). Number the lines of your operations starting with 1.

b.) In the following table, place Xs in columns to indicate the addressing mode(s) used for each instruction.

Operation Name

Description

Immediate

Direct

Indirect

Register

Register Indirect

Displacement

Stack

MOVE X,K

Move constant K to register X

LOAD X,Y

Move contents at address contained in register Y to register X

STORE A,X

Store contents at register X to address A

CLEAR X

Transfer word of 0s to register X

SET X

Transfer word of 1s to register X

PUSH X

Transfer contents of register X to top of stack*

POP X

Transfer contents of top of stack to register X*

ADD X,Y

Replace contents of X with X + Y (contents)

SUB X,Y

Replace contents of X with X - Y (contents)

MULT X,Y

Replace contents of X with X * Y (contents)

DIVIDE X,Y

Replace contents of X with X / Y (contents)

ABS X

Replace contents of X with |X| (contents)

NEG X

Replace contents of X with -X (contents)

INCR X

Replace contents of X with X + 1 (contents)

DECR X

Replace contents of X with X +-1 (contents)

AND X,Y

Replace contents of X with bitwise AND of X and Y (contents)

OR X,Y

Replace contents of X with bitwise OR of X and Y (contents)

NOT X

Replace contents of X with bitwise negation of X (contents)

XOR X,Y

Replace contents of X with bitwise XOR of X and Y (contents)

LSHIFTR X,K

Replace contents of X with logical shift right of X (contents) by K bits

LSHIFTL X,K

Replace contents of X with logical shift left of X (contents) by K bits

ASHIFTR X,K

Replace contents of X with arithmetic shift right of X (contents) by K bits

ASHIFTL X,K

Replace contents of X with arithmetic shift left of X (contents) by K bits

ROTR X,K

Replace contents of X with rotate right of X (contents) by K bits

ROTL X,K

Replace contents of X with rotate left of X (contents) by K bits

UBRANCH K

Unconditionally branch to instruction on line K (K is a constant)

CZBRANCH K,X

Conditionally branch to instruction on line K (K is a constant) if X=0 (contents)

INPUT X

Fill contents of X with data from I/O processor

OUTPUT X

Send contents of X to I/O processor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!