Construct a program using assembly language to perform the addition of two values - the first value; 4AH stored in register B and the second value; 36H stored in register D. The result of the addition is then stored in memory location 0x2020. Include comments to each instruction line of the program.
Program:
LDA B // load the content of register B i.e. 4AH to accumulator
MOV R1,A // move the data from accumulator to register R1
LDA D //load the content of register D i.e. 36H to accumulator
ADD R1 // add the data of register R1 and accumulator and result store in accumulator
STA 0x2020H // store the data at memory location 0x2020H which is stored in accumulator
Construct a program using assembly language to perform the addition of two values - the first...
Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...
Machine Language 2. (4pts) Consider the following assembly language instruction which is located in a program you wrote: MULTIPLY contents of Register 5 with the constant 6. This instruction will store the results back into Register 5. Assume this machine instruction is part of an assembly program that is stored on your hard disk and it is the next instruction to be invoked. Explain how this instruction is processed using the machine cycle. Include hard drive, de, and registers in...
this is assembly language for HCS12 / 9S12 4. Consider the following assembly-language program. Starting values: [A] = $60, [B] = $80, [$C300] = $20, [$C301] = $40 (Hint: [$C300) means "contents of memory location $C300".) $C300 $C301 ADDA LDAB SBA BEO STAA STAB WAI X1 $1301 $C300 X1: ; "WAI" basically means "stop" What values are in A, B, memory location $C300, and memory location $C301 when the program finishes? [A] = — [B]= _ [$C300] = - [$C301)...
Write a program in assembly language that loads register R2 with the word in memory location which is 10 bytes above the address in R0; and loads register R3 with the word in memory location which is 10 bytes below the address in R1. Your program must compare the two numbers in R2 and R3. If number in R2 is less than or equal to the number in R3 it must add the two numbers and save the result in...
Convert the following assembly language program into a C program: *Update: The variables are initialized, in lines 4 & 6 of the red assembly language code. Convert the following assembly language program into a C program: *Update: The variables are initialized, in lines 4 & 6 of the red assembly language code. include "p24Hxxxx.inc" global__reset bss: Uninitialized data section: Variables start at location 0x0800 x: .space 2: Allocating space (two bytes) to variable. y: .space 2;Allocating space (two bytes) to...
Using the MARIE computer assembly language, write a program that computes the following expression: z = a * b * c. The computer will read in the input values a, b, and c from the keyboard and the final result (z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Remember that the instruction set does not have an instruction to execute multiplication. The program must be tested...
Using Assembly Language (MIPS), design a program calculator that can perform the following: Addition, Subtraction, Multiplication, Division, Power and Square Root Functions. Code must be able to accept floating point as well.
Determine the output of the following machine-language program by running it in Pep/8. The left column in each part is the memory address of the first byte on the line. Determine the output of the following machine-language program by running it in Pep/8. The left column in each part is the memory address f the first byte on the line: Address Instruction Description C10000C 18 F1000B 51000B 0003 0004 0007 000A 000B 000C FEDC A. Submit the code with comments...
ARM assembly language Write a program "fibonacci.s" that computes the Nth Fibonacci number where N is not so large that overflow of integer arithmetic is a concern. When your assembly language program is called it should expect the value of N to be passed using register r0 and your program should return the Nth Fibonacci number in register r0. Please include comments as well. Do not just use the output generated by gcc -S
Write an assembly language program (using MC6800 instruction set) which will do the following: We are going to add two numbers 0x4AC0EA (addend) and 0x661B93 (augend). The three byte addend is to be stored in locations $0100 through $0102 while the augend is to be stored in locations $0103 through $0105. The three byte result must be stored in locations $0106 through $0108.