Buffers in Assembly (NASM)



I'm trying to better understand data structures in assembly. I know I
can create a zero filled buffer in the bss section in NASM with this:

buffer: times 64 db 0

And I know I can create a buffer on the stack like this:

sub esp, 64
mov ebx, esp ;save the start point of the buffer

But how do I zero out the buffer on the stack? In C, I would just do
something like:

char buffer[64] = {0};

What's the equivalent in assembly using NASM?

Thanks,

Brian

.



Relevant Pages

  • Re: Buffers in Assembly (NASM)
    ... can create a zero filled buffer in the bss section in NASM with this: ... it doesn't know what ".bss" means. ... In an uninitialized section, there's "nothing there", so it would be "conceptually impossible" for Nasm to zero it. ... mov al, 'N' ...
    (comp.lang.asm.x86)
  • Re: Buffers in Assembly (NASM)
    ... it doesn't know what ".bss" means. ... In other formats, this will ... Nasm to zero it. ... I'm basically just creating a buffer to write strings for functions ...
    (comp.lang.asm.x86)
  • Re: NASM 2.07 released
    ... If only NASM had an snprintf() of it's ... If only the NASM developers knew of it, and used it for all platforms... ... allocates a buffer of 65536 characters. ...
    (comp.lang.asm.x86)