Search code examples
assemblyx86dosinterrupt

How can I clear the screen without having to fill it


Does an interrupt service routine exist to help me clear the screen of the terminal? Will it work on windows?


Solution

  • Setting a graphics mode through BIOS (int 10h with AH=0) will clear the screen.

    Scrolling the screen up or down through BIOS (int 10h with AH=6 or 7) can clear the screen as well.

    This will only work where you can invoke BIOS service functions.

    MSDOS is where this will always work.

    In Windows this will work only in DOS applications and if Windows can actually run them. 64-bit editions of Windows don't support DOS applications at all and starting with Windows Vista even in 32-bit editions of Windows many DOS apps don't work fully.

    Remember also that if a DOS application runs in a window in Windows, only that window will get cleared, not the entire screen.