Logo 
Search:

Assembly Language Articles

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

PROGRAM TO ADD A CONSTANT TO EACH ELEMENT OF AN ARRAY

Posted By: James Evans     Category: Assembly Language     Views: 6382

WRITE A PROGRAM TO ADD A CONSTANT TO EACH ELEMENT OF AN ARRAY.

Code for PROGRAM TO ADD A CONSTANT TO EACH ELEMENT OF AN ARRAY in Assembly Language

DATA SEGMENT
A DB 1,2,3,4,5
DATA ENDS
CODE SEGMENT
         ASSUME DS:DATA,CS:CODE
START:
      MOV AX,DATA
      MOV DS,AX
      MOV AH,00
      MOV CL,05
      LEA BX,A
  L1: ADD BYTE PTR[BX],02
      MOV AL,BYTE PTR[BX]
      INC BX
      DEC CL
      CMP CL,00
      JNZ L1
      MOV AH,4CH
      INT 21
CODE ENDS
END START

;OUTPUT:->
;-G CS: 0019
;
;AX=0007  BX=0005  CX=0000  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0019   NV UP EI PL ZR NA PE NC
;0BA9:0019 B44C          MOV     AH,4C
;-D DS: 0000 L5
;0BA8:0000  03 04 05 06 07       
  
Share: 


Didn't find what you were looking for? Find more on PROGRAM TO ADD A CONSTANT TO EACH ELEMENT OF AN ARRAY Or get search suggestion and latest updates.

James Evans
James Evans author of PROGRAM TO ADD A CONSTANT TO EACH ELEMENT OF AN ARRAY is from London, United Kingdom.
 
View All Articles

 
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!