Data Block movement. Move the data of one contiguous storage unit to another contiguous storage unit and find out the number of 0 and display it. (Be aware of the uncertainties in the location of the data blocks when making the process)
1 DATA SEGMENT2ORG $+20H3VA DB'2014001002003004'; Data Block4LEN EQU $-VA; Data block length5 V1 DW VA; source Block first address6V2 DW va+1; destination Block first address7 DATA ENDS8 STACK1 SEGMENT STACK9DW 20H DUP (0)Ten STACK1 ENDS One CODE SEGMENT A assume Cs:code,ds:data,ss:stack1 - Start:mov Ax,data - MOV Ds,ax the MOV bl,30h; set counter (count 0) - MOV Cx,len; set counter (transfer condition) - MOV Si,v1; Si point to source block first address - MOV di,v2;D I point to destination block first address + CMP Si,di; compare two first addresses and choose different modes of delivery - JA J2 +ADD si,len-1 AADD di,len-1 at J1:mov Al,[si] - MOV [Di],al - CMP al,30h - JNE J01 - INC BL - J01:dec SI in DEC DI - DEC CX to JNE J1 + JMP Done - J2:mov Al,[si] the MOV [Di],al * CMP al,30h $ JNE J02Panax Notoginseng INC BL - j02:inc SI the INC DI + DEC CX A JNE J2 theDone:mov AH,2; showing 0 numbers + MOV DL,BL - INT 21H $MOV ah,4ch;returnDOS $ INT 21H - CODE ENDS -END START
View Code
Two modes of transmission correspond to two cases respectively.
Data transfer programs between data blocks