如何在不填写屏幕的情况下清除屏幕

Gab*_*lli 8 x86 assembly dos interrupt

是否存在中断服务程序来帮助我清除终端屏幕?它会在Windows上运行吗?

Ale*_*nze 16

通过BIOS设置图形模式(int 10h,AH = 0)将清除屏幕.

通过BIOS向上或向下滚动屏幕(在AH = 6或7的情况下为10h)也可以清除屏幕.

这仅适用于可以调用BIOS服务功能的位置.

MSDOS始终可以使用.

在Windows中,这仅适用于DOS应用程序,如果Windows可以实际运行它们.64位版本的Windows根本不支持DOS应用程序,从Windows Vista开始,即使在32位版本的Windows中,许多DOS应用程序也无法完全运行.

还要记住,如果DOS应用程序在Windows窗口中运行,则只会清除该窗口,而不是整个屏幕.


小智 5

我让它工作了(使用过qemu,NASM)

http://www.gabrielececchetti.it/Teaching/CalcolatoriElettronici/Docs/i8086_and_DOS_interrupts.pdf

call cls
jmp $

cls:
  pusha
  mov ah, 0x00
  mov al, 0x03  ; text mode 80x25 16 colours
  int 0x10
  popa
  ret
Run Code Online (Sandbox Code Playgroud)

  • mov ax, 0x0003 then int 0x10 适用于 MacOS、bochs 和 nasm。 (2认同)