Displaying string
- From: leon800219@xxxxxxxxx
- Date: 31 Aug 2006 08:27:26 -0700
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
.
- Follow-Ups:
- Re: Displaying string
- From: Herbert Kleebauer
- Re: Displaying string
- From: randyhyde@xxxxxxxxxxxxx
- Re: Displaying string
- From: greg . johnston
- Re: Displaying string
- Prev by Date: Re: Question about jumps
- Next by Date: Re: Displaying string
- Previous by thread: HELP: build old DOS game
- Next by thread: Re: Displaying string
- Index(es):