Skip to content

Commit

Permalink
Merge pull request #13 from dennis714/master
Browse files Browse the repository at this point in the history
typos
  • Loading branch information
jagregory committed Sep 15, 2015
2 parents 788a637 + a07f8de commit 9b1713b
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 105 deletions.
8 changes: 4 additions & 4 deletions src/chapter-03.md
Expand Up @@ -350,9 +350,9 @@ ZTimerOff proc near
; timer interrupt.
;
mov al,00001010b ; OCW3, set up to read
out OCW3,al; Int errupt Request register
out OCW3,al ; Interrupt Request register
DELAY
ina l,IRR; read Interrupt Request
in al,IRR ; read Interrupt Request
; register
and al,1 ; set AL to 1 if IRQ0 (the
; timer interrupt) is pending
Expand Down Expand Up @@ -1509,7 +1509,7 @@ ZTimerOn proc near
; Restore the context of the program being timed and return to it.
;
MPOPF
popax
pop ax
ret
ZTimerOn endp
Expand Down Expand Up @@ -1674,7 +1674,7 @@ ReferenceZTimerOn proc near
; Restore the context of the program being timed and return to it.
;
MPOPF
popax
pop ax
ret
ReferenceZTimerOn endp
Expand Down
20 changes: 10 additions & 10 deletions src/chapter-09.md
Expand Up @@ -213,13 +213,13 @@ display modes):

```nasm
SHL AX,1 ;*2
SH LAX,1 ;*4
SH LAX,1 ;*8
SH LAX,1 ;*16
MO VBX,AX
SH LAX,1 ;*32
SH LAX,1 ;*64
ADD AX,BX ;*80
SHL AX,1 ;*4
SHL AX,1 ;*8
SHL AX,1 ;*16
MOV BX,AX
SHL AX,1 ;*32
SHL AX,1 ;*64
ADD AX,BX ;*80
```

Using `LEA` on the 386, the above could be reduced to
Expand All @@ -242,7 +242,7 @@ Of course, on the 386, the shift and add version could also be reduced
to this considerably more efficient code:

```nasm
SH LAX,4 ;*16
SHL AX,4 ;*16
MOV BX,AX
SHL AX,2 ;*64
ADD AX,BX ;*80
Expand Down Expand Up @@ -766,9 +766,9 @@ _Divprocnear
sub dx,dx ;convert initial divisor word to a 32-bit
;value for DIV
DivLoop:
lod sw ;get next most significant word of divisor
lodsw ;get next most significant word of divisor
div bx
sto sw ;save this word of the quotient
stosw ;save this word of the quotient
;DX contains the remainder at this point,
; ready to prepend to the next divisor word
loop DivLoop
Expand Down
6 changes: 3 additions & 3 deletions src/chapter-11.md
Expand Up @@ -1020,7 +1020,7 @@ pushed on the stack will point to the instruction we want to continue
with. The code works out like this:

```nasm
jmpshort popfskip
jmp short popfskip
popfiret:
iret; branches to the instruction after the
; call, popping the word below the address
Expand Down Expand Up @@ -1082,8 +1082,8 @@ an 8088.)
.286
:
EMULATE_POPFmacro
pushcs
pushoffset $+4
push cs
push offset $+4
iret
endm
```
Expand Down
2 changes: 1 addition & 1 deletion src/chapter-12.md
Expand Up @@ -346,7 +346,7 @@ For example, you'd certainly expect a sequence such as
pop ax
ret
pop ax
et
ret
:
```

