[go: up one dir, main page]

0% found this document useful (0 votes)
132 views2 pages

Experiment No 9 Calculations On Memory Locations

This document contains descriptions of several experiments and programs related to memory locations and operations. 1) Experiment 9 tests writing 1s and 0s to RAM addresses 40FFH-40FFH and reading them back, indicating errors by writing to port 10. 2) Programs A-E include arranging an array in descending order, transferring data between memory blocks, finding the square root of a binary number, and splitting a hex value into nibbles. 3) Experiment 10 involves adding 4-digit BCD numbers stored in registers and memory, subtracting a number in E from D, and multiplying two BCD numbers.

Uploaded by

Manoj Kavedia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views2 pages

Experiment No 9 Calculations On Memory Locations

This document contains descriptions of several experiments and programs related to memory locations and operations. 1) Experiment 9 tests writing 1s and 0s to RAM addresses 40FFH-40FFH and reading them back, indicating errors by writing to port 10. 2) Programs A-E include arranging an array in descending order, transferring data between memory blocks, finding the square root of a binary number, and splitting a hex value into nibbles. 3) Experiment 10 involves adding 4-digit BCD numbers stored in registers and memory, subtracting a number in E from D, and multiplying two BCD numbers.

Uploaded by

Manoj Kavedia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Experiment No 9 Calculations on memory locations.

Program A To test RAM by writing '1' and reading it back and later writing '0'
(zero) and reading it back. RAM addresses to be checked are 40FFH to
40FFH. In case of any error, it is indicated by writing 01H at port 10

Program B Arrange an array of 8 bit unsigned no in descending order

Opcode
Memory
(Hex Label Mnemonics Operand Comments
Address
Code)

START:MVI B, 00 ; Flag = 0
LXI H, 4150 ; Count = length of array
MOV C, M
DCR C ; No. of pair = count -1
INX H ; Point to start of array
LOOP:MOV A, M ; Get kth element
INX H
CMP M ; Compare to (K+1) th element
JNC LOOP 1 ; No interchange if kth >= (k+1) th
MOV D, M ; Interchange if out of order
MOV M, A ;
DCR H
MOV M, D
INX H
MVI B, 01H ; Flag=1
LOOP 1:DCR C ; count down
JNZ LOOP ;
DCR B ; is flag = 1?
JZ START ; do another sort, if yes
HLT ; If flag = 0, step execution

Program C Transfer ten bytes of data from one memory to another memory block.
Source memory block starts from memory location 2200H where as
destination memory block starts from memory location 2300H

Program D Write a program to find the Square Root of an 8 bit binary number. The
binary number is stored in memory location 4200H and store the square
root in 4201H

Program E Write a simple program to Split a HEX data into two nibbles and store
it in memory

Experiment No 10 Operations on BCD numbers.

Program A Add two 4 digit BCD numbers in HL and DE register pairs and store result
in memory locations, 2300H and 2301H. Ignore carry after 16 bit.

Program B Subtract the BCD number stored in E register from the number stored in
the D register

Program C Write an assembly language program to multiply 2 BCD numbers

You might also like