Question: Please write a ASSEMBLY MIPS code ONLY: Bitvise operations allow programmers to perfom many unique actions. As we saw in the lab, bitvise AND is

Please write a ASSEMBLY MIPS code ONLY:

Bitvise operations allow programmers to perfom many unique actions. As we saw in the lab, bitvise AND is useful for bitmasks. Bitvise XOR is useful to see the bit difference between two binary integers. In this part, the program will perform XOR transformations on the number representations from Part 2. 17. XOR the original user entered 2's complement integer (which you saved) with the l's complement bit representation from part 2A 18. Print the binary representation of the result of the XOR followed by the number of bits which are set to 1 in the XOR'd result on its own line. How do I count the number of l's in a representation? There are multiple approaches which can be used. One approach is divide the value by 2 and sum up the remainder Altematively, use a bitmask the L$B, count the result, then shift the value right. 19. Repeat 17-18 for the original 2's complement value XORd with the signed magnitude representation. 20. Teminate the program with syscall 10.

START CODE:

.globl main

.data str_prompt: .asciiz "Enter a ASCII string (max 8 characters): " int_prompt: .asciiz "Enter an integer in range +/- 2^16: " int_badinput: .asciiz "Bad Input! " .align 2 inputString: # additional label refering to the same address as 1stChar Char1: .space 1 Char2: .space 1 Char3: .space 1 Char4: .space 1 Char5: .space 1 Char6: .space 1 Char7: .space 1 Char8: .space 1 forNewline: .space 1 forNull: .space 1

.text

main: # Your code goes here

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!