Write a program to display the current system time using DOS INT 21H, function 2CH.
macro putc c
mov dl, c
mov ah, 2
int 21h
endm
.model small
.data
msg db 10,13,'The current time is:$'
.stack 100
.code
mov ax, @data
mov ds, ax
mov ah, 2ch
int 21h
push dx
mov al,ch
aam
add ax, 3030h
mov bx, ax
putc bh
putc bl
putc ':'
mov al,cl
aam
add ax, 3030h
mov bx, ax
putc bh
putc bl
putc ':'
pop cx
mov al,ch
aam
add ax, 3030h
mov bx, ax
putc bh
putc bl
putc ':'
mov al,cl
aam
add ax, 3030h
mov bx, ax
putc bh
putc bl
mov ah, 4ch
int 21h
end

Session 9 4 alp to display the current system time using dos int 21 h

  • 1.
    Write a programto display the current system time using DOS INT 21H, function 2CH. macro putc c mov dl, c mov ah, 2 int 21h endm .model small .data msg db 10,13,'The current time is:$' .stack 100 .code mov ax, @data mov ds, ax mov ah, 2ch int 21h push dx mov al,ch aam add ax, 3030h mov bx, ax putc bh putc bl putc ':' mov al,cl aam add ax, 3030h mov bx, ax putc bh putc bl putc ':' pop cx mov al,ch aam add ax, 3030h mov bx, ax putc bh putc bl putc ':' mov al,cl aam add ax, 3030h mov bx, ax putc bh putc bl mov ah, 4ch int 21h end