1 / 5

386. mikroprocesora aritmētika

386. mikroprocesora aritmētika. Direktīva .386. . code .startup .386. Operanda paplašināšana ( MovSx ). NegTwo DB -2 ... Mov Al, NegTwo ;Al = ?? FE MovSx Cx, Al ;Cx = FFFE MovSx Bx, NegTwo ;Bx = FFFE MovSx EDx, NegTwo ;EDx = FFFF FFFE.

keala
Télécharger la présentation

386. mikroprocesora aritmētika

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 386. mikroprocesora aritmētika Direktīva .386 .code .startup .386 Operanda paplašināšana (MovSx) NegTwo DB -2 ... Mov Al, NegTwo;Al = ??FE MovSx Cx, Al;Cx = FFFE MovSx Bx, NegTwo;Bx = FFFE MovSx EDx, NegTwo;EDx = FFFF FFFE

  2. Operanda paplašināšana (MovZx) NegTwo DB -2 ... Mov Al, NegTwo;Al = ??FE MovZx Cx, Al;Cx = 00FE MovZx Bx, NegTwo;Bx = 00FE MovZx EDx, NegTwo;EDx = 000000FE Kļūdas MovSx Cl, Bl;operandu izmēri sakrīt MovSx Cx, Bx;operandu izmēri sakrīt MovSx ECx, EBx;operandu izmēri sakrīt MovSx MemW, MemB ;formāts “atmiņa” – “atmiņa”

  3. Divu operandu reizināšana (IMul) Var izmantot ne tikai akumulatoru. MovBx, 3;Bx= 0003 MovCx, -2;Cx = FFFE IMulBx, Cx;Bx = FFFA (-6) Mov Bx, -2;Bx = FFFE IMul Bx, X;Bx = FFFA, ja vārds X = 3 Kļūdas IMul Bl, Cl;operandi nav vārdi MulBx, Cx ;bez zīmju reizināšana

  4. Trīs operandu reizināšana (IMul). Trešais operands vienmēr ir tiešais operands. Rezultāts atrodas pirmajā operandā-reģistrā. Mov Bx, 2;Bx = 2 IMul Bx, Bx, 3;Bx = 6 Mov Bx, 2;Bx = 2 IMul Cx, Bx, 3;Cx =6 X Dw 2 ... IMul Cx, X, 3;Cx =6 Mov EBx, 2;EBx = 2 IMul ECx, EBx, 3;ECx = 6

  5. Operandu paplašināšana līdz četrkāršotām vārdam (Cwde, Cdq). Mov Ax, -3;Ax = FFFD (-3) Cwde;EAx = FFFFFFFD (-3) Cdq;EDx:EAx = FFFFFFFF:FFFFFFFD Alternatīvais risinājums: Mov EAx, -3 Cdq Piezīme: neder MovSx EAx, -3 Dalīšana: Mov EBx, 3;EBx = 3 IDiv EBx;EAx = FFFF (-1), EDx = 0

More Related