Microprocessor
assmebly language and c
Algorithm:
Step 1: Point HL register pair to memory location 0150H (indirect addressing)
Step 2: Set up a decrement counter, say C from 0AH (for 10 data)
Step 3: Load Accumulator with 00H to clear content
Step 4: Move content of memory location to register B
Step 5: Add B with Accumulator (A) and store to A. (ADD command)
Step 6: Increase memory location by one (post increment)
Step 7: Decrease C counter by one
Step 8: Until C is not equal to 0 repeat program control from Step 4:
Step 9: Store content of Accumulator to memory location 0200H (direct addressing)
Step 10: Terminate the program
Code:
LXI H, 0150H ; HL register pair points at memory location 0150H
MVI C, 0A H ; Sets up a decrement counter
MVI A, 00H ; Clears Accumulator
Jump: MOV B, M ; Moves content of memory location to B
ADD B ; Adds A and B and stores result at A
INX H ; HL pair points at M+1 memory location
DCR C ; Decreases C counter by one
JNZ Jump: ; Until C is not control jumps to jump1:
STA 0200H ; Stores result at 0200H (when C=0)
HLT
Microprocessor assmebly language and c Write a program to add 10 byte-wide values stored in SRAM...
Please answer the list questions above with explanation. Thank
you
LOAD-STORE PROGRAM EXAMPLE Write an Assembly program to add two 8-bit numbers. C A+B lds r16, A lds rl7, B : 1. Load variables add E16, :172 Do something 2. Do something sts C, r16 : 3. Store answer Identify the operation, source operand, destination operand in the first Data Transfer insiruction. Identify the source/destination operand in the Arithmetic and Logic (ALU) instruction. .What addressing mode is used by the...
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.
For questions 3-4, provide the full MARIE RTN (register transfer notation) for these new MARIE operations. Your answer should include the fetch, decode, operand fetch (if necessary), execution and store result (if necessary) stages. When you see X in these instructions, this is a main memory address (the last 12 bits of the 16-bit instruction) – refer to this as IR[11..0) and not X in your RTN. 3) AutoIncrLoad X - the autoincrement addressing mode is used to access a...
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.
(f) and (g) please
f and g please
letters Question 2 Indirect addressing mode in assembly language is sanilar to pointers in C. Answer the following questions: (1 point) a) How many 8-bit registers can a FSR access in the PICI8F452 MCU? b) Write the assembly language command to load the address of the variable with name: PVal into one of the FSR? (2 points) (2 points) (2 points) c) What is the meaning of: movf PREINC2, F? d) What...
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...
Write a program using PIC24 instructions yo add three 8-bit numbers stored in the successive memory locations starting from 0x0800. Store the result in the memory lpcation 0x0855.
Write a program using the LOOP instruction to sum all the even numbers from 20H to 80H. Write a program using the ADC (or add with carry) instruction to add these two 48 bit numbers. Assume the first number is store at an address starting 400H and that the second number is stored at an address starting at address 500H. Store the results in memory starting at address 600H. (Note that each number consists of three 16 bit words). Show...
Complete the following Intel assembly language program which determines whether the byte sized operand stored in memory location 'number' is prime or not. The program will write the value of 0 into the memory location 'answer' if the number is not prime, otherwise the initial value of '1' will be left unmodified (indicating that the number is prime). The program makes use of the DIV instruction to determine the value of quotient and remainder when dividing the number by 2,3,4,......
Write a
program that will add two numbers stored in memory (you can write
any values in any section of memory you like). Subtracts 2 from
that number, then displays the result to the screen before moving
the result to memory for long term storage.
Include
memory map, instructions and a data example to show that it
works.
Create
this by using the following list of instruction