assume CS:CODESG, es:table, ds:datadata segment DB'1975','1976','1977','1978','1979','1980','1981','1982','1983'DB'1984','1985','1986','1987','1988','1989','1990','1991','1992'DB'1993','1994','1995'; 21 year DD -, A,382,1356,2390,8000,16000,24486,50065,97479,140417,197514DD345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000; 21 Divisor DW3,7,9, -, -, -, the, -,476,778,1001,1442,2258,2793,4037,5635,8226DW11542,14430,15257,17800; 21 Divisor data endstable Segment DB +DUP ('Year summ ne??'table ENDSCODESG Segmentstart:; Associate data segment with DS mov Ax,data mov ds,ax; Associate table segment with ES mov ax,table mov es , ax; Use BX to locate the dividend mov bx, -using DI to locate the table mov di,0mov cx, +s:; Copy the date in data to the year in the table mov ax,ds:[bx- -] mov es:[di],ax mov ax,ds:[bx- the] mov es:[di+2],ax; by divisor mov ax,ds:[bx] mov dx,ds:[bx+2]; Division, in addition to the business presence ax in div word ptr ds:[bx+ -]; Copy the quotient into the table??at MOV es:[di+ -],ax; a double word is 4 bytes add bx,4a row in the table is a 16-byte add Di, -Loop s mov ah,4chint +CODESG endsend Start
"Assembly Language (3rd edition) Wang Shuang" Test 7 addressing method in the application of the session data access (code + comment)