Wednesday, 17 June 2015

Display The Entire IBM Character Set In Assembly Language Solution.

// To get an idea of how the jump instruction  work, we will write a program to display the ebtire IBM character set.
/*
    *
    * Prosen Ghosh
    * American International University - Bangladesh (AIUB)
    *
*/

Solution:

.MODEL SMALL
.STACK 100H
.DATA

.CODE

MAIN PROC
 
    MOV AX,@DATA        ;
    MOV DS,AX           ;data set
 
    MOV AH,2            ;display character function
    MOV CX,256        ;256 character to display
    MOV DL,0            ;DL has ASCII code of null character( 0 = null)
 
    PRINTLOOP:
        INT 21H                ;instruction to display
        INC DL                 ;increment DL ASCII code by 1
        DEC CX                ;decrement CX counter by 1
        JNZ PRINTLOOP   ;JNZ = Jump if not zero.if CX not zero than it's jump to the PRINTLOOP
     
        MOV AH,4CH
        INT 21H
     
    MAIN ENDP
END MAIN

No comments:

Post a Comment