typos
This commit is contained in:
parent
f69d425cac
commit
897e853a42
16 changed files with 102 additions and 102 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ For example, you'd certainly expect a sequence such as
|
|||
pop ax
|
||||
ret
|
||||
pop ax
|
||||
et
|
||||
ret
|
||||
:
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ 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
|
||||
|
|
@ -455,7 +455,7 @@ DrawRectParms ends
|
|||
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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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]
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ else ; !ROUNDING-ON
|
|||
sub eax,eax
|
||||
shrd eax,edx,16 ;position so that result ends up
|
||||
sar edx,16 ; in EAX
|
||||
idivdword ptr [bp+Divisor]
|
||||
idiv dword ptr [bp+Divisor]
|
||||
endif ;ROUNDING-ON
|
||||
shld edx,eax,16 ;whole part of result in DX;
|
||||
; fractional part is already in AX
|
||||
|
|
@ -224,9 +224,9 @@ jg MakeInRange
|
|||
ja Quadrant1
|
||||
;quadrant 0
|
||||
shl bx,2
|
||||
move ax,CosTable[bx] ;look up sine
|
||||
mov eax,CosTable[bx] ;look up sine
|
||||
neg bx ;sin(Angle) = cos(90-Angle)
|
||||
move dx,CosTable[bx+90*10*4] ;look up cosine
|
||||
mov edx,CosTable[bx+90*10*4] ;look up cosine
|
||||
jmp short CSDone
|
||||
|
||||
align ALIGNMENT
|
||||
|
|
@ -237,7 +237,7 @@ Quadrant1:
|
|||
mov eax,CosTable[bx] ;look up cosine
|
||||
neg eax ;negative in this quadrant
|
||||
neg bx ;sin(Angle) = cos(90-Angle)
|
||||
move dx,CosTable[bx+90*10*4] ;look up cosine
|
||||
mov edx,CosTable[bx+90*10*4] ;look up cosine
|
||||
jmp short CSDone
|
||||
|
||||
align ALIGNMENT
|
||||
|
|
@ -248,11 +248,11 @@ BottomHalf: ;quadrant 2 or 3
|
|||
ja Quadrant2
|
||||
;quadrant 3
|
||||
shl bx, 2
|
||||
mov eax,CosTable[bx] ;look up cosine
|
||||
neg bx ;sin(Angle) = cos(90-Angle)
|
||||
movedx,CosTable[90*10*4+bx] ;look up sine
|
||||
nege dx ;negative in this quadrant
|
||||
jmp short CSDone
|
||||
mov eax,CosTable[bx] ;look up cosine
|
||||
neg bx ;sin(Angle) = cos(90-Angle)
|
||||
mov edx,CosTable[90*10*4+bx] ;look up sine
|
||||
neg edx ;negative in this quadrant
|
||||
jmp short CSDone
|
||||
|
||||
align ALIGNMENT
|
||||
Quadrant2:
|
||||
|
|
@ -262,8 +262,8 @@ Quadrant2:
|
|||
mov eax,CosTable[bx] ;look up cosine
|
||||
neg eax ;negative in this quadrant
|
||||
neg bx ;sin(Angle) = cos(90-Angle)
|
||||
move dx,CosTable[90*10*4+bx] ;look up sine
|
||||
nege dx ;negative in this quadrant
|
||||
mov edx,CosTable[90*10*4+bx] ;look up sine
|
||||
neg edx ;negative in this quadrant
|
||||
CSDone:
|
||||
mov bx,[bp].Cos
|
||||
mov [bx],eax
|
||||
|
|
@ -347,9 +347,9 @@ soff=soff+16
|
|||
doff=doff+4
|
||||
ENDM
|
||||
|
||||
popdi;restore register variables
|
||||
popsi
|
||||
popbp;restore stack frame
|
||||
pop di;restore register variables
|
||||
pop si
|
||||
pop bp;restore stack frame
|
||||
ret
|
||||
-XformVecendp
|
||||
;=====================================================================
|
||||
|
|
@ -391,7 +391,7 @@ CXparms ends
|
|||
push bp ;preserve stack frame
|
||||
mov bp,sp ;set up local stack frame
|
||||
push si ;preserve register variables
|
||||
pushdi
|
||||
push di
|
||||
|
||||
mov bx,[bp].SourceXform2 ;BX points to xform2 matrix
|
||||
mov si,[bp].SourceXform1 ;SI points to xform1 matrix
|
||||
|
|
@ -407,7 +407,7 @@ coff=0 ;column offset
|
|||
imul dword ptr [bx+coff];times row 0 entry in column
|
||||
if ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
adcedx,0;whole part of result is in DX
|
||||
adc edx,0 ;whole part of result is in DX
|
||||
endif ;ROUNDING-ON
|
||||
shrd eax,edx,16 ;shift the result back to 16.16 form
|
||||
mov ecx,eax ;set running total
|
||||
|
|
@ -471,9 +471,9 @@ coff=coff+4 ;point to next col in xform2 & dest
|
|||
roff=roff+16 ;point to next col in xform2 & dest
|
||||
ENDM
|
||||
|
||||
popdi;restore register variables
|
||||
popsi
|
||||
popbp;restore stack frame
|
||||
pop di;restore register variables
|
||||
pop si
|
||||
pop bp;restore stack frame
|
||||
ret
|
||||
-ConcatXformsendp
|
||||
end
|
||||
|
|
|
|||
|
|
@ -203,14 +203,14 @@ _FixedMul endp
|
|||
; Fixedpoint FixedDiv(Fixedpoint Dividend, Fixedpoint Divisor);
|
||||
FDparms struc
|
||||
dw 2 dup(?) ;return address & pushed BP
|
||||
Dividend dd?
|
||||
Divisor dd?
|
||||
Dividend dd ?
|
||||
Divisor dd ?
|
||||
FDparms ends
|
||||
alignALIGNMENT
|
||||
public_FixedDiv
|
||||
align ALIGNMENT
|
||||
public _FixedDiv
|
||||
_FixedDivproc near
|
||||
pushbp
|
||||
movbp,sp
|
||||
push bp
|
||||
mov bp,sp
|
||||
|
||||
if USE386
|
||||
|
||||
|
|
@ -268,13 +268,13 @@ else ;!USE386
|
|||
; projection can't be performed for points closer to the viewpoint than Z=1.
|
||||
;figure out signs, so we can use
|
||||
; unsigned divisions
|
||||
subcx, cx ;assume both operands positive
|
||||
sub cx,cx ;assume both operands positive
|
||||
mov ax,word ptr [bp+Dividend+2]
|
||||
and ax,ax;first operand negative?
|
||||
jns CheckSecondOperandD ;no
|
||||
neg ax ;yes, so negate first operand
|
||||
neg word ptr [bp+Dividend]
|
||||
sbbax,0
|
||||
sbb ax,0
|
||||
inc cx ;mark that first operand is negative
|
||||
CheckSecondOperandD:
|
||||
mov bx,word ptr [bp+Divisor+2]
|
||||
|
|
@ -366,9 +366,9 @@ CheckInRange:
|
|||
ja Quadrant1
|
||||
;quadrant 0
|
||||
shl bx,2
|
||||
move ax,CosTable[bx] ;look up sine
|
||||
mov eax,CosTable[bx] ;look up sine
|
||||
neg bx;sin(Angle) = cos(90-Angle)
|
||||
move dx,CosTable[bx+90*10*4] ;look up cosine
|
||||
mov edx,CosTable[bx+90*10*4] ;look up cosine
|
||||
jmp short CSDone
|
||||
|
||||
align ALIGNMENT
|
||||
|
|
@ -376,10 +376,10 @@ Quadrant1:
|
|||
neg bx
|
||||
add bx,180*10 ;convert to angle between 0 and 90
|
||||
shl bx,2
|
||||
move ax,CosTable[bx] ;look up cosine
|
||||
mov eax,CosTable[bx] ;look up cosine
|
||||
neg eax ;negative in this quadrant
|
||||
neg bx ;sin(Angle) = cos(90-Angle)
|
||||
move dx,CosTable[bx+90*10*4] ;look up cosine
|
||||
mov edx,CosTable[bx+90*10*4] ;look up cosine
|
||||
jmp short CSDone
|
||||
|
||||
align ALIGNMENT
|
||||
|
|
@ -390,9 +390,9 @@ BottomHalf: ;quadrant 2 or 3
|
|||
ja Quadrant2
|
||||
;quadrant 3
|
||||
shl bx,2
|
||||
move ax,CosTable[bx] ;look up cosine
|
||||
mov eax,CosTable[bx] ;look up cosine
|
||||
neg bx;sin(Angle) = cos(90-Angle)
|
||||
move dx,CosTable[90*10*4+bx] ;look up sine
|
||||
mov edx,CosTable[90*10*4+bx] ;look up sine
|
||||
neg edx ;negative in this quadrant
|
||||
jmp short CSDone
|
||||
|
||||
|
|
@ -401,10 +401,10 @@ Quadrant2:
|
|||
neg bx
|
||||
add bx,180*10 ;convert to angle between 0 and 90
|
||||
shl bx,2
|
||||
move ax,CosTable[bx] ;look up cosine
|
||||
mov eax,CosTable[bx] ;look up cosine
|
||||
neg eax ;negative in this quadrant
|
||||
neg bx ;sin(Angle) = cos(90-Angle)
|
||||
move dx,CosTable[90*10*4+bx] ;look up sine
|
||||
mov edx,CosTable[90*10*4+bx] ;look up sine
|
||||
neg edx ;negative in this quadrant
|
||||
CSDone:
|
||||
mov bx,[bp].Cos
|
||||
|
|
@ -619,9 +619,9 @@ if MUL-ROUNDING-ON
|
|||
adc edx,0 ;whole part of result is in DX
|
||||
endif ;MUL-ROUNDING-ON
|
||||
shrd eax,edx,16 ;shift the result back to 16.16 form
|
||||
move cx,eax ;set running total
|
||||
mov ecx,eax ;set running total
|
||||
|
||||
move ax,[si+soff+4] ;column 1 entry on this row
|
||||
mov eax,[si+soff+4] ;column 1 entry on this row
|
||||
imul dword ptr [bx+4] ;xform entry times source Y entry
|
||||
if MUL-ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
|
|
@ -630,7 +630,7 @@ endif ;MUL-ROUNDING-ON
|
|||
shrd eax,edx,16 ;shift the result back to 16.16 form
|
||||
add ecx,eax ;running total for this row
|
||||
|
||||
move ax,[si+soff+8] ;column 2 entry on this row
|
||||
mov eax,[si+soff+8] ;column 2 entry on this row
|
||||
imul dword ptr [bx+8] ;xform entry times source Z entry
|
||||
if MUL-ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
|
|
@ -759,17 +759,17 @@ coff=0 ;column offset
|
|||
REPT 3 ;once for each of the first 3 columns,
|
||||
; assuming 0 as the bottom entry (no
|
||||
; translation)
|
||||
move ax,[si+roff] ;column 0 entry on this row
|
||||
mov eax,[si+roff] ;column 0 entry on this row
|
||||
imul dword ptr [bx+coff] ;times row 0 entry in column
|
||||
if MUL-ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
adc edx,0 ;whole part of result is in DX
|
||||
endif ;MUL-ROUNDING-ON
|
||||
shrd eax,edx,16 ;shift the result back to 16.16 form
|
||||
move cx,eax ;set running total
|
||||
mov ecx,eax ;set running total
|
||||
|
||||
move ax,[si+roff+4] ;column 1 entry on this row
|
||||
imuld word ptr [bx+coff+16] ;times row 1 entry in col
|
||||
mov eax,[si+roff+4] ;column 1 entry on this row
|
||||
imul dword ptr [bx+coff+16] ;times row 1 entry in col
|
||||
if MUL-ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
adc edx,0 ;whole part of result is in DX
|
||||
|
|
@ -777,8 +777,8 @@ endif ;MUL-ROUNDING-ON
|
|||
shrd eax,edx,16 ;shift the result back to 16.16 form
|
||||
add ecx,eax ;running total
|
||||
|
||||
move ax,[si+roff+8] ;column 2 entry on this row
|
||||
imuld word ptr [bx+coff+32] ;times row 2 entry in col
|
||||
mov eax,[si+roff+8] ;column 2 entry on this row
|
||||
imul dword ptr [bx+coff+32] ;times row 2 entry in col
|
||||
if MUL-ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
adc edx,0 ;whole part of result is in DX
|
||||
|
|
@ -792,17 +792,17 @@ coff=coff+4 ;point to next col in xform2 & dest
|
|||
;now do the fourth column, assuming
|
||||
; 1 as the bottom entry, causing
|
||||
; translation to be performed
|
||||
move ax,[si+roff] ;column 0 entry on this row
|
||||
imuld word ptr [bx+coff] ;times row 0 entry in column
|
||||
mov eax,[si+roff] ;column 0 entry on this row
|
||||
imul dword ptr [bx+coff] ;times row 0 entry in column
|
||||
if MUL-ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
adc edx,0 ;whole part of result is in DX
|
||||
endif ;MUL-ROUNDING-ON
|
||||
shrd eax,edx,16 ;shift the result back to 16.16 form
|
||||
move cx,eax ;set running total
|
||||
mov ecx,eax ;set running total
|
||||
|
||||
move ax,[si+roff+4] ;column 1 entry on this row
|
||||
imuld word ptr [bx+coff+16] ;times row 1 entry in col
|
||||
mov eax,[si+roff+4] ;column 1 entry on this row
|
||||
imul dword ptr [bx+coff+16] ;times row 1 entry in col
|
||||
if MUL-ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
adc edx,0 ;whole part of result is in DX
|
||||
|
|
@ -810,8 +810,8 @@ endif ;MUL-ROUNDING-ON
|
|||
shrd eax,edx,16 ;shift the result back to 16.16 form
|
||||
add ecx,eax ;running total
|
||||
|
||||
move ax,[si+roff+8] ;column 2 entry on this row
|
||||
imuld word ptr [bx+coff+32] ;times row 2 entry in col
|
||||
mov eax,[si+roff+8] ;column 2 entry on this row
|
||||
imul dword ptr [bx+coff+32] ;times row 2 entry in col
|
||||
if MUL-ROUNDING-ON
|
||||
add eax,8000h ;round by adding 2^(-17)
|
||||
adc edx,0 ;whole part of result is in DX
|
||||
|
|
|
|||
Loading…
Reference in a new issue