11.07.2015 Views

Chapter 54

Chapter 54

Chapter 54

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CSDone:shlmovnegnegmovnegmovmovmovmovbx.2eax.CosTable[bxleaxbxedx.CosTable[90*10*4+bxledxbx.[bpl.Cos[bxl .eaxbx.[bpl.Sin[bxl .edx:look up cosine:negative in this quadrant:sin(Angle) - cos(90-Angle):look up sine:negative in this quadrantelse : !USE386mov bx.[bpl.Angleand bx.bxjns CheckInRangeMa kePos :add bx.360*10js MakePosjmp short CheckInRange:make sure angle's between 0 and 2*pi:less than 0, so make it positivea1 i gn ALIGNMENTMakeInRange:sub bx.360*10CheckInRange:cmp bx.360*10jg MakeInRange:make sure angle is nomore than 2*pibx, 180*10 ;figure out which quadrantBottomHal f :quadrant 2 or 3bx, 90*10 :quadrant 0 or 1Quadrantl:quadrant 0bx.2ax.word ptr CosTable[bxl :look up sinedx.word ptr CosTable[bx+2]bx :sin(Angle) - cos(90-Angle)cx.word ptr CosTable[bx+90*10*4+2] :look up cosinebx.word ptr CosTable[bx+90*10*41CSDonea1 ign ALIGNMENTQuadrantl:neg bxadd bx.180*10 :convert to angle between 0 and 90shl bx.2mov ax.word ptr CosTableCbxl :look up cosinemov dx.word ptr CosTableCbx+21neg dx :negative in this quadrantneg axsbb dx.0neg bx :sin(Angle) - cos(90-Angle)mov cx.word ptr CosTable[bx+90*10*4+21 :look up cosinemov bx,word ptr CosTableCbx+90*10*43jmp short CSDonea1 ign ALIGNMENTBottomHal f: :quadrant 2 or 3neg bxadd bx.360*10:convert to angle between 0 and 1801 01 4 <strong>Chapter</strong> <strong>54</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!