Displaying string



Hi all:

I've encounter a code snippet that is for string display, but there's
some points I don't understand, hope you help me thanks.

DispStr:
push ebp
mov ebp, esp
push ebx
push esi
push edi

; First of all what's ebp, I've searched but got no explicit
explanation
; what's the purpose of the above statements about manipulating ebp,
and esp

mov esi, [ebp + 8] ; why pop 8 bytes?
mov edi, [dwDispPos]
mov ah, 0Fh
..1:
lodsb
test al, al
jz .2
cmp al, 0Ah ; 0Ah stands for enter?
jnz .3
push eax
mov eax, edi
mov bl, 160 ; what this 160 means?
div bl
and eax, 0FFh
inc eax
mov bl, 160
mul bl
mov edi, eax
pop eax
jmp .1
..3:
mov [gs:edi], ax
add edi, 2
jmp .1

..2:
mov [dwDispPos], edi

pop edi
pop esi
pop ebx
pop ebp
ret
///////////////

; Here's the testing code

szRAMSize db "RAM size:", 0

push szRAMSize ;
call DispStr ;
add esp, 4

.