"Assembly Language (3rd edition) Wang Shuang" Test 7 addressing method in the application of the session data access (code + comment)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.