System Programming
Name : Muhammad Haris Baig
Reg # : 551-FBAS/BSSE/S08
Batch # : BSCS-16
purpose : Check Math DMA Presence
------------------------------------------------------------------
dma.asm
.model small ; what memory model is use
; Code and Data both are separate (up to 64K)
.stack 100h ; 256 bytes are reserved for stack seg
.data
dmaP db "DMA is Present$" ; 15 bytes are reserved for the dmaP
dmaNP db "DMA is not Present$" ; 19 bytes are reserved for the dmaNP
.code
main:
mov ax,@data ; ax points to the start of Data seg
; It will set the register ds
mov ds,ax ; ds is initialized and to point to the data segment
int 11h ; Return a equipment list
; ax contains equipment list
mov cl,9 ; assign 9 to cl reg
shr ax,cl ; Shift-Right upto 9 bits
jc Present ; Conditional jump if carry
mov dx,offset dmaNP ; Get address of dmaNP (DMA Not Present)
mov ah,9h ; service # To print string
int 21h ; Dos interrupt to do this operation
jmp exit ; unconditional jump
Present:
mov dx,offset dmaP ; Get address of dmaP (DMA Not Present)
mov ah,9h ; service # To print string
int 21h ; Dos interrupt to do this operation
jmp exit ; unconditional jump
exit:
mov ax,4ch ; service # to terminate a program
int 21h ; Dos interrupt to do this operation
end main