Expand Down
2 changes: 1 addition & 1 deletion src/chapter-28.md
Expand Up @@ -410,7 +410,7 @@ Start proc near
mov al,1 ;blue is color 1
call SelectSetResetColor ;set to draw in blue
mov ax,VGA_SEGMENT
move s,ax
mov es,ax
sub di,di
mov cx,7000h
rep stosb ;the value written actually doesn't
Expand Down
2 changes: 1 addition & 1 deletion src/chapter-29.md
Expand Up @@ -262,7 +262,7 @@ RestoreTheScreen:
RestoreLoop:
mov dx,SC_INDEX
mov al,MAP_MASK ;set SC Index to Map Mask register
outdx,al
out dx,al
inc dx
mov cl,[Plane] ;get the # of the plane we want
; to restore
Expand Down
4 changes: 2 additions & 2 deletions src/chapter-30.md
Expand Up @@ -810,7 +810,7 @@ RowLoop:
mov cx,LOGICAL_SCREEN_WIDTH/8/4
;fill 1 scan line
ColumnLoop:
sto sw ;draw part of a diagonal line
stosw ;draw part of a diagonal line
mov word ptr es:[di],0 ;make vertical blank spaces so
; panning effects can be seen easily
inc di
Expand All @@ -832,7 +832,7 @@ RowLoop2:
mov cx,LOGICAL_SCREEN_WIDTH/8/4
;fill 1 scan line
ColumnLoop2:
sto sw ;draw part of a diagonal line
stosw ;draw part of a diagonal line
mov word ptr es:[di],0 ;make vertical blank spaces so
; panning effects can be seen easily
inc di
Expand Down
24 changes: 12 additions & 12 deletions src/chapter-31.md
Expand Up @@ -373,22 +373,22 @@ Set320By400Mode proc near
mov al,MEMORY_MODE
out dx,al
inc dx
ina l,dx
in al,dx
and al,not 08h ;turn off chain 4
ora l,04h ;turn off odd/even
or al,04h ;turn off odd/even
out dx,al
mov dx,GC_INDEX
mov al,GRAPHICS_MODE
out dx,al
inc dx
ina l,dx
in al,dx
and al,not 10h ;turn off odd/even
out dx,al
dec dx
mov al,MISCELLANEOUS
out dx,al
inc dx
ina l,dx
in al,dx
and al,not 02h ;turn off chain
out dx,al
;
Expand Down Expand Up @@ -677,14 +677,14 @@ stack ends
;
OUT_WORDmacro
if WORD_OUTS_OK
outdx,ax
out dx,ax
else
out dx,al
inc dx
xch gah,al
xchg ah,al
out dx,al
dec dx
xch gah,al
xchg ah,al
endif
endm
;
Expand Down Expand Up @@ -777,22 +777,22 @@ Set320By400Modeprocnear
mov al,MEMORY_MODE
out dx,al
inc dx
ina l,dx
in al,dx
and al,not 08h ;turn off chain 4
ora l,04h ;turn off odd/even
or al,04h ;turn off odd/even
out dx,al
mov dx,GC_INDEX
mov al,GRAPHICS_MODE
out dx,al
inc dx
ina l,dx
in al,dx
and al,not 10h ;turn off odd/even
out dx,al
dec dx
mov al,MISCELLANEOUS
out dx,al
inc dx
ina l,dx
in al,dx
and al,not 02h ;turn off chain
out dx,al
;
Expand Down Expand Up @@ -830,7 +830,7 @@ CONSTANT_TO_INDEXED_REGISTER SC_INDEX,MAP_MASK,0fh
mov al,UNDERLINE
out dx,al
inc dx
ina l,dx
in al,dx
and al,not40h ;turn off doubleword
out dx,al
dec dx
Expand Down
2 changes: 1 addition & 1 deletion src/chapter-34.md
Expand Up @@ -390,7 +390,7 @@ RowLoop:
ColumnLoop:
stosb ;draw a pixel
add al,1 ;increment the attribute
ad cal,0 ;if the attribute just turned
adc al,0 ;if the attribute just turned
; over to 0, increment it to 1
; because we're not going to
; cycle DAC location 0, so
Expand Down
4 changes: 2 additions & 2 deletions src/chapter-37.md
Expand Up @@ -104,7 +104,7 @@ _LineDraw proc near
cld
push bp ;preserve caller's stack frame
mov bp,sp ;point to our stack frame
sub sp, LOCAL_SIZE ;allocate space for local variables
sub sp, LOCAL_SIZE ;allocate space for local variables
push si ;preserve C register variables
push di
push ds ;preserve caller's DS
Expand All @@ -115,7 +115,7 @@ _LineDraw proc near
jle LineIsTopToBottom
xchg [bp].YEnd,ax; swap endpoints
mov [bp].YStart,ax
movbx, [bp].XStart
mov bx,[bp].XStart
xchg [bp].XEnd,bx
mov [bp].XStart,bx
LineIsTopToBottom:
Expand Down
4 changes: 2 additions & 2 deletions src/chapter-39.md
Expand Up @@ -718,7 +718,7 @@ DiagonalSkipEntry:
jmp ScanEdgeDone
align 2
YMajor:
pushbp ;preserve stack frame pointer
push bp ;preserve stack frame pointer
mov si,[bp+X1] ;starting X coordinate
cmp [bp+SkipFirst],1 ;skip the first point?
mov bp,bx ;put Height in BP for error term calcs
Expand All @@ -734,7 +734,7 @@ YMajorSkipEntry:
YMajorNoAdvance:
dec bx ;count off this scan line
jnz YMajorLoop
popbp ;restore stack frame pointer
pop bp ;restore stack frame pointer
ScanEdgeDone:
cmp [bp+SetXStart],1 ;were we working with XStart field?
jz UpdateHLinePtr ;yes, DI points to the next XStart
Expand Down
12 changes: 6 additions & 6 deletions src/chapter-43.md
Expand Up @@ -443,7 +443,7 @@ Dataends
;
; Macro to output a word value to a port.
;
OUT_WORDmacro
OUT_WORD macro
if WORD_OUTS_OK
out dx,ax
else
Expand All @@ -459,9 +459,9 @@ endif
; Macro to output a constant value to an indexed VGA
; register.
;
CONSTANT_TO_INDEXED_REGISTERmacro ADDRESS, INDEX, VALUE
movdx, ADDRESS
movax, (VALUE shl 8) + INDEX
CONSTANT_TO_INDEXED_REGISTER macro ADDRESS, INDEX, VALUE
mov dx, ADDRESS
mov ax, (VALUE shl 8) + INDEX
OUT_WORD
endm
;
Expand Down Expand Up @@ -704,7 +704,7 @@ DrawObject proc near
mov dx,ax ;# of lines in the image
lodsw ;# of bytes across the image
mov bp,SCREEN_WIDTH
subbp,ax ;# of bytes to add to the display
sub bp,ax ;# of bytes to add to the display
; memory offset after copying a line
; of the image to display memory in
; order to point to the address
Expand All @@ -718,7 +718,7 @@ DrawLoop:
; next line will go in display
; memory
dec dx ;count down the lines of the image
jnzDrawLoop
jnz DrawLoop
ret
DrawObjectendp
;
Expand Down
6 changes: 3 additions & 3 deletions src/chapter-44.md
Expand Up @@ -447,15 +447,15 @@ DrawRectParms ends
mov dh,RightMask[bx] ;set the right-edge clip mask
mov bx,LeftX[bp]
and bx,NOT 7 ;intrapixel address of left edge
su si,bx
sub si,bx
shr si,1
shr si,1
shr si,1 ;# of bytes across spanned by rectangle - 1
jnz MasksSet ;if there's only one byte across,
and dl,dh ; combine the masks
MasksSet:
mov bx,BottomY[bp]
su bx,TopY[bp] ;# of scan lines to fill - 1
sub bx,TopY[bp] ;# of scan lines to fill - 1
FillLoop:
push di ;remember line start offset
mov al,dl ;left edge clip mask
Expand Down Expand Up @@ -661,7 +661,7 @@ TextUpDone:
CharUp: ;draws the character in AL at ES:DI
lds si,[BIOS8x8Ptr] ;point to the 8x8 font start
mov bl,al
su bh,bh
sub bh,bh
shl bx,1
shl bx,1
shl bx,1 ;*8 to look up character offset in font
Expand Down
10 changes: 5 additions & 5 deletions src/chapter-46.md
Expand Up @@ -499,7 +499,7 @@ parms ends
les di,[bp+BufferPtr]
mov dx,[bp+RectHeight]
mov bx,[bp+BufferWidth]
su bx,[bp+RectWidth] ;distance from end of one dest scan
sub bx,[bp+RectWidth] ;distance from end of one dest scan
; to start of next
mov al,byte ptr [bp+Color]
mov ah,al ;double the color for REP STOSW
Expand Down Expand Up @@ -544,7 +544,7 @@ parms2 ends
mov bx,[bp+Pixels]
mov dx,[bp+ImageHeight]
mov ax,[bp+BufferWidth2]
su ax,[bp+ImageWidth] ;distance from end of one dest scan
sub ax,[bp+ImageWidth] ;distance from end of one dest scan
mov [bp+BufferWidth2],ax ; to start of next
RowLoop2:
mov cx,[bp+ImageWidth]
Expand All @@ -556,7 +556,7 @@ ColumnLoop:
mov es:[di],al
SkipPixel:
inc bx ;point to next source pixel
inc d ;point to next dest pixel
inc di ;point to next dest pixel
dec cx
jnz ColumnLoop
add di,[bp+BufferWidth2] ;point to next scan to fill
Expand Down Expand Up @@ -596,9 +596,9 @@ parms3 ends
lds si,[bp+SrcBufferPtr]
mov dx,[bp+CopyHeight]
mov bx,[bp+DestBufferWidth] ;distance from end of one dest scan
su bx,[bp+CopyWidth] ; of copy to the next
sub bx,[bp+CopyWidth] ; of copy to the next
mov ax,[bp+SrcBufferWidth] ;distance from end of one source scan
su ax,[bp+CopyWidth] ; of copy to the next
sub ax,[bp+CopyWidth] ; of copy to the next
RowLoop3:
mov cx,[bp+CopyWidth] ;# of bytes to copy
shr cx,1
Expand Down
2 changes: 1 addition & 1 deletion src/chapter-48.md
Expand Up @@ -521,7 +521,7 @@ MasksSet:
mov [bp+SourceNextScanOffset],ax
mov [bp+RectAddrWidth],cx ;remember width in addresses - 1
;----------------------BUG FIX
mov dx,SC_INDEX
mov dx,SC_INDEX
mov al,MAP_MASK
out dx,al ;point SC Index reg to Map Mask
inc dx ;point to SC Data reg
Expand Down

0 comments on commit 9b1713b

Please sign in to comment.