0% found this document useful (0 votes)
114 views3 pages

Assembly Code For Intel 8086 Yearly Calendar

This program designs an Intel 8086 program to display a yearly calendar. It gets the current date and time from the system, displays it on screen with prompts, and allows the user to repeatedly get the date or time by entering commands or quit by entering another command. It uses INT 21h to display output and get keyboard input, stores the date, time, and command in variables, and has subroutines to display the date, time, and new lines on screen.

Uploaded by

kahurlex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views3 pages

Assembly Code For Intel 8086 Yearly Calendar

This program designs an Intel 8086 program to display a yearly calendar. It gets the current date and time from the system, displays it on screen with prompts, and allows the user to repeatedly get the date or time by entering commands or quit by entering another command. It uses INT 21h to display output and get keyboard input, stores the date, time, and command in variables, and has subroutines to display the date, time, and new lines on screen.

Uploaded by

kahurlex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment One

Group8
Design an Intel 8086 program based yearly calendar.
.model small

.data
month_lengths db 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
month_header db "Sun Mon Tue Wed Thu Fri Sat$"
linefeed db 13, 10, "$"
command_prompt db "Enter 'd' to get date, 't' for time or 'q' to quit:
$"
close_message db "Goodbye!$"

year_pre db " Year : $"


month_pre db " Month : $"
day_pre db " Day : $"
hour_pre db " Hour : $"
minute_pre db " Minute : $"
second_pre db " Second : $"

raw_year db "2023$"
year dw ?
month db ?
day db ?
hour db ?
minute db ?
second db ?
adjust_byte db ?
adjust_word dw ?

date_pre db "Getting date...$"


time_pre db "Getting time...$"
date_command db 'd'
time_command db 't'
exit_command db 'q'

.code
display_ascii_adjust:
aam
mov bx, ax
mov dl, bh
add dl, 30h
mov ah, 02h
int 21h
mov dl, bl
add dl, 30h
mov ah, 02h
int 21h
ret

get_system_date:
call new_line
mov ah, 09h
mov dx, offset date_pre
int 21h
mov ah, 2ah
int 21h
mov month, dh
mov day, dl
call new_line
mov ah, 09h
mov dx, offset year_pre
int 21h
mov ah, 09h
mov dx, offset raw_year
int 21h
mov ah, 09h
mov dx, offset month_pre
int 21h
mov al, month
call display_ascii_adjust
mov ah, 09h
mov dx, offset day_pre
int 21h
mov al, day
call display_ascii_adjust
call new_line
call new_line
jmp get_command

get_system_time:
call new_line
mov ah, 09h
mov dx, offset time_pre
int 21h
mov ah, 2ch
int 21h
mov hour, ch
mov minute, cl
mov second, dh
call new_line
mov ah, 09h
mov dx, offset hour_pre
int 21h
mov al, hour
call display_ascii_adjust
mov ah, 09h
mov dx, offset minute_pre
int 21h
mov al, minute
call display_ascii_adjust
mov ah, 09h
mov dx, offset second_pre
int 21h
mov al, second
call display_ascii_adjust
call new_line
call new_line
jmp get_command

get_date:
call get_system_date
get_time:
call get_system_time

new_line:
mov ah, 09h
mov dx, offset linefeed
int 21h
ret

get_command:
lea dx, command_prompt
mov ah, 09h
int 21h
mov ah, 01h
int 21h
mov bl, al
call new_line
cmp bl, date_command
je get_system_date
cmp bl, time_command
je get_system_time
jmp close

close:
call new_line
lea dx, close_message
mov ah, 09h
int 21h
mov ah, 00
int 20h

start:
mov ax,@data
mov ds, ax
jmp get_command
;call get_system_date
;call get_system_time
end start

You might also like