Questions: 338

Answers by our Experts: 279

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

a) Write an assembly program using MARIE's assembly Instruction set that prompts the user to enter a non-negative integer that is less than 10. The program should include a subroutine that keeps prompting until a valid value is obtained. When a valid number is entered, it will be displayed. (Hint: Use JNS & JUMPI instructions to implement the subroutine) N.B: You should include the MARIE code in your Answer, with an explanation of each instruction in your code beside it (not a screenshot!). Example: Subt One /Subtract 1 from AC Your included code should be ready to be tested by your instructor. b) Add a screenshot of the simulation, showing the result (A screenshot of the MARIE Simulator window after running the program). Instructions: - Use “ORG” instruction to start your program at address equivalent to 25610. - Use your last university ID number to input the value of X. For example, if your ID is1915161678234, then you will use the number 4 as the value of x. -


Suppose that you have a computer with a memory unit of 24 bits per word. In this computer, the assembly program’s instruction set consists of 198 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory.

a. How many bits are needed for the opcode?

b. How many bits are left for the address part of the instruction?

c. How many additional instructions could be added to this instruction set without exceeding the assigned number of bits? Discuss and show your calculations.

d. What is the largest unsigned binary number that the address can hold?


Consider the following instructions

rpt $t2, Label1 # $t2 = $t2 – 1, if($t2 != 0) then PC = PC + 4 + SE(imm)

else PC = PC + 4


a) If we want to add this instruction to the MIPS machine instruction set, select the appropriate template and describe its details.


b) Now instead of adding this instruction, write the shortest piece of code in MIPS which is equivalent to the instruction above.


consider the following program :

void main()

{

int i;

printf(“Please enter an integer: ”);

scanf(%d,&i);

printf(“\n”);

switch(i) {

case 1: printf("I am one.\n"); break;

case 2: printf("I am two.\n"); break;

default: printf("I am neither one, nor two.\n"); }

}

///////////////////////////////////////////////////////////////////////

What you see below is part of the assembly code of the above program. Complete it using MIPS assemby and use “jump address table“ method.

.data

prmt: .asciiz "Please enter an integer: "

nline: .byte '\n'

.text

.globl main

main:

li $v0,4

la $a0,prmt

syscall

li $v0,5

syscall

addi $a0,$v0,0

li $v0,1

syscall

la $t0,nline

li $v0,11

syscall

# place your switch statement's assembly program here

li $v0,10

syscall


The values of $t0 and $t1 are 0xAAFFFFFF and 0x000EF000 respectively. Write a MIPS code that swaps bits 26 to 31 of $t0 with bits 11 to 16 of $t1.


Suppose that you have a computer with a memory unit of 24 bits per word. In this computer, the assembly program’s instruction set consists of 198 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory. a. How many bits are needed for the opcode? b. How many bits are left for the address part of the instruction? c. How many additional instructions could be added to this instruction set without exceeding the assigned number of bits? Discuss and show your calculations. d. What is the largest unsigned binary number that the address can hold?


Write an assembly program using MARIE's assembly Instruction set that prompts the user to enter a non-negative integer that is less than 10. The program should include a subroutine that keeps prompting until a valid value is obtained. When a valid number is entered, it will be displayed. (Hint: Use JNS & JUMPI instructions to implement the subroutine)


characters.asm: Construct an assembly language program that will accept any character then tells whether the entered character is an alphabet, a number, or a special symbol.


Month.asm: Construct an assembly language program that accepts month in number form then displays it in worded form. (Use A for 10, B for 11, and C for 12)

Example:

-                      Enter Month in number form: 6

                       Number 6 month form is June



char.asm: Construct an assembly language program that will accept either an upper case or a lower case letter then shows what the previous and next letter is.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS