Posts

Showing posts from September, 2021

ADDITION

Image
  GIVEN TWO DATA STORED AT MEMORY LOCATION x AND x+1. PERFORM ADDITION ON m(x) AND m(x+1) AND STORE THE RESULT AT LOCATION x+2. THEORY :       The first 8 bit data is brought to the accumulator A from the memory location and the second 8-bit data is also brought from another memory location to B. The addition is done using ADD. The result is sorted in the desired location(2002). The addition (ADD) instruction affects flags depending on the result. ALGORITHM : Step 1: LXI H,2000h, to load the address in H-L register pair using LXI H from 16-bit location 2000h.Step 2: MOV A, M to move the value of 2000h memory address value into the accumulator.Step 3: INX H, to increase the value of the H-L register pair to get the next memory location.Step 4: MOV B, M to move the value of the 2001h memory location to register B.Step 5: INX H, done to the H-L pair of the register will be increased and pointed to store the addition result.Step 6: ADD B, for we need to perform addition with th

FIFO PAGE REPLACEMENT

Image
  In this "FIFO PAGE REPLACEMENT ALGORITHM" covers FIFO page replacement technique with example and FIFO page replacement Program with Input-Output. In Memory Management , Paging is a technique by which a computer can store and retrieve data from secondary storage for use in main memory. To do page replacement there are some page replacement algorithms. Page replacement algorithms are able to decide which page needed to be replaced when new page comes in. Whenever a new page is referred and not present in memory, page fault occurs and Operating System replaces one of the existing pages with newly needed page. Different page replacement algorithms suggest different ways to decide which page to replace. The target for all algorithms is to reduce number of page faults. First In First Out (FIFO) Page Replacement Algorithm – In this simplest page replacement algorithm, operating system keeps track of all pages in the memory in a queue, oldest page is in the front

MEMORY MANAGEMENT NOTE

Image
  In this "MEMORY MANAGEMENT NOTE" tutorial, Memory Management Introduction, Memory Hierachy, Memory Address, Physical and Logical address, MMU, Memory Management Unit, Address Translation, Symbolic and Relative address, Static and Dynamic binding, Memory Allocation, Single-Partition, Multiple partition, fragmentation, Internal fragmentation, External fragmentation, Swapping, Paging and Demand paging, Segmentation, Thrashing, and Compaction related notes are covered. Memory Management is the easiest part of the Operating System or in a Computer Architecture. Keep in mind that, Mainly, 3 items are there. No.1 is Processor(CPU), No.2 is RAM(main memory), No3. is Hard disk(secondary memory). Memory Management means managing data, process or program between main memory and disk during execution. Data, Process or Program has some space occupied in disk, or main memory. Thus, Memory management keeps a record of each and every memory location, regardless of either it is allocate

SUBTRACTION

Image
  GIVEN TWO DATA STORED AT MEMORY LOCATION x AND x+1. PERFORM SUBTRACTION ON m(x) AND m(x+1) AND STORE THE RESULT AT LOCATION x+2. THEORY :  In 8085 microprocessor, The SUB instruction is used for 2's complemented method for subtraction. When the first operand is larger then the result will be positive i.e. not enable the carry flag. But When the result will be negative then the result will be 2's complemented form and the carry flag will be enabled. ALGORITHM : Step 1: LXI H,2000h, to load the address in H-L register pair using LXI H from 16-bit location 2000h. Step 2: MOV A, M to move the value of 2000h memory address value into the accumulator. Step 3: INX H, to increase the value of the H-L register pair to get the next memory location. Step 4: MOV B, M to move the value of the 2001h memory location to register B. Step 5: INX H, done to the H-L pair of the register will be increased and pointed to store the subtraction result. Step 6: SUB

SWAP THE CONTENT

Image
GIVEN TWO DATA STORED AT MEMORY LOCATION x AND x+1. SWAP THE CONTENT OF M(x) AND M(x+1). THEORY :  In 8085 microprocessor, firstly we take two 8-bit numbers from the user and store it in different memory locations m(x) and m(x+1) respectively. Let, m(x) is 2000h and m(x+1) is 2001h. The SWAP operation will be done with the memory locations, registers, and the accumulator respectively.  ALGORITHM : Step 1: LXI H,2000h; to load the address in H-L register pair using LXI H from 16-bit location 2000h. Step 2: MOV A, M; to move the value of 2000h memory address value into the accumulator. Step 3: INX H; to increase the value of the H-L register pair to get the next memory location. Step 4: MOV B, M; to move the value of the 2001h memory location to register B. Step 5: MOV C, A; to store the value of accumulator into the C register. Step 6: MOV B, A; to store the accumulator value into the B register. Step 7: MOV B, C; to store the C register valu

