0 penilaian0% menganggap dokumen ini bermanfaat (0 suara)
140 tayangan2 halaman
1) The document describes a program that moves a block of data from one memory location to another without overlap.
2) The program loads the effective addresses of the source and destination locations, loads a counter value, then moves data from source to destination by incrementing the addresses and decrementing the counter until it reaches zero.
3) The output shows the memory contents before and after program execution, confirming the block of data was transferred from the source to destination location without overlap.
1) The document describes a program that moves a block of data from one memory location to another without overlap.
2) The program loads the effective addresses of the source and destination locations, loads a counter value, then moves data from source to destination by incrementing the addresses and decrementing the counter until it reaches zero.
3) The output shows the memory contents before and after program execution, confirming the block of data was transferred from the source to destination location without overlap.
1) The document describes a program that moves a block of data from one memory location to another without overlap.
2) The program loads the effective addresses of the source and destination locations, loads a counter value, then moves data from source to destination by incrementing the addresses and decrementing the counter until it reaches zero.
3) The output shows the memory contents before and after program execution, confirming the block of data was transferred from the source to destination location without overlap.
Sambhram Institute of Technology, Department of ECE 1 | P a g e
Program No: 02 (a) BLOCK DATA TRANSFER WITHOUT OVERLAP
AIM: To write and execute an ALP to move a block of data from location-1 to location-2 without overlap of data.
ASSUMPTIONS: BEFOR EXECUTION AFTER EXECUTION Address content Address content
PROGRAM:
.MODEL SMALL ;few locations of cs & ds are reserved .DATA ;access ds to store data X DB 46H, 28H, 16H, 20H, 68H Y DB 10 DUP(?) .CODE ;access cs to store program code MOV AX, @DATA ;initialization of ds MOV DS, AX ;i.e. load base address of data to ds LEA SI, X ;load effective address of source LEA DI, Y ;load effective address of destination MOV CX, 0004H ;load the counter LOC1:MOV AX, [SI] ;read data from source through address pointed by si MOV [DI], AX ;write the data to destination through address pointed by di INC SI ;increment si INC DI ;increment di DEC CX ;decrement counter JNZ LOC1 ;jump to loc1 if counter is not zero MOV AH, 4CH ;terminate program INT 21H ;processor is interrupted END ;end of .model small
1000H 46 1001H 28 1002H 16 1003H 20 1004H 68 1005H 46 1006H 28 1007H 16 1008H 20 1009H 68 1000H 46 1001H 28 1002H 16 1003H 20 1004H 68 1005H 00 1006H 00 1007H 00 1008H 00 1009H 00 Microprocessor Lab 10ECL68 Sambhram Institute of Technology, Department of ECE 2 | P a g e
ALGORITHM:
1) Load the effective address of source into si and effective address of destination into di(load value of di such that NO overlap of data occurs). 2) Load the count value into cx. 3) Move the data from source to destination memory location through ax involving si & di. 4) Increment both si & di, decrement cx and repeat step 3 till cx becomes zero.