Assembly Programming (A86) Series: Determines AM or PM in 24hrs format MS-DOS time
Posted on June 18, 2009 under Programming
Here’s a code snippet done using Assembly Programming (A86) language that tells the local system time (ms-dos) if it’s under AM or PM. This is simple code that you want to try to explore assembly language. If you need the compiler, please leave message below and I will send it to you. Thanks!
mov ah, 2ch
int 21h
mov al, ch
cmp al, 12
jb exit1
cmp al, 12
jae exit2
exit1:
mov ah, 09
lea dx, result1
int 21h
int 20h
exit2:
mov ah, 09
lea dx, result2
int 21h
int 20h
result1 db 'The current time falls under AM.$'
result2 db 'The current time falls under PM.$'

Hi! I am Jerome Locson from Zamboanga City, Philippines. I am programmer, web developer and designer, technopreneur, and blogger. I blog about technology, foods and my travel. Thank you for visiting!