MULTIPLY WITHOUT CARRY

Image
  To MULTIPLY TWO 8-BIT NUMBERS WITHOUT CARRY MP 8085A we use repetitive addition, here we can not consider CARRY, Thus Output size is 8 bit. WRITE 8085 ASSEMBLY LANGUAGE PROGRAM TO MULTIPLY TWO 8-BIT NUMBERS STORED IN MEMORY LOCATION AND STORE THE 16-BIT RESULTS INTO THE MEMORY WITHOUT CARRY. In Maths, Large Number multiplication shortcut trick THEORY :  In 8085 microprocessor, there is no multiplication operation. To get the result of multiplication, we should use the repetitive addition method. After multiplying (repetitive addition) two 8bit numbers are store in the next memory location. We are saving the data at location 2000h and 2001h. The resultant value will be stored at the location in 2002h. ALGORITHM : Step 1: LXI H,2000h, to load the address in H-L register pair using LXI H from 16-bit location 2000h. Step 2: MOV B, M to move the value of 2000h memory address value into the register B. Step 3: INX H, to increase the value of the H-L register

MULTIPLY

  In 8085 mp there is no multiplication operation. To MULTIPLY TWO 8 BIT NUMBERS STORED IN MEMORY LOCATION we use repetative addition operation WRITE 8085 ASSEMBLY LANGUAGE PROGRAM TO MULTIPLY TWO 8 BIT NUMBERS STORED IN MEMORY LOCATION AND STORE THE 16 BIT RESULT INTO THE MEMORY WITH CARRY. THEORY :       In 8085 microprocessor, there is no multiplication operation. To get the result of multiplication, we should use the repetitive addition method. It has dedicated arithmetic instruction for addition, subtraction, increment, and decrement. If we want to perform a multiplication operation then we need a program for doing the repeated addition. ALGORITHM : Step 1: LXI H,2000h, to load the address in H-L register pair using LXI H from 16-bit location 2000h. Step 2: MOV B, M to move the value of 2000h memory address value into the register B. Step 3: INX H, to increase the value of the H-L register pair to get the next memory location. Step 4: MOV C, M to mo

COPY DATA

Image
  WRITE A 8085 ASSEMBLY LANGUAGE PROGRAM TO COPY DATA FROM ONE 16 BIT LOCATION TO ANOTHER LOCATION AND THE VALUE WILL STORED INTO ANOTHER MEMORY LOCATION. DATA COPY FROM ONE LOCATION TO ANOTHER THEORY :        In the 8085 microprocessor, We will perform the data copy operation. To copy we need one memory address with a defined 8-bit value and another memory location to store that value. ALGORITHM : Step 1: MVI H,0Ah; to load the value in register H, it is used to store iteration value. Step 2: LXI B,2000h; to point source memory location, register pair B-C is initialized. Step 3: LXI D,2100h; to point destination memory location, register pair D-E is initialized. Step 4: LDAX B; to load the accumulator from the memory location pointed by B-C register pair. Step 5: STAX D; to store the accumulator content into the memory location pointed by D-E register pair. Step 6: INX B; to increment the value by 1 for the B-C register pair. Step 7: INX D; 

SUM OF SERIES

Image
CALCULATE THE SUM OF SERIES OF NUMBERS WITH CARRY  THEORY :  In 8085 microprocessor, In this program, we perform addition for 'n' numbers. Where we define the total no's to be added. All the values will be added with the accumulator. And this problem we have a new carry flag to enable the carry where we can see 16-bit resultant value. fig: Binary Addition Table ALGORITHM : Step 1: LXI H,2000h; to load the address in H-L register pair using LXI H from 16-bit location 2000h. Step 2: MOV C, M; to move the value of 2000h memory address value into the C register. Step 3: XRA A; to perform XOR operation. Step 4: MOV D, A; to move the accumulator value to D register. Step 5: INX H; to increase the value of the H-L register pair to get the next memory location. Step 6: ADD M; to add memory location value with accumulator. Step 7: JNC ; Jump on non-carry on INR D step 8. Step 8: INR D; Increment register by 1 for D register. Step