Wednesday, March 25, 2020

String Manipulation in 8086 Assembly Language | The Easy Way


This program asks user to input any string and then asks number of times it will print is. Then, it break it character wise.
TITLE PUCHTAA 
.MODEL SMALL 
.STACK 100H 
.DATA 
 
    MSG DB 0AH, 0DH, "ENTER YOUR NAME: $" 
    NUMBER DB 0AH, 0DH, "ENTER A DIGITI: $" 
    INNAME DB 20 DUP("?") 
.CODE 
 
    START: 
        MOV AX, @DATA 
        MOV DS, AX 
         
;;------------------------------------------------------------         
         
        LEA SI, INNAME 
         
        LEA DX, MSG 
        MOV AH, 09H 
        INT 21H 
;;------------------------------------------------------------         
        MOV DX, SI 
        MOV AH, 0AH 
        INT 21H  
;;------------------------------------------------------------         
        LEA DX, NUMBER 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
;;------------------------------------------------------------         
        SUB AL, 30H 
        MOV BL, AL 
                  
                              
        MOV SI, 02H 
;;------------------------------------------------------------          
    AGAIN: 
      
        MOV DL, 0AH 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, 0DH 
        MOV AH, 02H 
        INT 21H 
                
     
        XOR BH, BH 
        PUSH BX 
;;------------------------------------------------------------ 
   DAGAIN: 
          
        MOV DL, INNAME+SI 
        MOV AH, 02H 
        INT 21H 
        DEC BL 
        CMP BL, 00H 
         
        JNZ DAGAIN 
;;------------------------------------------------------------         
        POP BX 
        INC SI 
        CMP INNAME+SI, 0DH 
        JNZ AGAIN 
;;------------------------------------------------------------         
         
         
         
         
        MOV AH, 04CH 
        INT 21H 
         
    END START         


Breaking String Character Wise and Manipulation in 8086 Assembly Language

No comments:

Complete Video Tutorials