Logo 
Search:

Assembly Language Articles

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

To store any five 8-bit numbers and check, if a no. is > 30 then add 10 otherwise add 20

Posted By: Hildegarde Miller     Category: Assembly Language     Views: 2390

To store any five 8-bit numbers and check, if a no. is > 30 then add 10 otherwise add 20.

Code for To store any five 8-bit numbers and check, if a no. is > 30 then add 10 otherwise add 20 in Assembly Language

Data Segment
  arr db 33,45,12,03,01
Data Ends

Code Segment
  Assume cs:code, ds:data
  Begin:
    mov ax, data
    mov ds, ax
    mov es, ax
    mov cx, 5
    lea si, arr
    L1:
       mov ah, 00
       mov al, [si]
       cmp al, 30
       jg Greater
    Not_Greater:
       add al, 20
       mov [si], al
       inc si
       loop L1
    Greater:
       add al, 10
       mov [si], al
       inc si
       loop L1
    Exit:
       mov ax, 4c00h
       int 21h
Code Ends
End Begin
    
  
Share: 



Hildegarde Miller
Hildegarde Miller author of To store any five 8-bit numbers and check, if a no. is > 30 then add 10 otherwise add 20 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!