Feedjit

Articles for you

Tuesday, December 31, 2013

.asm Coal ASM File Assembly Language: To display 4 items of my personal information Assembly Langugae Sir Asim

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
; 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