Ch 08 ¤Q¤»¶i¦ìÅܤQ¶i¦ì


HEX2DEC2µ{¦¡

¦b³o¤@³¹¸Ì¡A§Ú¥´ºâ¼g¤@­Óµ{¦¡¡A¥¦¥i¥HÅý¨Ï¥ÎªÌ¥ÑÁä½L¿é¤J¤@­Ó16¦ì¤¸(¤]´N¬O±q0000h¨ìFFFFh)ªº¤Q¤»¶i¦ì¼Æ¡Aµ{¦¡·|­pºâ¥X¸Ó¼Æªº¤Q¶i¦ì¼Æ­È¨Ã¦L¦b»È¹õ¤W¡C

¦b³o­Óµ{¦¡¸Ì¡A§Ú±N·|»¡©ú¦p¦ó¦b²Õ¦X»y¨¥¤¤¦p¦ó³B²zÁä½L¿é¤J¡AµM«á³B²z¦¨¬°¤Q¤»¶i¦ìªº¼Æ¦r¡A¦s©ó¼È¦s¾¹¤¤¡C

³o­Óµ{¦¡¦W¥s HEX2DEC2.COM¡A¬°¦ó¦³¨â­Ó2©O¡H¡y2¡z­^¤åŪ­µ©M¡yto¡z¦P­µ¡A¬G HEX2DEC ªº·N«ä´N¬O¡yHEX TO DEC¡z¡AHEX¡BDEC ¤À§Oªí¥Ü¤Q¤»¶i¦ì©M¤Q¶i¦ì¡Q²Ä¤G­Ó¡y2¡zªí¥Ü¦³§O©ó¤W¤@³¹ªºµ{¦¡ HEX2DEC.COM¡C

­ì²z

­n¥Î²Õ¦X»y¨¥±o¨ìÁä½L¿é¤Jªº¡y¦r¥À¡z¡A¥²¶·¨Ï¥Î¤¤Â_ 16h ªA°Èµ{¦¡¡A³o­Ó¤¤Â_ªA°Èµ{¦¡¨Ã¤£¬O¥Ñ DOS ´£¨Ñªº¡A¦Ó¬O¥Ñ¥D¾÷ªO¤Wªº BIOS ´£¨Ñªº¡A¦]¦¹ÄÝ©ó BIOS ªA°Èµ{¦¡¡CINT 16h ¥D­nªºªA°È¹ï¶H¬OÁä½L¡AINT 13h ¬OºÏºÐ¾÷¡AINT 14h ¬O³q°T°ð(´N¬O COM1¡BCOM2 µ¥µ¥©Î¬O RS-232)¡AINT 10h ¬O¿Ã¹õ¡AINT 17h ¬O¦Lªí¾÷¡A³o¨Ç³£ÄÝ©ó BIOS ªA°Èµ{¦¡¡CBIOS ªA°Èµ{¦¡´N¹³¬O DOS ªA°Èµ{¦¡¤@¼Ë(§Y 21h ¤¤Â_)¡A®t§O¬O BIOS ªA°Èµ{¦¡¬O¿N¿ý¦b¤@­Ó°ßŪ°O¾ÐÅ餺¡C

INT 16h ªºªA°Èµ{¦¡¤£¹³ INT 21h ³o»ò¦h¡A¥u¦³¤T­Ó¡G

¦b¤@¯ëÁä½L¤W¡A¦@¦³ 101 ­ÓÁä¡A¨C·í¨Ï¥ÎªÌ«ö¤U¤@­ÓÁä®É¡AÁä½Lªº¹q¸ô·|°e¹q¤l°T¸¹µ¹¥D¾÷ªO¡A¥D¾÷ªO·|¸ÑŪ¦¨¨â­Ó¼Æ¦r¡C¨ä¤¤¤@­ÓºÙ¬°¡y±½´y½X¡z¡A¨C¤@­ÓÁ䪺±½´y½X³£¤£¦P¡A¤]´N¬O»¡µ{¦¡¥i¥H¥Ñ±½´y½X§PÂ_¨º¤@­ÓÁä³Q«ö¤U¡C¥t¤@­Ó¼Æ¦r¬OÁä©Ò¥Nªíªº ASCII ½X¡A·íµM¦³¨ÇÁä¨Ò¦p F1¡BF2 ³o¨ÇÁä¨Ã¨S¦³ ASCII ½X¡C

³o¼Ë°µªº¦n³B¬O¡A¦³¨Ç¦r¥i¥H¥Î¨âºØ¤è¦¡«ö¥X¨Ó¡A¨Ò¦pªü©Ô§B¼Æ¦rªº¡y1¡z§A¥i¥H¨Ï Num Lock ¿O«G°_¦A«öÁä½L¥kÃ䪺Áä¡A³o­ÓÁäÁÙ¥Nªí End¡A©ÎªÌª½±µ«öÁä½L¥ª¤W¤èªºÁä¡A³o­ÓÁä¤]¥i¥H«ö¥X¡y!¡z¡A¦ý¬O³o¨â­ÓÁ䪺±½´y½X¤£¦P¡Aµ{¦¡´N¥i¥H½T¹êª¾¹D¨Ï¥ÎªÌ¨ì©³«ö¥X¨º¤@­ÓÁä¡CÁöµM±½´y½X¤£¦P¡A¦ý¬O©Ò«ö¥X¨Óªü©Ô§B¼Æ¦r¡y1¡zªº ASCII ½X«o¬O¤@¼Ëªº¡C

°õ¦æ INT 16H/AH=0 ³o­Ó BIOS ¤¤Â_ªA°Èµ{¦¡«á¡A·|°±¤U¨Óµ¥¨Ï¥ÎªÌ«ö¤U¤@­ÓÁä¡A·í¨Ï¥ÎªÌ«ö¤U¤@­ÓÁä«á¡AAH ·|³Q¦s¤J³o­ÓÁ䪺±½´y½X¡AAL ·|¦s¤J³Q«ö¤UÁ䪺 ASCII ½X¡C

¨ú±o¨Ï¥ÎªÌ«ö¤Uªº¼Æ¦r¤§«á¡AÁÙ±o¸g¹L³B²z¤~¯à¦¨¬°¿é¤Jªº¤Q¤»¶i¦ì¼Æ¡CÁÙ°O±o¦pªG¦³¤@­Ó¤Q¤»¶i¦ì¼Æ 021Bh¡A¨ä¼Æ­È´N¬O 2x162+1x16+11 §a¡H(¦pªG¤£°O±o½Ð°Ñ¦Ò¼Æ¦r¨t²Îªºµù¤@¡C)§Ú­Ìªº³B²z¤èªkÃþ¦ü¤W­±¡A¨C·í¿é¤J¤@¦ì¼Æ¦r®É¡A­ì¥ýªº¼Æ­È­¼¥H 16 ´NÅܦ¨¤Q¤»¶i¦ì¤F¡C¦³Ãö¤Q¤»¶i¦ìÂà´«¦¨¤Q¶i¦ì«e´X³¹¤w»¡©ú¡A´N¤£ÂØ­z¤F¡C

­ì©lµ{¦¡¦Cªí

·í§Ú­Ì«ö¤U¥ô¦ó¤@­ÓÁä¡A¹q¸£·|§â¸ÓÁ䪺±½´y½X¤Î ASCII ½X¤À§O°e¨ì AH¡BAL ¼È¦s¾¹¡A¦Ó§Úªºµ{¦¡´N¥i¥H¨ú±o¿é¤Jªº¤å¦r¤F¡Cµ{¦¡¦p¤U¡G
;***************************************
code    segment
        assume  cs:code,ds:code
        org     100h
;---------------------------------------
start:  jmp     short begin
hex_n   dw      ?
begin:  sub     bx,bx   ;08 ¨ÏBX¬°¹s¡A¥HÀx¦s¿é¤Jªº¤Q¤»¶i¦ì¼Æ
next:   mov     ah,0
        int     16h     ;10 ©I¥sBIOSÁä½LªA°Èµ{¦¡
        cmp     al,'='  ;11 ­Y¿é¤Jµ¥¸¹ªí¥Ü­n¶}©lÂà´«¤F
        je      ok1
        mov     dl,al   ;13 ±N¿é¤JªºASCII½X¦s¤JDL¥H§Q¦L¦b¿Ã¹õ¤W
        cmp     al,'0'  ;14 Àˬd¿é¤JªºASCII½X¬O§_¬°ªü©Ô§B¼Æ¦r
        jb      next
        cmp     al,'9'
        ja      alpha   ;15 ­Y§_¡A«hÀˬd¬O§_¬°A¨ìFªº­^¤å¦r
        sub     al,'0'  ;18 ´î¥h30h¡A¥H±o¨ì¤Q¤»¶i¦ì¼Æ
        jmp     short ok0
alpha:  and     al,0dfh ;20
        mov     dl,al
        sub     al,37h  ;22 Àˬd¬O§_¬°A¨ìFªº­^¤å¦r
        cmp     al,0ah
        jb      next
        cmp     al,0fh
        ja      next    ;26

ok0:    push    ax      ;28 
        call    ok      ;29 ¦b¿Ã¹õ¤W¦L¥X¿é¤Jªº¦r
        pop     ax
        mov     cl,4    ;31 ±NBX­¼¥H16d
        shl     bx,cl
        cbw
        add     bx,ax   ;34 ¨ÏBX¥[¤W¿é¤Jªº16¶i¦ì¼Æ
        mov     dh,bh   ;35 Àˬd¬O§_¶W¹LBX®e¶q
        and     dh,0f0h
        jnz     ok1     ;37 ¶W¹L¤F
        jmp     next    ;38 ¨S¶W¹L

ok1:    mov     dl,'h'
        call    ok
        mov     dl,'='
        call    ok
        mov     hex_n,bx
                        
        mov     cx,10000;46¶}©lÂà´«¦¨¤Q¶i¦ì¼Æ
        mov     ax,hex_n
        sub     dx,dx
        div     cx
        xchg    ax,dx   ;50 AX=°Ó¡A¬G»PDX¥æ´«
        mov     bx,ax   ;51 ¦L¥Xªü©Ô§B¼Æ®É·|¨ÏDX¼Æ­È§ïÅÜ¡A¬G¾l¼Æ«O¦s©óBX
        call    print   ;52 ¦L¥X¤Q¶i¦ìªº¸U¦ì¼Æ

        mov     ax,bx
        sub     dx,dx
        mov     cx,1000
        div     cx
        xchg    ax,dx
        mov     bx,ax
        call    print   ;60 ¦L¥X¤d¦ì¼Æ

        mov     ax,bx
        sub     dx,dx
        mov     cx,100
        div     cx
        xchg    ax,dx
        mov     bx,ax
        call    print   ;68 ¦L¥X¦Ê¦ì¼Æ

        mov     ax,bx
        sub     dx,dx
        mov     cx,10
        div     cx
        xchg    ax,dx
        mov     bx,ax
        call    print   ;76 ¦L¥X¤Q¦ì¼Æ

        mov     dx,bx
        call    print   ;79 ¦L¥X­Ó¦ì¼Æ
        mov     dl,'d'
        call    ok

        mov     ax,4c00h
        int     21h
;---------------------------------------
;print °Æµ{¦¡
;¿é¤J¡GDL-¥Ñ 0 ¨ì F ªº¤Q¤»¶i¦ì¼Æ
;¿é¥X¡G¦b¿Ã¹õ¤W¦L¥X DL ¤ºªº ASCII ½X
print   proc    near
        add     dl,30h  ;90 ¥[¤W 30H
        cmp     dl,'9'  ;91 ¤ñ¸û¬Ý¬Ý¬O§_¶W¹L 39H
        jbe     ok      ;92 ¨S¶W¹Lª½±µ¦L¥X
        add     dl,7    ;93 ­Y¶W¹L¦A¥[¤W 7
ok:     mov     ah,2    ;94
        int     21h     ;95 ¦L¥X
        ret
print   endp
;---------------------------------------
code    ends

;***************************************
        end     start

²£¥Í¨Ã°õ¦æHEX2DEC2.COM

±N¥¦¥Î¤å®Ñ³B²zµ{¦¡¦s¦¨ HEX2DEC2.ASM¡AµM«á¦bWin95/98/MeªºDOS¼Ò¦¡©ÎDOS¤¤¥Î§Ú­Ì©Ò«Ø¥ßªº§å¦¸ÀɨӲÕĶ¡B³sµ²¡AµM«á°õ¦æ¡G
H:\HomePage\SOURCE>hex2dec2 [Enter]
ABCDh=43981d
H:\HomePage\SOURCE>
·í§A¦b DOS ¤¤°õ¦æ³o­Óµ{¦¡( DOS ­n°õ¦æµ{¦¡®É¨Ã¤£¹³ Windows 9x ¤@¼Ë¥Î·Æ¹««ö¨â¤U¡A¦Ó¬O­n¿é¤Jµ{¦¡ªºÀɦW)¡A·|°±¤U¨Óµ¥§A¿é¤J¡Aµ{¦¡·|¦Û°ÊÀˬd§A¿é¤Jªº¬O¤£¬O¦b 0 ¨ì 9 ©Î¬O A ¨ì F ¤§¶¡¡A­Y¤£¬O«h¨S¦³¤ÏÀ³¡C³o­Óµ{¦¡³Ì¤j¥u¯àÂà´« 0FFFFh¡A©Ò¥H¦pªG§A¿é¤J¶W¹L¡A¤]·|¦Û°ÊºI¥h¡A¦pªG§A·QÂà´«¤p©ó 1000h ªº¼Æ¡A¥i¥H¦b¿é¤J¤T¦ì¤§«á«ö¡y=¡zÁä¡C

µ{¦¡»¡©ú

¦b¾ã­Óµ{¦¡¤¤¡A§Ú¥Î hex_n Àx¦s¨Ï¥ÎªÌ©Ò¿é¤Jªº¤Q¤»¶i¦ì¼Æ¡A¦]¦¹¦b²Ä¤C¦æ¥ý©w¸q³o­ÓÅܼơC¦]¬°³Ì¤j­n³B²z 0FFFFh ªº¼Æ¡A©Ò¥H­n¥Î¤@­Ó¦r²Õªº®e¶q¡A©w¸q¦r²Õ¥Î¡ydw¡z¡C¦b³o­Óµ{¦¡µLªk¨Æ¥ý¹w´ú¨Ï¥ÎªÌ¿é¤J¤°»ò¼Æ¡A©Ò¥H¥Î¡y¡H¡z¥N´À¡A¦pªG¦³³]©w­È¡A¤]¥i¥H¥Î¼Æ¦r¡CDW ³o­Ó«ü¥O¡A¨Ã¤£¬O¨Ï 8086 CPU °Ê§@ªº«ü¥O¡A¦Ó¬O²ÕĶ¾¹ªº«ü¥O¡A¬G¤]¬Oµê«ü¥Oªº¤@ºØ¡C

¦b¿é¤J¤Q¤»¶i¦ìªº¹Lµ{¡A¤p¤ì°¸¥Î BX ¼È®É¦s©ñ¤Q¤»¶i¦ì¼Æ¡A¦]¦¹²Ä¤K¦æ¥ý±N BX ²M°£Åܬ°¹s¡C²Ä¤E¡B¤Q¦æ¬Oµ¥¨Ï¥ÎªÌ¿é¤J¤@­Ó¦rªº BIOS ¤¤Â_ªA°Èµ{¦¡¡C

²Ä 11 ¦æ¨ì²Ä 19 ¦æ¬OÀˬd¬O§_¿é¤J¡y=¡z©Îªü©Ô§B¼Æ¦r 0 ¨ì 9 ©Î­^¤å¦r A ¨ì F¡A­Y¤£¬O¤W­±´X­Ó¦r´N¦^¨ì BIOS ¤¤Â_Ä~Äòµ¥¨Ï¥ÎªÌ¿é¤J¡A­Y¬Oªº¸ÜÁÙ­n¦L¥X¿é¤J¤°»ò¦r¨Ã§@³B²z¡C

³B²z®É±o¤À¤T³¡¥÷¨Ó§@¡C²Ä¤@¡A¦pªG¬O¡y=¡zªº¸Ü´Nª½±µ¸õ¨ì ok1: ¼Ð°O³B¡Aok1: ¼Ð°O¬O³B²z¤w¸g§¹¦¨¿é¤J«áªºµ{¦¡¡C²Ä¤G¡A¦pªG¬Oªü©Ô§B¼Æ¦rªº¸Ü¡A´N­n±N BX ªº¼Æ­È¥ý­¼¥H 16¡A¦A¥[¤W­è¿é¤Jªºªü©Ô§B¼Æ¦r(³o¸Ì¦³¤@­Ó 80X86 ·s«ü¥O CBW¡A½Ð¬Ý©³¤U»¡©ú)¡Aª`·N¡Iªü©Ô§B¼Æ¦rÁÙ±o¥ý±q ASCII ½XÅܦ¨¼Æ­È¡C²Ä¤T¡A¦pªG¬O­^¤å¦rªº¸Ü¡A­n¥ýÂà´«¦¨¤j¼g¡A±µ¤U¨Óªº³B²z¹Lµ{©Mªü©Ô§B¼Æ¦r¤@¼Ë¡C

­^¤å¦r¥À¡yA¡zªº ASCII ½X¬O 41h¡A¤G¶i¦ì¬° 0100 0001B¡Q¦Ó¡ya¡zªº ASCII ½X¬O 61h¡A¤G¶i¦ì¬° 0110 0001B¡A¨âªÌªº®t§O¥u¦b²Ä¤­­Ó¦ì¤¸¡A¤j¼gªÌ¬° 0¡A¤p¼gªÌ¬° 1¡C¬G±N¼È¦s¾¹ªº¼Æ­È©M 1101 1111B(=0dfh) §@ AND ¹Bºâ´N¯à±j­¢Åܦ¨¤j¼g­^¤å¦r¥À¡C

ok1: ¼Ð°O³B(²Ä 40 ¦æ)¨ì²Ä 43 ¦æ¬O¦L¥X¡yh=¡z³o¨â­Ó¦r¡C²Ä 44 ¦æ¥H«á´N¬O¦L¥X hex_n Åܼƪº¤Q¶i¦ì¼Æ­È¤F¡C

·sªº«ü¥O¡GCBW

³o­Ó 80X86 «ü¥O¬O§â AL ¼È¦s¾¹ªº¤º®e§ï¦¨ 16 ¦ì¤¸¡A¨Ã¦s©ó AX ¼È¦s¾¹¤¤¡A´N¬O convert byte to word ªº·N«ä¡C¥u¬O AL ¬O¤K¦ì¤¸ªº¡A­n¦p¦óÅܦ¨ 16 ¦ì¤¸©O¡H

CBW ¨Ì·Ó¥H¤Uªº¨âÂI³W«h¡G
²Ä¤@¡B¦pªG AL ªº³Ì°ª¦ì¤¸¬O 0 ªº¸Ü(§Y AL ¤p©ó 80h¡A©Î¬O²Ä¥|³¹µù¤@ªº¥¿¼Æ)¡A°õ¦æ¦¹«ü¥O¤§«á AH ·|Åܬ°¹s¡AAL ¤§­È¤£ÅÜ¡C
²Ä¤G¡B¦pªG AL ªº³Ì°ª¦ì¤¸¬O 1 ªº¸Ü(­t¼Æ)¡A°õ¦æ¦¹«ü¥O¤§«á AH ·|Åܬ° 0ffh¡AAL ¤§­È¤£ÅÜ¡C

·sªº«ü¥O¡GPUSH ©M POP

¦b²Ä 28¡B30 ¦æ¦³¨â­Ó·sªº 8086 «ü¥O¡A³o¨â­Ó«ü¥Oªº§@¥Î¬O©M°ïÅ|¦³Ãö¡CPUSH ¬O±N¸ê®Æ±À¤J°ïÅ|¡A¦P®É·|¨Ï SP ¼È¦s¾¹¤§­È´î 2¡A¨ä»yªk¦p¤U¡G
PUSH    ¼È¦s¾¹
PUSH    ÅܼÆ
¦]¬°¨C¦¸¶i¤J°ïÅ|ªº¼Æ³£¬O¤@­Ó¦r²Õ¡A¦]¦¹³o­Ó¡A±À¤J°ïÅ|«á¼È¦s¾¹©MÅܼƪº¼Æ­È¨Ã¤£·|§ïÅÜ¡C

POP ªº¥\¥Î©M PUSH ¬Û¤Ï¡A¥¦¬O¥Ñ°ïÅ|¨ú¥X¼Æ¨Ã¦s¤J«á­±ªº¼È¦s¾¹©ÎÅܼơA¦P®É¨Ï SP ¼È¦s¾¹ªº¼Æ­È¼W¥[ 2¡C¥¦©M PUSH ¤@¼Ë¡A¼È¦s¾¹©MÅܼƪºªø«×³£¥²¶·¬O¤Q¤»¦ì¤¸¡C¨ä»yªk¦p¤U¡G

POP     ¼È¦s¾¹
POP     ÅܼÆ
¦b¨Ï¥Î PUSH ©M POP ®É­nª`·N­nª`·N¡A³Ì¦n¯à¦¨¹ï¨Ï¥Î¡A¦]¬°¦pªG¦bµ²§ôµ{¦¡©Î°Æµ{¦¡®É¡A³£¥²¶·¨ì°ïÅ|¤¤¨ú¥X­nªð¦^ªº¦ì§}¡A¦pªG°ïÅ|¤ºªº¸ê®Æ¦³¿ù¡A´N·|³y¦¨·í¾÷¡C

²Ä 28¡B30 ¦æªº³o¤@¹ï PUSH ©M POP ªº¥D­n¥Øªº¬O«O¦s AX ¤ºªº¼Æ­È¡A¦]¬° ok: ¼Ð°Oªºµ{¦¡·|¯}Ãa AX ªº¤º®e¡C¦bµ{¦¡¤¤±`±`¥Î³oºØ¤è¦¡¨Ó«O¦s¼Æ­È¡C

·sªº«ü¥O¡GSHL

³o­Ó«ü¥Oªº»yªk©M SHR ¬Û¦P¡A§@¥Î¤]´X¥G¬Û¦P¡A¤£¦Pªº¬O SHL ¬O¨Ï¸ò¦b«á­±ªº¼È¦s¾¹©ÎÅܼƤº®e¦V¥ª²¾¡ASHR ¬O¦V¥k²¾¡C

SHL °£¤F¨Ï¼È¦s¾¹¤ºªº¤G¶i¦ì¼Æ¦V¥ª²¾¼Æ­Ó¦ì¤¸¥~¡AÁÙ¦³­¼ªkªº¥\¯à¡C¥¦¥i¥H¥ß§Yºâ¥X¤Gªº¾­¤èªº­¼ªk¡C¨Ò¦p·í»Ý­n±N AX ¤ºªº¼Æ­È­¼¥H 2 ®É¥i¥H¥Î

shl     ax,1

­n¨Ï AX ¤ºªº¼Æ­È­¼¥H 4 ®É¥i¥H¥Î

shl     ax,2

­n¨Ï AX ¤ºªº¼Æ­È­¼¥H 8 ®É¥i¥H¥Î

shl     ax,3

³oºØ±¡§Î¨ä¹ê©M§Ú­Ì¤Q¶i¦ì¬Û¦ü¡A¨Ò¦p·í 25 ¦V¥ª²¾¤@¦ì¡A´NÅܦ¨ 250¡C®t§O¥u¦b¤@­Ó¬O¤G¶i¦ì¡A¤@­Ó¬O¤Q¶i¦ì¡Cµ{¦¡²Ä 31¡N32 ¦æªº­ì²z´N¦b³oùØ¡C·íµM SHR ¤]¦³°£¥H 2 ªº¾­¤èªº¥\¥Î¡C

©Î³\±z·|°Ý¡A80X86 ¤£¬O¤]¦³ MUL »P DIV «ü¥O¶Ü¡H¬°¦ó¤£¥Î³o¨â­Ó«ü¥O©O¡H­ì¦]¬O³o¨â­Ó«ü¥O©Òªá®É¶¡¤Óªø¤F¡A©Ò¥H¦pªG­¼°£¤Gªº¾­¤è¼Æ¥Î SHL ©Î SHR ¸û¬°¨³³t¡C( DIV «ü¥O´¿¦b²Ä¤»³¹»P²Ä¤C³¹¤¶²Ð¡A¦Ü©ó­¼ªk«ü¥O½Ð¬Ý¥»³¹µù¤G¡C )


µù¤@¡GÁä½L¤Wªº¤@¨ÇÁä¡A¨Ò¦p Caps Lock¡BNum Lock¡BAlt¡Aªºª¬ºA¬O¥Ñ INT 16H/AH=2 ¨Ó¨ú±o¡Aµ²ªG¦s©ó AH ¼È¦s¾¹¤¤¡AAH ¦³ 8 ­Ó¦ì¤¸¨ä·N¸q¦p¤Uªí¡C
¦ì¤¸ ³]¬°¤@®É¤§·N¸q
0 «ö¤U¥kÃ䪺 Shift Áä
1 «ö¤U¥ªÃ䪺 Shift Áä
2 «ö¤U Ctrl Áä
3 «ö¤U Alt Áä
4 ¦b Scroll Lock ª¬ºA
5 ¦b Num Lock ª¬ºA(¼Æ¦r)
6 ¦b Caps Lock ª¬ºA(¤j¼g)
7 ¦b´¡¤Jª¬ºA

µù¤G¡G

MUL «ü¥O

80x86 ®a±Úªº­¼ªk«ü¥O¦³¨âºØ¡AMUL »P IMUL¡A«eªÌ¬O¥Î¨Ó­pºâµL¸¹¼Æ¡A«áªÌ«h¬O¥Î¨Ó­pºâ¦³¸¹¼Æªº¡C¦¹³B¶È¤¶²Ð MUL¡A¦Ü©ó IMUL ¥Îªk½Ð°Ñ¾\²Ä 35 ³¹¡CMUL ªº»yªk¦p¤U¡G

        MUL     ¼È¦s¾¹©ÎÅܼÆ

80x86 ªº MUL «ü¥O¥i¥H¥Î¨Ó­pºâ 8¡B16¡B32 ¦ì¤¸ªº­¼ªk¡A©Ò±oªº­¼¿n¤j¤pÀ³¬° 16¡B32¡B64 ¦ì¤¸¡A¤À§O¦s©ó AX¡BDX:AX¡BEDX:EAX ¼È¦s¾¹¤¤¡C·í«ü¥O MUL ©Ò±µ¹Bºâ¤¸¡A¼È¦s¾¹©ÎÅܼơA¤j¤p¬°¤K¦ì¤¸®É¡A´Nªí¥Ü¦¹¹Bºâ¬O AL ­¼¥H¦¹¤K¦ì¤¸ªº¼È¦s¾¹©ÎÅܼơA¦Ó©Ò±o¤§­¼¿n¦s©ó AX ¼È¦s¾¹ùØ¡A­ì¥ý AH ¤§­È·|®ø¥¢¡F·í MUL ©Ò±µªº¹Bºâ¤¸¬O 16 ¦ì¤¸®É¡A´Nªí¥Ü¬O AX ­¼¥H¦¹ 16 ¦ì¤¸ªº¹Bºâ¤¸¡A¦Ó©Ò±o¤§­¼¿n¦s©ó DX:AX ¼È¦s¾¹ùØ¡A­ì¥ý DX ¤§­È·|®ø¥¢¡F·í MUL ©Ò±µªº¹Bºâ¤¸¬O 32 ¦ì¤¸®É¡A´Nªí¥Ü¬O EAX ­¼¥H¦¹ 32 ¦ì¤¸ªº¹Bºâ¤¸¡A¦Ó©Ò±o¤§­¼¿n¦s©ó EDX:EAX ¼È¦s¾¹ùØ¡A­ì¥ý EDX ¤§­È·|®ø¥¢¡C¾ã²z¦p¤Uªí¡G

­¼ªk¤è¦¡³Q­¼¼Æ ­¼¼Æ­¼¿n ½d¨Ò
¹Bºâ«e¹Bºâ«á
8 ¦ì¤¸AL8 ¦ì¤¸¼È¦s¾¹
©ÎÅܼÆ
AX AX=0105
BX=0106
MUL BL
AX=001E
BX=0106
16 ¦ì¤¸AX16 ¦ì¤¸¼È¦s¾¹
©ÎÅܼÆ
DX:AX AX=0200¡ADX=FFFF
BX=0106
MUL BX
DX=0002¡AAX=0C00
BX=0106
32 ¦ì¤¸
¥u¯à¥Î©ó
386µ¥¯Å¥H¤W
EAX32 ¦ì¤¸¼È¦s¾¹
©ÎÅܼÆ
EDX:EAX EAX=80000001
EDX=88887777
EBX=00000002
MUL EBX
EDX=00000001
EAX=00000002
EBX=00000002

¨Ò¦p¡A¦pªG­n­pºâ 9 ­¼¥H 8¡A¥i¥H¥Î©³¤Uªº¤è¦¡¡G

        mov     al,9
        mov     bl,8
        mul     bl

³o¬O¦]¬° 9¡B8 ³£¤£¶W¹L 255 ( ÁÙ°O±o§a¡H¤K¦ì¤¸ªº¼È¦s¾¹©Î°O¾ÐÅé¼e«×¥i¥Hªí¥Ü 0 ¨ì 255 ½d³òªº¥¿¼Æ )¡A¦]¦¹³Q­¼¼Æ¡B­¼¼Æ³£¦s©ó¤K¦ì¤¸ªº¼È¦s¾¹ùØ¡A¦ý¬O¨Ì¾Ú 80x86 MUL »yªk¡A³Q­¼¼Æ¥u¯à¥Î AL¡A©Ò¥H²Ä¤@¦æ¬°¡ymov al,9¡z¡A¦Ü©ó­¼¼Æ¡A8¡A¥i©ñ©ó¥ô¦ó¤@­Ó¤K¦ì¤¸ªº¼È¦s¾¹¡A¦p AH¡BBL¡BBH¡K¡K³£¥i¥H¡A¤]¥i¥H©ñ¦b¥H DB ©Ò©w¸qªº¤K¦ì¤¸°O¾ÐÅéÅܼÆùØ¡A³Ì«á¦A¥H«ü¥O¡ymul bl¡z­pºâ¡A©Ò±o­¼¿n·|¦b AX ¼È¦s¾¹ùØ¡C

MUL «ü¥O¤@¯ë¥Î¦b¹ïµL¸¹¼Æªº­pºâ¡AµL¸¹¼Æ©Ò«üªº´N¬O¥¿¼Æ¡A¦pªG­n­pºâ¦³¸¹¼Æ¡A½Ð°Ñ¦Ò²Ä 35 ³¹¡C


¦^¨ì­º­¶¡A ¨ì²Ä¤C³¹¡A ¨ì²Ä¤E³¹