Search code examples
assemblyx86outputdosfasm

How to output symbol in Assembly Language?


I'm new to assembly language and based on my understanding to perform a task there is a specific combination of interupt and mov (ex. int21h/ah=39h is for making directory). What I wan't to know is how do you output '#' with a specific color and how many of them is to be printed out instead of doing it 1 by 1, also what is next line in assembly language? we need to make an image using '#' symbol. thanks


Solution

  • To output a number of identical characters having a certain color use video BIOS function 09h.

                                 Example
    mov cx, ...    ;count         6 = '######'
    mov bh, 0
    mov bl, ...    ;color         1Eh = Yellow on Blue
    mov ah, 09h
    mov al, ...    ;character     '#'
    int 10h
    

    next line means that you output a carriage return and a linefeed. For this you use another video BIOS function 0Eh.

    mov bx,0007h
    mov ax,0E0Dh   ;0Dh = carriage return
    int 10h
    mov ax,0E0Ah   ;0Ah = linefeed
    int 10h