Question

Write a piece of assembly code in SimpleRisc to find out if a number is a...

Write a piece of assembly code in SimpleRisc to find out if a number is a Factorian
number or Dudeney number. Save 1 in r1 if it is a Factorian number; otherwise,
save 0. Save 1 in r2 if it is a Dudeney number; otherwise, save 0. You have to write
a single program to test both these conditions.

Homework Answers

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
PLEASE COMMENT CODE AND TEST THAT IT WORKS: Write a assembly program to find the largest...
PLEASE COMMENT CODE AND TEST THAT IT WORKS: Write a assembly program to find the largest item in an array and store it in a AX. Hint: Use both Jump and loop instruction to write the program. logic: Assume that the first item of the array is the minimum and store it in AX Write a loop. Inside the loop, compare the each array item with the AX If the array item is less than the AX, update AX with...
Write a Hack Assembly Language program to calculate the quotient from a division operation. The values...
Write a Hack Assembly Language program to calculate the quotient from a division operation. The values of dividend a and divisor b are stored in RAM[0] (R0) and RAM[1] (R1), respectively. The dividend a is a non-negative integer, and the divisor b is a positive integer. Store the quotient in RAM[2] (R2). Ignore the remainder. Example: if you are given two numbers 15 and 4 as dividend a (R0) and divisor b (R1), respectively, the answer will be 3 stored...
Write a piece of code to find the number of zeros in each byte of an...
Write a piece of code to find the number of zeros in each byte of an array of size 1024 byte stored at addresses starting at 21000H. Store the result of each byte in another array starting at 56000H.
Write the Assembly Code for PIC16F84A microcontroller to read a switch connected to Bit 2 of...
Write the Assembly Code for PIC16F84A microcontroller to read a switch connected to Bit 2 of PORTB. You will need to first set the pin to an input, then test whether the pin is 0 ( switch closed, if so go to existing program at label SWITCH If not the program is to continue: Add comments to each line to explain what the code does.
Write and test code in MIPS assembly language program to implement algorithms "The Non-Restoring Algorithm "of...
Write and test code in MIPS assembly language program to implement algorithms "The Non-Restoring Algorithm "of an 8-bit integer the user shoud insert the number then by the algo well find the square root
Please complete in MASM (x86 assembly language). Use the code below to get started. Write a...
Please complete in MASM (x86 assembly language). Use the code below to get started. Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). .386 .model flat,stdcall .stack 4096 ExitProcess PROTO,dwExitCode:DWORD .data    ; define your variables here .code main PROC    ; write your assembly code here    INVOKE ExitProcess,0 main...
Write an ARM assembly language program that counts the number of 1’s for any value in...
Write an ARM assembly language program that counts the number of 1’s for any value in R0. The program must assemble/compile in KEIL and must be able to run in the KEIL simulator. Generally, R0 may contain any value, but for purpose of this exercise, you may move 0x2345ABCD into R0. The number in R0 does not need be preserved. You may use any other registers as you need. The result, total count of 1’s in R0, should be in...
In Assembly x86 please Write an assembly program(call it lab6_file1.asm)that contains 10 double words in memory...
In Assembly x86 please Write an assembly program(call it lab6_file1.asm)that contains 10 double words in memory in the .data section where the first five initialized to 0 and the last five are initialized to 1. In addition, reserve ten uninitialized double words in .bss section. Using a loop, write an assembly program that copies the ten initialized values into the ten reserved double words, starting at the last position, moving to the first(reverse order the data in your uninitialized array)....
IV.Translate the following C code fragment to ARM assembly instructions. Assume t, x, y, and z...
IV.Translate the following C code fragment to ARM assembly instructions. Assume t, x, y, and z are stored in registers r0, r1, r2, and r3. unsigned int x, y, z, t; do { x = x + 1; z = t + (z << 1); y = y - x; } while (y != x); V. What does the following sequence of instructions do? Why? RSB r2, r3, r3, LSL #4 RSB r2, r2, r2, LSL #3 VI. Write a...
Write an LC-3 program (machine code) that compares the two numbers located in x3600 and x3601...
Write an LC-3 program (machine code) that compares the two numbers located in x3600 and x3601 and puts the value 0 in R1 if the two numbers are equal, 1 if the first number is larger than the second number, and -1 if the first number is smaller than the second number.