Feedjit

Articles for you

Saturday, June 1, 2013

Display Personal Information in Assembly Language .asm file Coal

; Programmed by: SAQIB KHAN
; Purpose: To display 4 items of my personal information
; Date: 27th/april/2012

.model small
.stack 100h
.data
        str db "Name : Saqib Khan $"   ; A string to display
        chr db 65               ; ASCII code of A
        val dw ?                ; Unintialized data item
.code
main:   mov ax, @data           ; Obtain address of data segment
        mov ds, ax              ; Initialize data segment

        lea dx, str             ; Obtain offset address of str
        mov ah, 9h              ; Service # to display a string
        int 21h                 ; Call OS to do the job

        mov dl, 13              ; Place ASCII code of Enter key
        mov ah, 2h              ; Service # to display a char
        int 21h                 ; Call OS to do the operation

        mov dl, 10              ; Place ASCII code of Line feed
        mov ah, 2h              ; Service # to display a char
        int 21h                 ; Call OS to do the operation
       
        mov dl, chr             ; Place ASCII code of char to display
        mov ah, 2h              ; Service # to display a char
        int 21h                 ; Call OS to do the operation

        mov ah, 4ch             ; Service # to terminate a program normally
        int 21h                 ; Call OS to do it
end main

Read More

Articles for you