Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Retro DOS Clock Program

A 16-bit x86 assembly program that displays a real-time digital clock in VGA graphics mode on DOS systems. Written for educational purposes to demonstrate low-level graphics programming and system time access.

What it does (high level)

This program creates a digital clock display that:

  • Switches the display to 640×480, 16-color VGA graphics mode
  • Reads the current system time from DOS
  • Draws digital clock digits using custom line-drawing routines
  • Displays hours, minutes, and seconds in HH:MM:SS format
  • Updates the display in real-time as time changes
  • Uses pixel-level graphics to render seven-segment style digits

The clock runs continuously, updating the display whenever the seconds change, providing a live digital timepiece in a retro graphics environment.

Requirements

Development Tools

  • Turbo Assembler (TASM) 5.0 - for assembling the source code
  • Turbo Linker (TLINK) - for linking the object file into an executable

Runtime Environment

  • DOSBox (recommended) - DOS emulator for modern systems
  • FreeDOS or MS-DOS - on real hardware or virtual machine
  • VGA-compatible graphics adapter - supports 640×480, 16-color mode

System Requirements

  • 16-bit real-mode DOS environment
  • VGA graphics capability (standard on most systems since the 1990s)
  • Minimal memory requirements (uses small memory model)

Quick Setup with DOSBox

  1. Prepare directories on your host system:

    C:\dos\
    ├── bin\          (place TASM.EXE and TLINK.EXE here)
    └── src\          (place digi_clock.asm here)
    
  2. Launch DOSBox and mount the directories:

    mount c c:\dos
    c:
  3. Build the program:

    cd \src
    ..\bin\tasm digi_clock.asm
    ..\bin\tlink digi_clock.obj

    This creates DIGI_CLOCK.EXE

  4. Run the clock:

    digi_clock

Expected Behavior

When run, the program will:

  • Clear the screen and switch to VGA graphics mode
  • Display a framed area for the clock
  • Show the current time as large digital numbers
  • Update automatically as time progresses
  • Continue running until manually terminated

Troubleshooting

Build Issues:

  • Ensure TASM and TLINK are accessible in your PATH or use full paths
  • Verify you're using TASM 5.0 or compatible version

Runtime Issues:

  • Black screen: Ensure DOSBox supports VGA graphics mode
  • Program doesn't start: Check that you're running in a DOS-compatible environment
  • Graphics corruption: Verify VGA compatibility settings in DOSBox

DOSBox Configuration:

  • Default DOSBox settings should work fine
  • Ensure machine=svga_s3 or similar VGA-compatible setting
  • No special CPU speed or memory configuration needed

Technical Features

  • Real-time updates: Reads system time using DOS interrupt 21h, function 2Ch
  • Custom graphics: Draws digits using pixel-level line drawing routines
  • VGA graphics mode: Uses standard 640×480, 16-color VGA mode
  • Efficient rendering: Only updates display when time actually changes

Educational Value

This program demonstrates:

  • 16-bit x86 assembly language programming
  • VGA graphics programming techniques
  • DOS system calls for time access
  • Real-mode memory management
  • Interrupt-based hardware interface programming

Perfect for learning about retro computing, low-level graphics, and DOS programming fundamentals.

License

Educational/demonstration code. Consider adding appropriate license if redistributing.

About

A digital clock display that actually runs, written in 16-bit x86 assembly

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages