Hello
Try this code (he is OK under windows 10) :
STD_OUTPUT_HANDLE EQU -11
NULL EQU 0
GENERIC_READ equ 080000000h
GENERIC_WRITE equ 040000000h
FILE_SHARE_READ equ 1h
FILE_SHARE_WRITE equ 2h
CONSOLE_TEXTMODE_BUFFER equ 0x00000001
INVALID_HANDLE_VALUE equ -1
GLOBAL Main
EXTERN ExitProcess, GetLastError, GetStdHandle, WriteConsoleA, WriteConsoleOutputA, FormatMessageA
SECTION .data
STRUC lpBuffer
.Char : RESW 1
.Attributes: RESD 1
ENDSTRUC
_lpBuffer ISTRUC lpBuffer
at lpBuffer.Char, Dw 'A'
at lpBuffer.Attributes, DD 21H
IEND
_lpBuffer2 ISTRUC lpBuffer
at lpBuffer.Char, DW 'B'
at lpBuffer.Attributes, DD 21H
IEND
STRUC dwBufferSize
.X: RESW 1
.Y: RESW 1
ENDSTRUC
_dwBufferSize ISTRUC dwBufferSize
at dwBufferSize.X, DW 2
at dwBufferSize.Y, DW 20
IEND
STRUC dwBufferCoord
.X: RESW 1
.Y: RESW 1
ENDSTRUC
_dwBufferCoord ISTRUC dwBufferCoord
at dwBufferCoord.X, DW 0
at dwBufferCoord.Y, DW 0
IEND
STRUC smallRect
.Left : RESW 1
.Top : RESW 1
.Right : RESW 1
.Bottom: RESW 1
ENDSTRUC
_smallRect ISTRUC smallRect
at smallRect.Left, DW 1
at smallRect.Top, DW 1
at smallRect.Right, DW 1
at smallRect.Bottom, DW 1
IEND
SECTION .bss
hOutput resd 1
hScreen resd 1
dummy RESD 1
err RESD 1
err2 RESD 1
buffer resb 200
SECTION .text
Main:
PUSH STD_OUTPUT_HANDLE
CALL GetStdHandle
PUSH _smallRect
PUSH dword [_dwBufferCoord]
PUSH dword [_dwBufferSize]
PUSH _lpBuffer
PUSH eax
CALL WriteConsoleOutputA
CALL GetLastError
PUSH NULL
PUSH 99
PUSH err
PUSH NULL
PUSH EAX
PUSH NULL
PUSH 1000H
CALL FormatMessageA
PUSH STD_OUTPUT_HANDLE
CALL GetStdHandle
push NULL
push dummy
push 32
push err
push EAX
call WriteConsoleA
.fin:
PUSH NULL
CALL ExitProcess