Over a million developers have joined DZone.

Days in a month - embedded system - smaller than table.

·

A small routine returning the number of days in a month for those rolling their own.

(8086 assembly)

//ah = month. 0 = Jan, 7 = Aug..etc. Feb not handled
//ah destroyed.
//al contains number of days in month
mov al,31
xor ah,9
jp thirty_one //parity bit set on 30 day months
dec al
:thirty_one
ret
Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}