OK, thanks to everybody :icon14:
The new StackBuffer() is now implemented in MasmBasic of 30 Oct (
more). In the end, rep stosd made the race. Usage examples:
mov sbuf1,
StackBuffer(4000h)
; buffer is 16-byte aligned for use with SSE2 invoke GetFileSize, hFile, 0
; you may use a register to specify the buffer size mov sbuf2,
StackBuffer(eax, nz)
; option nz
means "no zeroing" - much faster, of course...
StackBuffer()
; release all buffers (sb without args = free the buffer)The
nz option does only the probing and zeroes the last two bytes of the buffer, plus two bytes beyond the buffer. This is to allow loading e.g. a textfile into the buffer and being sure that the end is zero-delimited.