Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

To divide 10 8-bit data in an array by 20 and store the result in another array, first quotient and then remainder

Posted By: Barrett Schmidt     Category: Assembly Language     Views: 3539

To divide 10 8-bit data in an array by 20 and store the result in another array, first quotient and then remainder.

Code for To divide 10 8-bit data in an array by 20 and store the result in another array, first quotient and then remainder in Assembly Language

Data Segment
  arr1 db 20,30,40,50,60,70,80,90,100,110,120
  number db 20
  arr2 db 20 dup(?)
Data Ends

Code Segment
  Assume cs:code, ds:data
  Begin:
    mov ax, data
    mov ds, ax
    mov es, ax
    mov cx, 10    
    lea si, arr1
    lea di, arr2
    L1:
       mov al, [si]
       mov ah, 00
       div number
       mov [di], al
       inc di
       mov [di], ah
       inc di
       inc si
       loop L1

    Exit:
       mov ax, 4c00h
       int 21h
Code Ends
End Begin
  
Share: 



Barrett Schmidt
Barrett Schmidt author of To divide 10 8-bit data in an array by 20 and store the result in another array, first quotient and then remainder is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Assembly Language:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!