I want to replace white-spaces in dbyte with '#' character, and db should be passed to the procedure by stack.
I've written next snippet and replacing is working, but I can't understand how to pass db to procedure func properly.
org 0x100
push array
call func
mov bp, sp
mov bx, [bp]
ret
loop:
mov al, byte[bx+si]
cmp al, 0
jz func
cmp al , ' '
jnz loop
mov byte[bx+si], '#'
inc si
jmp loop
ret
func:
push bp
mov bp, sp
mov bx, [bp + 4]
call loop
mov [bp + 4], bx
pop bp
ret 4
array db "a b c", 0