我在从控制台读取输入并在其后输出字符串时遇到问题?

问题描述 投票:0回答:0

我正在尝试从控制台获取输入,但是当我从控制台读取一些内容后,我无法再打印任何内容,读完后有一点停顿。

它尝试增加和减少 inputBuffersize

    invoke  GetStdHandle, -11
    mov     stdoutHandle, eax ; Save the console output handl    
    mov     ebx, stdoutHandle 
    lea     eax, inoutSTR  ; Load the address of the strV character into eax
    push    0             
    push    0             
    push    SIZEOF inoutSTR
    CALL printEAX


   ; Read user input from the console
    invoke  GetStdHandle, -10
    mov     ebx, eax
    lea     eax, inputBuffer
    push    0
    push    0
    push    SIZEOF inputBuffer
    push    eax
    push    ebx
    call    ReadConsoleA


    ; Print the strV to the console
    mov     ebx, stdoutHandle        ; Save the console input handle in ebx
    lea     eax, inoutSTR  ; Load the address of the strV character into eax
    push    0             
    push    0             
    push    SIZEOF inoutSTR
    CALL printEAX
    inputBuffer     BYTE    4 DUP(0) ; Buffer to hold the user input
assembly winapi x86 masm
© www.soinside.com 2019 - 2024. All rights reserved.