bits 32 oddities in NASM



This is a two part question. First, the following code fails to work. I
can run the assembler and then run the .com file, but nothing happens.
That suggests that there's some terminating exception going on, but I'm
not told about it. :-)

My question is about the bits directive. When I specify bits 32, I
expected esp to scale by 4 rather than 2, but I don't get the same
output as when I specify bits 16 and scale esp by 2. The latter gives
me the correct output while the former, I think, terminates prematurely
due to an exception.

org 100h
bits 32

[section .data]

msg: db 'Hello, world!',0

[section .text]

push msg
call jrd_puts
add esp,4

mov eax,0
int 21h

jrd_puts:
mov esi,[esp + 4]
mov eax,0200h
..loop:
movzx edx,byte [esi]
int 21h
inc esi

cmp edx,0
jne .loop

ret

I'm not sure what I'm doing wrong, which brings me to the second part
of my question. Where can I find diagnostic tools to help me figure out
my own problems rather than come running here when I'm stumped? :-)

Cheers!

.