MASM Analog Clock
How to build
Please use MASM 6.15 to build.
The application is written for Intel 80286 real mode environment and depends on DOS interrupts. Therefore, it cannot be run directly on modern versions of Windows. An emulator, such as DOSBox, is recommended.
Description of code
- print the text
- check keystroke
- display digital clock
- conditional quit
Summary of procedures
Sets cursor to row 0 column 16
Returns y = (y2-y1)*(x-x1)/(x2-x1)+y1 Inputs: (x1,y1), (x2,y2), x Calls: xymaxmin, subab, DIan
Returns x = (x2-x1)*(y-y1)/(y2-y1)+x1 Inputs: (x1,y1), (x2,y2), y Calls: xymaxmin, subab, DIan
Gets time CH:CL:DH in Binary Coded Decimal (BCD) form using INT 1A Service 2
Operates on BCDs Input: DL Output: AL
Computes the trigonometric function Sine Input: AX Output: AX
Computes the trigonometric function Cosine Input: AX Output: AX
Calls: SIn, cos
Calls: xymaxmin, subab, sjxx, sjxy
Calls: xymaxmin, subab, linex, liney
Calls: CLk, vcd2, renovate, sjx, sjxx, sjxy
Clears the screen by writing ' ' 6000 times using INT 10 Service 0AH
Used in linex, liney and many others
skin, skin2, skin3
These three functions draw the skeleton of the analog clock. Skin displays the hour numbers. Skin2 and skin3 draw the circle and the markings of the clock.
Draws the hour needle Calls: CLk, bcd2, sjx, renovate
Draws the minute needle
Draws the second needle
Draws the millisecond needle
Information about all the interrupts used in this program is available at Ralf Brown’s Interrupt List.
For more information, please refer to this blog post.