News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Undocumented StdOut limit for console output

Started by jj2007, October 05, 2015, 08:04:01 PM

Previous topic - Next topic

jj2007

Inspired by the thread on vkdebug PrintString, I investigated about the practical limits of printing to the console.

StdOut fails with error 8, not enough memory, when the string exceeds 62600 bytes on Windows 7-64.
On Windows XP, the limit is 53200 bytes, on Win 8.1 it seems much higher (>2MB).

Accordingly, I have increased the buffer size for the deb macro. Example:

include \masm32\MasmBasic\MasmBasic.inc      ; download
  Init
  Let esi=FileRead$("\Masm32\include\Windows.inc")
  deb 4, "Windows.inc", $esi:999999   ; ask for a Million bytes
  Print "OK"
  Exit
EndOfCode


During assembly, ## line 4: deb display limited to 62600 bytes (XP limit is 53200) ## will be shown, indicating that deb cut off at the amount of bytes that is safe for Win7.

P.S.: By default, $esi (without :bytes) would display 800 bytes.

hutch--

The trick with StdOut is to stream it out, not dump it in one block. Feed it out at about 1k each block and it will stream forever without delays.