minor listing formatting

This commit is contained in:
Dennis Yurichev 2016-08-11 03:04:43 +03:00
commit 5ece9ece8c
2 changed files with 166 additions and 166 deletions

0
src/chapter-21.md Normal file → Executable file
View file

8
src/chapter-22.md Normal file → Executable file
View file

@ -87,7 +87,7 @@ Start: cld ;make STOSW count up
mov es,bx mov es,bx
mov cx,[bp].BufSize ;load CX with buffer size mov cx,[bp].BufSize ;load CX with buffer size
rep stosw ;fill the buffer rep stosw ;fill the buffer
Bye:mov sp,bp ;restore original stack pointer Bye: mov sp,bp ;restore original stack pointer
pop bp ; and caller's BP pop bp ; and caller's BP
ret EndMrk-RetAddr-2 ;return, clearing the parms from the stack ret EndMrk-RetAddr-2 ;return, clearing the parms from the stack
ClearS endp ClearS endp
@ -240,7 +240,7 @@ ClearS proc near
cmp word ptr [bp].BufOfs,0 cmp word ptr [bp].BufOfs,0
je Bye je Bye
Start: cld ;make STOSW count up Start: cld ;make STOSW count up
mov ah,byte ptr [bp].Attrib[1];load AH with attribute mov ah,byte ptr [bp].Attrib[1] ;load AH with attribute
mov al,byte ptr [bp].Filler ;load AL with fill char mov al,byte ptr [bp].Filler ;load AL with fill char
les di,dword ptr [bp].BufOfs ;load ES:DI with target buffer segment:offset les di,dword ptr [bp].BufOfs ;load ES:DI with target buffer segment:offset
mov cx,[bp].BufSize ;load CX with buffer size mov cx,[bp].BufSize ;load CX with buffer size
@ -274,7 +274,7 @@ ClearS proc near
or ax,di ;is it a null pointer? or ax,di ;is it a null pointer?
je Bye ;yes, so we're done je Bye ;yes, so we're done
Start: cld ;make STOSW count up Start: cld ;make STOSW count up
mov ah,byte ptr [bp].Attrib[1];load AH with attribute mov ah,byte ptr [bp].Attrib[1] ;load AH with attribute
mov al,byte ptr [bp].Filler ;load AL with fill char mov al,byte ptr [bp].Filler ;load AL with fill char
mov cx,[bp].BufSize ;load CX with buffer size mov cx,[bp].BufSize ;load CX with buffer size
rep stosw ;fill the buffer rep stosw ;fill the buffer
@ -327,7 +327,7 @@ With that problem dealt with, Listing 22.7 shows the Zenned version of
**LISTING 22.7 L22-7.ASM** **LISTING 22.7 L22-7.ASM**
```nasm ```nasm
ClearS procnear ClearS proc near
pop dx ;get the return address pop dx ;get the return address
pop ax ;put fill char into AL pop ax ;put fill char into AL
pop bx ;get the attribute pop bx ;get the attribute