在装配中更快地清除屏幕

Clears the screen faster in assemly

我在清除屏幕时遇到问题。

我正在使用 call Clrscr 但速度很慢。它不够快,所以我有屏幕,黑色,没有图形,因为等待函数 Clrscr 完成。

    call Clrscr

  ; Write a string to the console:
    INVOKE WriteConsole,
        consoleHandle,              ;console output handle
        ADDR HANGMAN_GOODGAME_00,               ; string pointer
        messageSizeGoodGame,                ; string length
        ADDR bytesWritten,          ; returns num bytes written
        0                           ; not used

    mov eax, drowDelay
    call Delay
    call Clrscr

  ; Write a string to the console:
    INVOKE WriteConsole,
        consoleHandle,              ;console output handle
        ADDR HANGMAN_GOODGAME_01,               ; string pointer
        messageSizeGoodGame,                ; string length
        ADDR bytesWritten,          ; returns num bytes written
        0                           ; not used

    mov eax, drowDelay
    call Delay
    call Clrscr

  ........

这是照片。它看起来如何没有 slearing。我正在尝试制作动画..:)

您可以只设置光标位置。
只需使用 winapi 中的 setcursorpos:

push 0
push 0
call [SetCursorPos]

它在 user32.dll

编辑:它的工作方式很简单,将光标位置设置到左上角,从而产生移动的感觉