architettura degli elaboratori 11 - il livello isa - unibo.itdallago/ae0607/11_livelloisa.pdf ·...

47

Upload: phamnguyet

Post on 18-Feb-2019

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� �� ������ ��� � �� ��� � ���� ���� � �� ��� � ��� ���

��� �� � ����

���� ! �"#$!% & � '( �#$)# &# **+,$-% "�) �% $#.$�/# 0 �!1 &#2 *� '!3& � & � 4% *%2$�

5 66� 577�89 : ;7� <==>?<==@

Page 2: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

��������

�6� �� 8 �� ;� 69 � � �;�9 ��� ��5

�� 6� ��: ;7� 89 � �;�9 ��� ��5

; ; 8 ; ��� ;

�� �:�� ; 8 �� � ��� ;� 69

�68 ;�;��� :9 6��

; ; 8 ; � � ��� ;� 69

�� 6� �� ��� 89 � � �� �

Page 3: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ��� � ��� ���

I�� �;�9 ��� ��5 ; � ���� � �� ;� �;�9 ��� 89 ��� : ;7 ����7� ;�9�� ��� 9� �9 ��� 89 � ; �9 :� � 9 ��� ;�� �

I�� �;�9�� 6�� 89 � �;�9 ��� ��5 8 ;9 689 � � �� ��� �� �� � 8� � ����� 8 ;7� � ;� � ;�9 ���� �� �� � � �� ���8���9 9 ������9 �

I ���� ���� ���� ���� � �� ���� ���� � � � � ��� ���� ��� � ����������� � � !���"��� �� � �� �� ##� ��� #�� �� ���� $I % ���� ����� � ���� � �� ���� ���� � � � � ��� ���� ��� �� ��� �� �� �� �� ��&'()*&& + ,� ��� ��� ���� ����� ���� � -*./+0(&*'+1 �� ���� �����

�� � ���� ��� %23 $I

�6 �;69� 8 ; �;67 ; ;� � �� ���9���� ;� 69 89 � �;�9 ��� ��5 7� ;6�� ��9 ;� ; ���9�� ; � ; ���8���9 7�9 ; ���9�� ; � ; 89 ; 7� : ;���� �;�

I %� ���� � � 4 �� ��� � ����� � � ��� �� ��� �� �� ����� %23'5&'*-*./(&+6+05 � � � �� %23 ��� ��� �� � $I 7� #�� � %23 ��� �� ##� ��8 ���� �� ��� ���� � � ��� ��9 �� �� !�

����� ���� �� +./05.5:&(&* 5; -+5:&5.5:&5 � � �� �� ��� ������� �� � � < �� ��� $

I =>� �� �� ����� 4 � � ��� ���� �� ��� �� ���� �#����? � � -*./+0('55; -+5:&5.5:&5 �� � � � � � ��� ���� ��� �� � ���� ���� �� !� � � ����������� ��� $

Page 4: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ��� � ��� ��� ���� ���� ����� �� � �� �� � � ����� �� � ���� ���

Software

Hardware

Hardware

C program

ISA level

ISA program executed by microprogram or hardware

FORTRAN 90 program

FORTRAN 90 program compiled to ISA program

C program compiled to ISA program

Page 5: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ��� � ��� ��� �� �� ���� ����� �� ��� � ������ � �� �� ���� ���

I�� �;�9 ��� ��5 � ;� �;:� �;�9 ��� ��� �;7� �

I �� ��� ����:9 6�9 ; ��� ��: :��� �; �� ;�;��� 6� � �� �� ;��;6� ���� ;� 89 � �;�9 ��� ��5 �

I =>� �� �� ����� 4 !� � ���� �������� �� 4 ���� � ��� � �� #� �� ������ ��� %23 � � �� �� �? � !� <��� $

I�6 � �7�6; 7� ;� ;� �;�9 ��� ��5 � 97 ;�7��� ��� ���9 � � �68�7�:9 6�� �� �:� �9 8 ; 89� 6;� ;� 69 � 7� 6�9 6�9 ���� �� �� ��9 ���� ������ �� �

I ����� � �� ��� �� ��>� � !����� ��� 2�3 �� 4 �� �� ��� ��>� � !����� ��� ���� ��� � $

I�� :��� ;� � ���9 89 ; ��79 � �; � 8����� 8 ; 8 �9 :�8� �;�� 8 ;9 97�� ;� 69 � �� ��� ��� � �� � 9 �� ��� ��� � � �

I %� ���� ���? �� ��� � �� �� ���� ��#��� � ���� �� ��� ��9 �� �� $I %� ���� ���? ��� ��� �� � � ���� �#��� ���� � ���� ���� � � ���

��� ��9 �� �� $

Page 6: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� � ��� � ���� ���

I�� :9 :� �;� � �88 ;� ; � ;6 � �� ��� ��� � ���� �� 7� ;8 ;:9 6 ;� 69 � ��� �� �:9 6�9 ��; � � � ;� ����9 �� � � �� �9� �

I� ���9 �9 6�� 6� ���� ���� ; ;6 ��� �9 8 ; � � � �� �9 � �9 �:� 6;� ���9 ��� �9 9 ; �� 6� ; � ��� ;� 6; �� ;�9 � 7�9 9 ��;7� ;98� 6� 7�9 �9 ��� �9 ;� 6� ���� �

I %� ��� ��� ��� �� ��>� ����������� ������8 � �� �������� �� � ���� ������ � ��� �� ��� �� $

I�� �� � �� ��� ��� � � ��;6 ;9 :9 8 ; � ��� ; � �; ;68 ;�;�� ;�� ;�;���� ;�; 69 ; �;�9 �;:9 6� ; � ��� :9 :� �;� 79 6� �� �9 �

I�6 �9 69 �9 � 9 ; �9 �6 ����� �� ;� 89� �; ;68 ;�;�� ; ;6 �� 6;��7� ;�9�� ��� � �6 � ��9 �6�� ;�� � � ;� :� ��9 �9 �� ; 89� �; ;68 ;�;�� ;8 ; � ;6� ; 9 � �9 � �� ���� 9 9 � ; � � �

I�� � 6� 9 ; �9 �9 8 ;�9 � 9 � � ��� � �� ��� �� � � ; ��7�9 ;6 �9 9 6�� 8 ; : ;7 ����7� ;�9�� ��9 7� : �;7��9 � �� :9 :� �;��� 6� 6 ��9 �9 ;� 7� : � ��� :9 6�� ���9 � �

I =� �� ���� 4 � ���� �� �� !����� � � � ���� � ��� ������� ����� ������ �� 5'+( 0+��(&5 4 ����� ����� � ��� ������ � � ��� ������ � $

I =>� �� �� ����� 4 �� ������ � � ��� :*: )('5 ( 0-�:( �('(:� +( $

Page 7: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ��� ��

I5 �7�6; 89 ; �9� ; � �; 89 � �;�9 ��� ���� ��6�9 ;� �;�9 ��� ��5 � 6�� ; ;� ;�; � 67�9 � � �;�9 ��� ��5 9 � � 6� � � ;68 ; 9 9 �9 �� ;�;���� ;69 ��9 ; � ��� ;� 6;�

I� �9� ; � �; 89 � �;�9 ��� ��5 � 6� �88 ;� ; ;� ;�; ;6 8 �9 7��9�� �;9 �

I �5� + &'+ /5-+( 0+��(&+ 4 !� �������� �� �� ������� �� � ������ � 4 �� ���� ��� � ���� � � � �� �� ��� ��� �� ��� � �� � � < ��9 �� ����� �8 !� $

I �5� + &'+ ) + � * �5:5'( 05 4 !� � ��� ��� �� � ��� ����� � �� �9 �� ���� � � � � �� � �� ����� #��� �� � �� ��� �� �� ��� �� � $

I5 �7�6; � �� ; �9� ; � �; 8 ; � � �9 69 �� �9 � � 6� ��9 �9 ��� �;��� ;7� ���; 69 ���9 97�� ;� 69 89 ��9 ; � ��� ;� 6;�

I �� � ������� 4 �� ��� ��� �� � � ��� �� �� �� �� ��� �� ##� ���� ���>� �� �� ��� ����� ��� � � �� >��� ��9 �� �� ������� � � $

I � ; �� 6� �6 79 ��� 6�:9 �� 8 ; �9� ; � �; 97 ;� �;���� ; �779 ;� ;�; � �� ;6 :�8� �;�� �9 �69 ��

I�6 9 9 : ;� � ;� 7� ;889��� � � �� � � 89��� �67�9 ������� ��: ��� � �� �8 � � 7�9 7� 6� ;9 69 � �7�6; � ;� � �� ; � �� �; ;7� ;889�� ; ��� �� � � � ���� � ��� �

Page 8: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� ��� ��� � � ��� � ��� ��� � � ���� ��� �

I� ���5 �� ;�;����� 69 � �� 79 ��9 �9 6� ;�: � �9 ;6 � ��� ; ; �� ;�6�9 6�� ; � ��� ;�9 8� ����=��>� � 7� ;� :��� ����� �

I� ��5 ��< :�6� ;9 69 �6 7� : �9�� �� ��� 9 � ��9 97�� ;� 69 8 ;��� ��: : ;� 7 �;�� ; 69 � �;6� ���� ;� ��5 89 � ��79 � �9 �=�� �

I�� ��79 � �9 �9 6� ;�: � � 8����� 8 ; � �9 :�8� �;�� � 9 ��� ;�9 �

I � .*)(0+& '5( 05 4 �� �� � ���� �� � ����� ���� � !� ��� ��������� �� �>���� �� �� � ����� ����� $

I � .*)(0+& +'�&(05 ���� 4 !� � ��� ��� � � ���� ���� �� !����� ���� � �� ��>���� �� ���� �������� $ ��

I � .*)(0+& /'*&5&&( 4 �� �� � ���� �� < ��9 �� �� ���? �� � �� �� ���� �� �� � �� �� ��#��� $ �� ���� �� � ���� ��� � � ���� ���� � 4 �� � ���� ��� �,�� ���99� #��� �� �� �� � � ������ � �� ��� ���1 � � ���� ��� � ,�� ���99����� � ���� ���� � ��� ���1

I�� �� ;� 89� �; ;68 ;�;�� ; � �88 ;� ; � ;6 <�� 9� :9 6� ; 8 ; <�� ���97 ;� 7�6� �

I � ���� �� � ����� �� � � ����� � � �� ��� �� � � ���� ��� �� �� ���������� $

Page 9: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� �� ��� �� � ���� ��� �� � � ���� ��� �

EAXALAHA X

EBXBLBHB X

ECXCLCHC X

EDX

ESI

EDI

EBP

ESP

DL

CS

EIP

EFLAGS

SS

DS

ES

FS

GS

DHD X

8816Bits

Page 10: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� ��� ��� � � ��� � ��� ��� � ���� �� ��� �� �� � � �

I�6 � �;� ;69 ����7� ;�9�� ��� ��5 �� 9 �� �6 ���7� ;�9�� ��� � �< � ;� �:� 8� ��� �9 � ;� 69 � ; � � �� ; �8 �6 ���7� ;�9�� ��� � >� � ;� �

I�� �� ;� 89� �; ;68 ;�;�� ; � 7� � ;� � ;�� 8� <�� ���9 �

I� ���� ����5 �� �� � �� 8 �9 � �� ; 8 ; �9� ; � �;�

I �� ��� ��� �� � � ��� �� �� �� �� �� �� #�� 4 !����� � �� 4� 4$ $ $ 4� $I �� �� � ���� �� ��#��� $

I� �9� ; � �; 8 ; � � �9 69 �� �9 � � 6� � �:9 �9 6� : ; 8 ;�9 � ;� 7�9 �;�� 66� 8 ;�9 6���9 �9� ; � �; 97 ;� �;���� ;�

I �� � ������� � ��� ��� �� �� 4$ $ $ 4� � ��� ����� � ��� ��� �� ���� 4$ $ $ 4� � �� ��� �� �� ���99�� � �� � �� ������� �� �� � �� ����� �� $

I� ���7� ;�9�� ��� ��� ����5 �� ��� � �6 ���7� ;�9�� ��� �� ���� � �6� �� �9 ��� �9 � 69 ��� ;�;�� � ��� � �9 �6;7�9 8 �9 ; � ��� ;� 6; 7�9�7798� 6� � ��� :9 :� �;� � 6� ���� 9 ����� �

Page 11: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� �� � � ��� �

I�9 � 9 ��� ;� 6; 8 ; :�6;� ��� ;� 69 89 ; 8�� ; :9 9 � 8 ; � ;� ;� 698� �6 ;6 � ��7� ;� 6� 9� � �:� 6� 7�9 �9 9� �9 6�9 8 ; � ;�7� 6�9 6��9 69 ; �9� ; � �; � ;6 :9 :� �;� 7� 8 ;�7� ;6� ; 8�� ; 97� 68� 7�9 : ; �9 6 �97 ; ;�

I %� ������ �� ��� �������� � � & +/* ) + )(&* $I � ; �� 6� �;:� 8 ; � ���� ; � � � � � � ��� ��� �� 7�9 9 ��� 6� �

���9 9 6���9 6�:9 �;�I ���� ���� ��� �� ���� �� -*: 5�:* ������ 5:�( 5�:* $I ���� ���� ��� �� �� !� ���� �� �� +'�*0( .*6+05 $I �� ��� ��� � � �� ���99� �� � !�� � � � �� �8 � ������ �� ��� �� �� ������� � !��� ��� $

I � ; �� 6� � ; ; � � � � � � ��� ��� ��� �� 7�9 9 ��� 6� ����9 9 6���9 7�����9 �;� 9� �9 6�9 8 ; 7�����9 �; �7�9 �9 6�� 6�89��9 ���� � � �� �� �; �� � �9� 6;�

I 2 � ����� �� �� � ������� �� ������ ����� �� �� �� �� #�� ��� ��� ��� ��� � #��� $ �������� �� �� � ��� � � 6+& .(/ $I 7� � �� �� � ��� � � ���� �� � ���� �� � � �� /�:&(&*'5 $ %� � �� ��

���� �� 4 � � ���� ������ �� ��� �� �9� � � #�� ��� �� ��� ���99� $

Page 12: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ���� � ���� ��� ����

I�6 �; � ��� ;� 69 7� 6 ; �9 ;6 �6 ���� �� ��� �� � � ��� � �9�9 6� �� �:9 6�9 7� ��98��� 8� � � ������ ����� 7�9 9 ��� 6� �89�9 �: ;6��9 � �� �9 ;� 6� ; 8�� ; 7� ;6�� �� ; 69 ���� 9 ��� ;� 69 8�9 9� � ;�9 �

I�9 ; � ��� ;� 6; � 6� ���9 9 6���9 � �� : ;�9 9� �9 6�9 8 ; � ;� �

I %� � � ��� �� !��� 4 � ���� �� ��� ��9 �� �� !���� �� ���������� !�99� $

I %� � �� �� 4 ���� ���� ��� �� ��� ��9 �� �� � � ���� !�99� � ��� ��� $I

�6 �9 69 �� �9 � �� ��6� �9��� 8 ; �6 �; � ��� ;� 69 �� 9 9 �9 :��� ;� �9 ��� �� �9 � : ;6� �9 89 ��� 8 ;:9 6 ;� 69 8 ; �6� ��� �� �

Instruction

Instruction

Instruction

Instruction

(a)

1 Word

Instruction

Instruction Instruction Instr. Instr.

Instruction

Instruction

Instruction

Instruction

Instruction

Instruction

(b)

1 Word

Instruction

Instruction

(c)

1 Word

Page 13: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� �� �� � �� ���� � ���� ��� �� ��

OPCODE

(a) (b)

(c) (d)

OPCODE

OPCODE ADDR1 ADDR2 ADDR3OPCODE ADDRESS1 ADDRESS2

ADDRESS

Page 14: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� ���� �� � �� ��� �� �� �� � � �� ���� � ���� ��� ����

I��;:� 8 ; � ���� � � 77� ��9 �9 69 �9 �9 9 6�9 7�9 � �� ���� �� ���� �� ��� ��� � � �� ���� ���� �

I ����� ������ �� � ����� �� �� �� ��� ��� ��9 �� �� ����� � ����� �������� � ��� �� �� �� �� � ���� ����� �

I =>� �� �� ����� 4 ��� ��9 �� �� ��� � ��� ��� �� ##� �� ��� � ��� �� ���� �� ��� �� �� �� �8 � �� � �� ��� �� ��� ��� $

I � �� �� !�99� � � #���� �� ��� ������� ,� �� ��� � !�1 �� �������� �� �� ��� #��� ��� � � $

I�� ;� ;� �� �:��� 89 ��9 ; � ��� ;� 6; 89�9 9 9 �9 ���9����� ;6 :� 8�8� �9�989 �9 �� ��� �� � � � � �� � �� � � ���9 �9� 9 ��� ;� 6; 6979 ��;9 � �67�9 �9 69 68� 7� 6�� 8 ; � ;� ;�; � ;�� ;��� ��;�

I 2� �� � �� ��9 �� �� �� �� � 4 �� ���� #���� �� � � �� � � � �� ��� �� ����� !� � ����� d ��� �(�)e $

I �77� ��9 ;6� 69 89�9 �: ;6��9 ;6 :�8� � � �� �6� ;� ��� �� � �� � � � �� � �� ������ ���� ��� �� �7� :9 �89 9 : ;� �� �; ;68 ;�;�� ; 89� �; � 9 �� 68 ;� �

I 7�� � �� ��� �� '+ *0�� +*:5 ) + .5.*'+( � � ���� � � ���99� � ���� ���99 � ��� ���� !� ,� � ���� � � � ��� ��9 �� �� ��� ���� !�1 $

Page 15: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ��� � �� ��� �� � ����� � ���

I� ; ��� �6� ��6� �9��� � 9 � �9 ; � ��� ;� 6;� � ;� :� 897 ;89 �9 8 ;��� �;�� ;�9 � � ;� � ���� 7�89 9 � � ;� �� �; ;68 ;�;�� ; �;6 :�8� �� �97�9 �

=�

+� � �

I =�� ���� ��� � 4 � �� ������� �� ���� �� � � ��� ��9 �� ���� ������ ���#��� 4 �� �� �� � �� ������� � � �� ������� ������ ��9 �� �� � � ������� $

I���� � �;�:� � �� ;� 7� 679��� 8 ; ��� �� � � ��� �� �� ��� �� : ;�9 �6 9 : �;79 9 9 : ;� �

I 2���� ����� � � ���� ���� � � ��� ��9 �� �� � �� #�� 4 � ��� �� �� � �� �#�� �� � �>� � ��� 4 � � �� ��� ���99 � �� � #�� �

15 13 10 8 6 4 2 014 1112 9

Opcode

7 5 3 1

Address 1 Address 2 Address 3

I %� ������ ���� 4 ��� ����� ��� �� �� �� �� = �� � � ��� � ��� �� � $I 2���� ����� 4 �� �� 4 � � ��� �� #���� �� � � �� ��� ��9 �� �� � � � ��

� �� �� �� �4 �� � � � �� � �� �� �� �4 � � � � �� � �� �� ��� � �� �� �9�� � �� � �� �� ��� $

I ���� ���� �� ��� �� � � � ������ �� �� ���� !�99� �� ��� ��� ��9 �� ������ ������ � � �� � � � �� ��� �� � �� ���� �� � � #�� ����� #��� $

Page 16: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� � ��� � ����� � ���

00004-bit opcode

15 3-address instructions

xxxx

16 bits

Bit number

yyyy zzzz0001 xxxx yyyy zzzz0010 xxxx yyyy zzzz

1100 xxxx yyyy zzzz1101 xxxx yyyy zzzz1110 xxxx yyyy zzzz

11118-bit opcode

14 2-address instructions

0000 yyyy zzzz1111 0001 yyyy zzzz1111 0010 yyyy zzzz

1111 1011 yyyy zzzz1111 1100 yyyy zzzz1111 1101 yyyy zzzz

1111 1110 1110 zzzz1111 1110 1111 zzzz1111 1111 0000 zzzz1111 1111 0001 zzzz

111112-bit opcode

31 1-address instructions

1110 0000 zzzz1111 1110 0001 zzzz

1111 1111 1101 zzzz1111 1111 1110 zzzz

111116-bit opcode

16 0-address instructions

1111 1111 00001111 1111 1111 00011111 1111 1111 0010

1111 1111 1111 11011111 1111 1111 11101111 1111 1111 1111

15 12 11 8 7 4 3 0

……

……

Page 17: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ���� � � ��� ��� ��� �� � � � ���� ��� �

I�9 ; � ��� ;� 6; 89 � �9 6� ;�: � �� 66� �6 �� �:��� :� ��� 7� : �9 �9 ;��9�� ���9 �

PREFIX

INSTRUCTION

Which operand is source?

Byte/word

SCALE INDEX BASE

MOD REG R/M

OPCODE MODE SIB DISPLACEMENT IMMEDIATE

0 - 5

6 3321Bits Bits

332Bits

Bytes

1

1 - 2 0 - 1 0 - 1 0 - 4 0 - 4

I � ; � 6� � �� �� � � � �� � �9 � 9 9 : ;� � 69 ��9 ; � ��� ;� 6;7� 6 8 �9 � 9 ��68 ;� � � ;� �6� 89� �; � 9 �� 68 ; ; � ���� ;6:9 :� �;� �

I� ;6�� �; � ;� 89� �; � 7� 89 8�66� ��� ������ ���� �;� ���8��� � ���� ��� 89 ��9 ; � ��� ;� 69 � � 77� ��9 897�8 ;�7��97� : �9�� :9 6�9 ��� 7� 89 9 � 7� ;�9 � �� �9 ;� �� ��6� �9��� 89 ��9; � ��� ;� 6;�

I � �� �� ��� /+� -*./0+-(&* �� ��� � �� ������ �� ��>��� ��9 �� ���� ��� ��� $

Page 18: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ���� � � ��� ��� ��� �� � � � � �� ��� �� �� � � �

I� ���5 89 ������ �����7 � � � 7� 6� ;9 69 9 7 �� ;�� :9 6�9 ; � ��� ;� 6; 8 ;�< � ;� �

I�� ��5 �� � �;� ;6� �9 8 ; � 69�� 8 ; � �; 7 ;6� �9 �� �:�� ; 8 ;; � ��� ;� 69 �

PC-RELATIVE DISPLACEMENT CALL4

302

PC-RELATIVE DISPLACEMENT BRANCH3

222

A

1

OP

3

COND

4

IMMEDIATE CONSTANT SETHI2

222

DEST

5

2 5 6 5 1 8 5

OP

3

Immediate1b DEST OPCODE SRC1 1 IMMEDIATE CONSTANT

3 Register1a DEST OPCODE SRC1 0 FP-OP SRC2

Format

I ��� ; 69 � ;�:� 7� 6���9 � �:9 6� � � �I

� �;: ; < � ;� 7� 67� ��� 6� � 89�9 �: ;6��9 ;� �� �:��� 89 ���; � ��� ;� 69 �

Page 19: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� � ���� � �� �����������

I��� ��� ��� ���� � � �

I �� ��� ����� � � ��� ��9 �� �� ���� ����� �� �� � �� �� ��� 4 � ��� �����>*/5'(:)* &5 * � �� � �� � �� ��� ���99� ,� � �� ���� �� � �� ����<� ���9 �� ��1 $

I �� � � �� ��� ��� ���� ��� �� �� ��� ��� �� 4 ��� ����� �� �������� ����� �� >��� ��9 �� �� ��� ��� � �

I��� ��� ��� � ��� �

I >� �� �� ��� � ��� �8 ��� � ��� ��� �� � �� +:) +'+��* -*./05&* $I 2� ��� �� �� �� � ��� �� � ����� #��� � �� #� �� $

I��� ��� ��� � � �� �

I �� � ��� �� ��� ��� ��� �� � � � ��>��� ���99������ � ������ 4 �� � ���� �8 � �� ��� ��� �� ���� � !� �� ��� ���99� � � ������� $

I >��� �9 �� �� �� ��>��� ��9 �� �� �� �? �� ��� �� �� � $I

��� ��� ��� � � �� ��� ���I >� �� �� ��� ���� �� �� � � � ������ � ��� ������� 4 �� �� � ��

��� ���99� � � ��� ���� �� �� ��� ��� �� ��������� !��� ��>��� ��9 �� �� $

I %� ������ ��� 4 �>��� ���99� ��� ��� �� ���� � � /�:&(&*'5 $I 7�� ���� ���? � � ��� ���99������ �� � �� �� �� ��� � ��� �� ��� �� �

� ��� �� � ���� �� � � ������� � � ��� ���99 � � ��� ��� �� � $

Page 20: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� � ���� � �� �����������

I��� ��� ��� ��� �� � � �

I >��� ���99� �� ��>� �� �� ��� � � ��� �� �� �� ��>��� ���99� � ��� ���� ���� ��� ��� �� 4 �������� �� ���� ��� /+(��(.5:&* 4 � ��� �������� � �� ��>��� ��9 �� �� $

I 3� ������� 4 �� ��� ��9 �� �� ������ � ����� � � %�� �� ���99� ���>��� ���99������ ��� � �99��� $

I 7� � �� �� ������� � �>��� ��9 �� �� ��� �� � ��� I

��� ��� ��� ��� �� � � �� �I >��� ���99� �� ��>� �� �� ��� � � ��� �� �� �� ��� ����� ��� �� ��� ���99 � � ��� ��� � �� � �� ��� ��� �� � �������� �� ���� ���

/+(��(.5:&* 4 � ��� ���� �� ��>��� ��9 �� �� $I

��� ��� ��� � �� �I 2 � �� ���99� �� ���� ��� � � ������� #����� �� ��� ��� � �

�>��� ���99� ��� �� � �� �� �� � � �� ��� �������� ���� �� ����� $I >��� ���99������ � ��� � ��� ���� �� ��� �� ��� �� ��� �� ����9 �� �� � �

�� ����� �� �� �� :*&(� +*:5 /* 0(--( +: 5' ( $

Page 21: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� ��� ��� ���� � � �� �� � � �� ��� �� � � �� ��� �� � ���� ��� �����������

I�9 ; � ��� ;� 6; 9 �9 :� 8� �;�� 8 ; ;68 ;�;��� :9 6�� 8�� �9��9 ���9 9 6���9 �6� ���� �� � � � ;6 7� ; � ��� ; � �; � 7� 897� 6 9 6��6� � ���9 �9 :� 8� �;�� 8 ; ;68 ;�;��� :9 6�� �

I 2 � ����� �� � ����� �� ��� � � *'&*�*:( 0+& �� � �� � � � �� ��� �� � ��� ��� ���� ���? � � ��� ���99������ $

I�6 9 9 : ;� 8 ; ���9��� 9 � ; �� �:�� ; 8 ; ; � ��� ;� 69 � ;� 9� �9 6�9 �

OPCODE OFFSET3

OPCODE DEST SRC1 OFFSET2 1

OPCODE DEST SRC1 SRC21 0

8Bits 5 5 5 81

I �9 � 7� � ;6 7� ; � �; � 9 �� 68 ; ;� 6� 8 �9 � ; �� �9��9 �� ;�;����9 ;��� �:��� 9� �9 6�9 �

OPCODE MODE

8Bits 3

MODE

3

REG

5

OFFSET

4

REG

5

OFFSET

4

(Optional 32-bit direct address or offset)

(Optional 32-bit direct address or offset)

Page 22: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� � ���� � �� ����������� � � ���� ��� � � � � �� ��� ���� ���

I� �;68 ;�;���:9 6�� � 69 � �9 6� ;�: � � � � � ; ��� �� �

I ����� �� ���� �� �� ���99��� �� ���� ���? ����� ���� 4 � ������ 4 ���� ��� �� 4 � ��� ��� �� ��� ������ 4 ��� ��� ���� ���? � >��� ���99��������� �� �� �� � � ����� �� $

I �*: &�&&5 �� ���� ���? � � � ���� � �� � � ���� �� ��� ��9 �� �� $I %� #��� ���� � �� �� ��� �� ���� ���? � � ��� ���99������ $I 7�� �� � � �� � �� �� �� � � ������ �� ��� ��� �� $

I�6 ��� ����5 �� � ;6�979 � ��;68 ;�;���:9 6�� � �9 ��� ;��:9 6�9� ��� �

I ����� �� ��� ��9 �� �� � � ���� ��� �� �� ��>��� ���99������ ����� ���� �� ��� ��� �� $

I >��� � � �9 �� �� � �� � ���� ���� � �� ������ ����� �� ��� ��� ��9 �� �� !� <� ��� ��<� ������� � ��� ������� ,���� 4 ����� ��� >��� ��9 �� �� �� � �� � �� �� ��99�9 �� �� �� ��#������� ���� ���� ��1 $

Page 23: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

��� ��� ��� � � ������ ������� ��� �

I�6� 89 ��9 � 9 ��� ;� 6; �� 68� :9 6�� �; � �� 7� ;� 8 ; �6� 9� �9 6��8 ; � ;� 8� �6� �� 7�� ;� 69 �8 �6 �� �� �� � 7�9 7� ;� : ;�:� � � ����� �

I� 8�� ; � � 6� ���9 6;�9 8� �� � �� � �:9 :� �;� � �9� ; � �;�98 9 9 �9 89 � ;6�� ; � �� ��� ���� �:9 :� �;� � �9� ; � �;� � � ; � 6� � ���� �� � ; ; 8 ; � �� �9 �;:9 6� ; � ;� ;�;�

I 3 � ��� �� !����� ��� � ���� ��� �� � � � ���� �� ��� ��9 �� �� � ��� ��� $I 3 �� �� !���� ��� �� �� ��� ��9 �� �� $I 3 �� �� �� ���99� �� ���� �� � � ���<� ���� � ��� � �� ��� ������� � �

��� ��� �� 4 ����� �� � � ���<� ���� � ��� � �� � ��� ��� �� � ��� ������� ����� �� � � � ���<� ������ � � �� � ��� ��� �� $

I�9 ; � ��� ;� 6; 8 ; � �� �9 �;:9 6�� 8�� ; 89�� 6� 97 ;�7��9 ;6 � �� �7�9:� 8� �� � �� 6� ;�� 8 ; 8�� ; 8� � �� �9 �;�9 �

I �� ��� ������ 4 � � � ���<� ��� � ��� ��� �� �9� � � #�� ����� � �������� ���� �� � � ������� $

I ��� !�99� � ��� ��� �� ��� �� ���� ��� � � ���� ��� � ��� ��� �� 4 � � !� ��� �� � !� �� !����� ��� � %2� ����� � � �� ��� �9 �� �� ����� ������ ��9 �� �� � � ���� ��� %23 $

Page 24: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� �� ��� ��� � � ������

I�9 � � ���� � �� �� ��8 �7� 6� �6 �; � ����� 8� ���7� : � ;6�� ;� 69 8 ; 8 �9 � 9 �� 68 ;�

I�� �9 � 9 ��� ;� 6; � ;6��;9 � ; � 6� 9 : �9 � 9 ��� ;� 6; ��;�:9� ;7�9 �7� :9 �� �� � ��� � �� � � ��� � �� �� � � ��� ��� 9 ��� �� � ��� �

I�� �9 � 9 ��� ;� 6; � ;6��;9 � ��� ;�:� �67�9 �9 � 9 ��� ;� 6; ��� ;7�9 �7�9 7� ��; � 68� 6� � ; 7� 669�� ;� ; 89 ���� ��9��� ��� �9�6� �

I� �� 9 ��� ;� 69 5�� � �� ;�9 9 � � �� �6� ���� 9� �9 6�� 8 ;� ;� 8� �6� ��� �� �

I 2���� ����� � � �� �� ��� ����� �� �� �9� #�� �� ��� ���� �� � �� #�� $I ���� ���� ��� ��� �� �� � ���� ��� ����� �

�� ��� ��� �� ������ ��� ��� �� ���� �� �� ��������� �������� �������� �������� ��������� �� ������ �������� �������� � 3 �= �

I� �� 9 ��� ;� 69 �� � ;6�979 � �� 9 9 �9 �� ;�;����� 9 ��� ��� � � ;� ;6 �6� ��� �� �

I �� �� ; ��7� ;�9�� ��9 �� ���6� �67�9 � 9 ��� ;� 6; ��;�:9� ;7�9 ;6� ;��� �� :� � ;�9 �

Page 25: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� �� ��� ��� � ������

I�9 � � ���� �� �� �� 8 �7� 6� �6 �; � ����� � ��� ;�9 8� �6 ;6�� �� � 9 �� 68� �

I�9 � 9 ��� ;� 6; 9 � �� �������� � �� �� ��� ��9 � � 89 � ��� �9 � � ;6 ; � ��� � 6� � 9 ��� ;� 6; �6��;9 9 � �9 9 6� ; ;6 ;����;� 6� ;�

I �� ��� � �� ��9 �� �� � � � � ����� ��� � #�� !� <�� ���� � �� �� ������� �� �� �� �� �� � $

I �� ��� � �� ��9 �� �� � � ����9 �� �� 4 � #�� !� <�� ���� � �� �� �� ������� ��� �� �� �� ��>� �� �� $

I � �; 7� ��;:9 6� ; �9 � � 89 � �� � 6� 9 � �� ;�;���� ; ;6� � 7 ;�� ;� 69 7� 6 ��9 �9 6 ;� 69 89 � 9� 6� �

I5 �;7�� ;� 69 89 ��� 7� ��;:9 6�� � 6� �� :� �� ; �;7�� ;� 6; 9 ��8 ;� ; ;� 69 9 � � � � � < �

I�9 � 9 ��� ;� 6; 8 ; 7� ��;:9 6�� � 6� � 67�9 �� ;�; 9 ���;: �77�9��� :9 6�� 9 �� �77�9��� :9 6�� 8 ; 9� �9 6�9 8 ; � ;� �

I5 �7�69 � 9 ��� ;� 6; � ;6��;9 � 6� 7� � � �9� �9 6�9 :9 6�9 ;6�� 7��97� 6 �6 79 ��� �� �� �9 9 � �6� 89� �; � 9 ��68 ; 7�9 � �� ��9 � �; ��58 ; � 6�� 6� 8 ; ; � ��� ;� 6; �6��;9 9 � �� ��9 ��9 ;� �9 �� 79 :9 6�9 �

I >��� ��9 �� �� ��� � �� ��� ���� � � ���� �� ��>��� ��9 �� �� ��� $

Page 26: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� ���� � � � � �� � ��� �� �� ��� �

I � 9 9 6� ;� �9 7�9 � ; ;� 6� ; � ��� ;� 6; 7��7 ; 8 ; � ��9 ���9 �� 9� �9 6�� 8 ; 9 97�� ;� 69 89 ��9 ; � ��� ;� 6; ;6 �� 9 � � �9 �;�7�� ; 8 ;79 ��9 7� 68 ;� ;� 6;�

I �� ��� 9 � � 9 ; �9 �6 �; � ��� ;� 69 8 ; � ��� 7�9 9 � : ;6� �6�7� 68 ;� ;� 69 9 �

I 2� �� � �� �9 �� �� � 5 '+�-(&( 4 ����� �� �� �� ��� $I 2� �� � �� �9 �� �� :*: � 5 '+�-(&( 4 ����� � ��>��� ��9 �� ��

�� ��� ��� $I

�� �9 7� 68 ;� ;� 6; 7�9 �9 6�� 6� �� ;�;����9 ;� � �9� �9 6�9 :9 6�9 69 ; � �� ; ;67� 68 ;� ;� 6�� ;� � ; � ;� �� �� �9 8 ; �6 79 ��� � ;� ;6�9 �6� � ���:�77� ;6� �9 � 9 9 : ;� �6� 89 ; � ;� 89 � �9� ; � �� ��� � �

I �� � ������� 4 �� ��� �� !��� �� ��� �� � �� �� �� ��� �� ��� ��8 ��� � � � ��� � �� �9 �� �� � � ��� ���" $

I5 �� ��9 � �77� ��9 9 9� � ;�9 �6 � ��� � �� 9 ;� 7� 6� �� 6�� � �� 8 �9� 9 ��68 ; �� �6 79 ��� 9 ;�� �

I %� � � ��� �� � 4 �� � �< �� ��� � �� �� ���� ���� -*:&5 &�( 0.5:&5 ( 0 ( 0&* � � ���� � �� ���� �� >��� ��9 �� �� � � � �� � �� �� �� �$

I %� � �� �� �� � 4 �� ���� �� >(//* +&( + &'�� +*:5 � � � �< �� ��� !���� �8 � � � ��� #�� ���� ��� � ��� �� !��� ,�� � ������� ��� � !�#�� �� � ��� ��� �� ��� 1 $

Page 27: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

��� � ��� �� �� � ��� �� � �� � � ��� ��� � � �� �� ���

I�� ;�;��9 �9 :� �� ���� � ����� �� 9 ���� 7� :9 ;6� 6;: ;�

I � ; �9 9 : �9 � �:9 6� �6 �; � ��� ;� 69 9 � ������� ��� 8 ; �6��� 798 ��� � 7�9 � �� �9 �; 79 ;� 7� 6� �� ��� � ��� �� 798 ��� �

I � � � ��� ��� ��� ��9 �� �� �� �? �� ����� ��� ��9 �� �� �� � � ��� �� ������ �� ��� $

I 2� �� ��>��� �9 �� �� �� ��� ��� �� ��� � � �� � �� �� �� >��� ��9 �� �� � �'+&*':* �� ��� �� ��� 4 �� �� ��� ��� ��� ��9 �� �� ���? � �� ��� !���� �� �>��� ��9 �� �� � � ���� �9 �� �� $

I � � ��� � ���� � !� � � ������� �� ��� !������ � � �� �� ��>��� ���99� �� ��>��� ��9 �� �� �� ��� ��� � ��� !������ 4 !� � �� ������� +:) +'+��* ) + '+&*':* $

I� �;68 ;�;��� 8 ; �;�� �6� �� 9 9 �9 � ����� ;6 ��99 8 ;�9 � 9 �

I %� ��� 0* -(� +*:5 ) + .5.*'+( � ( $I %� �:( 0* -(� +*:5 ) + .5.*'+( '5 0(& + ( ( 00( /'* -5)�'( $

2��� ##� �� �� �� ���� �#��� �� '+-*' +*:5 $I %� �� '5� + &'* �� ���� !� �� ��� �� ��� ������ ����� �� �

�� ��� ��� $I �� ��� &(-� 4 �� ���� !� � � ������� �� � ���� ��� ����� ���� ��

�� ��� ���� $

Page 28: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

��� ��� ��� � � � �� ��

I�9 � � 77� ��9 9 9� � ;�9 �6� 9� �9 6�� 8 ; ; � ��� ;� 6; �6 6�:9 ���9� ��� � 8 ; �� ��9 �

I 2 � ����� �� � ����� ��� � � �� -+- 0* ) + + &'�� +*:+ $I � ��� �� !����� ��� ����� �� � � ����� �9 �� �� ����� ��� ��� ��9 �� ��

�� � ��� ����� � �� $I � ; �� 6� � �� 6� ;� �:9 6�9 8 �9 �97 6;7�9 9 � 7� � �� ;�9 ; 7 ;7 �;

�� ;�;��� 68� �9 ; � ��� ;� 6; 8 ; � ��� �I � � �� -*: 5'+�-( )5 00( -*:) +� +*:5 +: &5 &( $I � � �� -*: 5'+�-( )5 00( -*:) +� +*:5 +: -*)( $

I�� �;:� 89 ; 8 �9 7�9 : ; � ;� 9� 7 ;9 6�9 89 � 97� 68� �69 � 9 6 �7�9 6979 ;�� 8 ; :9 6� ; � ��� ;� 6; � � �;�9 ��� ��5 � �

I �9 � 7� � 8 ; 7 ;7 �; 7� 6 �9 �;�7� 89 ��� 7� 68 ;� ;� 69 ;6 7�8� � ;� 7� ��89 � 7 ;7 �� � ;9 69 9 9� � ;�� � �:9 6� �6� �� ��� � �67�9 9 �

== �

Page 29: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

��� � ��� �� �� � � �� ��

��� � �� � �� � � �� ������ ���� � � � �� ���� � ���� �� �

����� ������ ����

��� �� ���� ���� ������� � � ��� �� ���� ������ ���� � ���� � � � ���� � �

���� � � ��� �

Page 30: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���

I5 � �;�9 ��� ��5 � 77� ��9 �67�9 ���9 ;6 :� 8� 7�9 ; ��� �� : : ;7� : �6;7� ;6� 7� 6 ; � �� � �� � � � ��� �

I

� ;� � �9 �� ;6 ��� ;7� ���9 ;6 :�8� �;�� �9 �69 ��I � ; �� 6� � �� 6� ;� �:9 6�9 � �9 7�9 : ; 8 ;�9 � ; 9 � ���?� �

�9 ��� ;�� :9 6�9 � � �;�9 ��� ��5 �I

��;:� 8 ; � ���� � � ;� :� ��9 �9 ;� 7� ;889��� ����� � �� � ��� �� �

I 7�� �� ��� ���9 ���� �>� �� ��9 �� �� � � %�� 4 �� ��7 ������� !��>� �� ��9 �� �� �##�� 8 �� 4 � �� �� ��� ��� �� � ��� ���� � � � � ������ ��� �� $

I � ��7 ����� � �� � ����� �� � ��� ����� �� (&&5 ( (&& + ( 4 �� ����� � ��� ���� �� ���� ��� �� ��� #���� � � ������ � !��� $

I�� ;� :� � ; ��9 �9 ��� �� ��� � ���� �

I 3 ��� 8 �� � � �� �� � �� ��9 �� �� � � %�� �� � �� ��� �� ��� ���� �� ������ ����� $

I � ��7 ��� �� � < �������� � �� #� �� �� � �� �� ��� ��9 �� �� $

Page 31: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ��� �� � � � ����� �� �� �

Character available

Character received Character to display

Keyboard status

Interrupt enabled

Ready for next character

Display status

Interrupt enabled

Keyboard buffer Display buffer

Page 32: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���

I � ; �9 � ; �� � ;� ;�;�� 8 ; �� 8�� ; � � ��� �I

� 8�� ; �9 6�� 6� � �� �9 �;� ; 8 ;�9��� :9 6�9 � �� ;� 8 ; � ;� ;�� 9 ��:9 :� �;� 79 6� �� �9 9 6�� ��;6�9 ��9 6�� 8 ;�9��� 89 ��� ��� � 9 6� 6� ���;6 ;� ;� 9 � ��� � 69 89 � � �� �9 �;:9 6�� � �

I � ; �9 �6 7� ; 97 ;�7� �7� ;� :��� �� � ��� � 7�9 �� �9 �97 ;89 ��� ��� 9 7�9 8 ; � 69 8 ; �6 79 ��� 6�:9 �� 8 ; �9� ; � �;�779 ;� ;�; 8 ;�9���:9 6�9 8� ��� ��� �9 � �

I � � �� �� � ����� ����� �� ��� ��� �� ���� ��� � � !�� =3 � ���� �� ����� � �� � �� ����� ��� ��<� ���9 �� �� � �� /'+.* +:) +'+��*)+ .5.*'+( 4 �� 0�:��5��( )5 0 60* --* �� � ���<� ���� 4 �� -* ) +-5)5 0 ) + /* +& + * ) + ��� � �� & +/* ) + */5'(� +*:5 ,���� ��� �� ���� ���1 $

I� 8�� ; �9 6�� 6� � �� �9 �;� ; ;6 � �� 77� �

I5 67�9 ;6 � �9 �� 7� � � ��� � 69 8 ; �6 � �� �9 �;:9 6�� � � ;9 69�9 69 ���� �6 ;6�9 ���� �� �9 �� �� ��� 8� � 7� ; ��5 � �

I�� 7� ; ��5 �� �;� �;�� � ��� ��� 69 ����779 � � � �� 9 ��� � ;68 ; ��� ����9 �9� ;� ; 7 ;7 �; 8 ; �� � ��� ��� �

I 2 � ����� �� �� � ��� � � (//'*/'+(� +*:5 ) + - +- 0+ � -�-05 &5( 0+:� $

Page 33: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� ��� �� �� � ������ � �� ��� ��

Terminal

CPU DMA

Address

Count 1003241

Device Direction

Bus

Memory

100RS232C Controller

……

Page 34: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

��� ��� ��� � � ���� ��� � � � �� ��� �� �� � � �

I�� �9 6� ;�: � � �6� 7 �� ;7� :�77� ;6� � ��� � �< � ;� 9 � 8 �9;68 ;�;�� ;�

I � ���� ���? � � ��� ���99������ �� �� .*0&5/0+- + � �� ��������� �� �� $

I � ��� ��� ��9 �� �� �� ������ �� � � � ��� �� � ��� ������� $I %� ��� �� �� ��� ��� ���� ���� �� ������ �� �� ��>� � !����� ��� � ��

��� �� ����� �#����? $I

� ���� ����5 �� �� � � ;6�979 �6 ���9��� � ��� � >� � ;� �I � ���� ���? � � ��� ���99������ �� �� /* -�5 $I 2� ��� ��� � �� ��� ��9 �� �� �� ������ �� � � � ��� �� � ��� ������� $I � ��� �� !��� � %2� � ������ ����� �� ��� �� � ��� �� �����

�� ��� � ��>� � !����� ��� 2�3 �� $I

�9 � ; 89���� �; � ; 8 �9 ;6 ;9 : ; 8 ; ; � ��� ;� 6;� ; ��77 ;� �;�9 �;:9 6��� � �;��� 8 ; �9 �� �

Page 35: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� �� ��� � � � �����

I�9 ; � ��� ;� 6; �9 6�� 6� 9 9� � ;�9 8 ; 6� �:� � ��� � ��� ��7� 6 7� ; ; � 9� �� 6� ;6 :9 :� �;� �

I�9 �6;7�9 ; � ��� ;� 6; 7�9 :� 8 ;�7� 6� � �9 �� ;� ��� ;� 69 � 6� �9 9� �9 6� ;�

I % ( 0& + +:-*:)+� +*:(& + � � ( 0& + -*:) +� +*:(& + $I � -� +(.(&5 ) + /'* -5)�'( � � '+&*':+ )( /'*-5)�'( $I � -*'*�& +:5 $I � &'(/ $I � �� +:&5''�/& $

I�6 79 6��; 8 ;�9 � ;� ;� 7� 6�9 6��� 89 � �9� ; � �� �� 9�� ��9 ;6 :� 8�8 ;�9 � � �

Pro

gra

m c

ounte

r

Time

(a)

Time

(b)

Pro

gra

m c

ounte

r Jumps

Page 36: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� �� �� ���

I�9 �� 798 ��9 � 6� �� �97 6;7� 9 � �� � ���� ���� ;� 69 89 ;��� ��: : ; 8 ; � �� 6 ��6�� ;� ;: � ��� 6�9 �

I�9 ; � ��� ;� 6; 8 ; 7� ;� :��� 9 8 ; �;�� �6� 8 ; �� 798 ��� � � 6�9 9 �9 � ; �9 7� :9 � �� ; ;67� 68 ;� ;� 6�� ;�

I�� �6 � �� �� �6�� 8 ; � ; �� � 9 �� � ;� 7� �� 8 ; �� 6; �� 798 ����� 9 9 �9 � ; �� 7� :9 �6 �; � ��� ;� 69 ;6�� �� �

I�9 ������ ���� � �� � 6� �6 � ;� 8 ; �� 798 ��9��� ;7� ���:9 6�9 ;6�9 �9 � 6� ;� �9 ;��� � �9 �9 :� � ��: ;�9 �6� � ��� ;� 69 �;7� � ;�� � � �� :� � �� � �9 :� 89 ��� ��� � � � �� � �

I�� � ��� ;� 69 7�9 7� 6 ;89 �9 :� � �� 9� �9 6�9 � �� 69 68� � ;�6�:9 �� 8 ; 8 ; 7� ; 8� � �� �9 �;�9� �� $ � ���� � � � ���� � � � ����� �� � − � � �� !� �� � ����� ��� �� � �

�� � ��� ��� �� $� $ �� � � � � ����� �� � �� � ��� � ����� �� � ����� ��� �� � � �� �9� ��� �� $� $ �� � � � � ����� �� � − � � �� !� �� � �� � ��� � � �� �9� ��� �� $

Page 37: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� ���� ���� �� �� �� �� � ��� �� ��� � ���� �

Peg 2Peg 1 Peg 3

Page 38: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ��� ���� ��� ��� � ��� ��

Initial state

First move 2 disks from peg 1 to peg 2

Then move 1 disk from peg 1 to peg 3

Finally move 2 disks from peg 2 to peg 3

Page 39: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� �� �� ��� �� � �� �� ��� ���� � � ��� ���� � ��� �� ��� ����� �

������ ���� ����� ���� � ���� � ���� ������ ��� ���� ��

� ��� ���� ��� ����� ������� �� ���� �� ���� � � ��� � �

������ � � ������ �� � �� � � ������ �� �� �� � ������ �� � � �� � ��

Page 40: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� ��� ������� ������ �� �� �� � ������

n = 3

i = 1

j = 3

Return addr

Old FP

k

n = 3

i = 1

j = 3

Return addr

Old FP

k = 2

n = 3

i = 1

j = 3

Return addr

Old FP

k = 2

n = 3

i = 1

j = 3

Return addr

Old FP

k = 2

n = 3

(a) (b) (c) (d) (e)

i = 1

j = 3

Return addr

Old FP

k = 2

n = 2

i = 1

j = 2

Return addr

Old FP = 1000

k

n = 2

i = 1

j = 2

Return addr

Old FP = 1000

k = 3

n = 2

i = 1

j = 2

Return addr

Old FP = 1000

k = 3

n = 2

i = 1

j = 2

Return addr

Old FP = 1000

k = 3

n = 1

i = 1

j = 3

Return addr

Old FP = 1024

k

n = 1

i = 1

j = 2

Return addr

Old FP = 1024

k = 3

1000

1004

1008

1012

1016

1020

1024

1028

1032

1036

1040

1044

1048

1052

1056

1060

1064

1068

Address

FP

SP

SP

FP

FP

SP

FP

SP

Page 41: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

�� �� �� ���

I �9 ��9 �� ��� � ;� � ��� ;� 89 � 7� 6� �� ��� � �� �� �� 798 ���7� ;� :� 6�9 9 �� �� 798 ��� 7� ;� :��� � ��� ���� �

I ������ �� ��� ����� �>��� ��9 �� �� � � -� +(.(&( ,� +: *-(� +*:5 1� � ��� �� ��� � �� ��>� �� �� �>��� ��9 �� �� � � '+&*':* �� ��� �� ��� $

I >���� �9 �� �� � � ��� �� ��� � ���<� ��� � �� � �� �� ��� � ��� /'+.(��� ��9 �� �� �� � � ��� �� ��� ��� ����� !������ $

I %� ���� ��� � ���<� ��� � �� � �� �� ��� � ��>��� ��9 �� �� ,�� ��� ��� �� ��� !�������1 !� 5��5 �>��� ��9 �� �� � � ���� �9 �� �� !� �������� ����������� ��� ����� �� ��� �� ��� !������ $

I �9 ��9 ����� �� � ;6�979 � �9 ��798 ��9 7� ;6�� ��9 ; 7� : � ;� 6� ;�7� 6� �� ��� ;6 :� 8� ��� ���� �

I � � � �� >�:+-( ��� ��9 �� �� � � ���� �9 �� �� 4 !� � ���<� ��� � �� � �� �� ��� � ��� ����� ��� ��9 �� �� �� � ���� ���� � �� � �� ��� �� ��� � �� �� ��� !������ $I ����� � !��� ��� ���� �� ��� �� � � ����� �� �>� �� #� ��9 �� ��

���� ��� �� � � ��� � ���� �� ��7$

Page 42: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� �� �� �� � ��� ��� �� � ��

(a)

Calling procedure

(b)

Called procedure

A called from main program

A returns to main program

CALL

CALL

CALL

RETURN

RETURN

RETURN

Page 43: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� �� �� �� � ��� �� �� �� ���

(a)

A called from main program

A returns to main program

(b)

RESUME B

RESUME A

RESUME B

RESUME B

RESUME A

RESUME A

Page 44: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

����

I�6� � � �6� 7� ;�:��� 8 ; ��798 ��� ���� :�� ;7� 9� 9�� ����� �� 68� ; �9 �;�7� 6� 7� 68 ;� ;� 6; �;�9��6� ;� :� 8 ; � 77� ��9 6���9 ��� ;�� :9 6�9 ���� �

I ������ � � � �� �9 �� �� !� ����� �� ���� �� � �� � �� �� � ����� ���" 4 � �� ���� ���" 4 �� � �� ��9 �� �� � � �����9 �� �� 4 � �� � � ����� � ��8 ��� � 4 �� $

I�9 ; �9 �;�7� �6� 89 ��9 7� 68 ;� ;� 6; 7�9 7�� � 6� �6� � �� � ;�7� 6� �� ��� � � �� �9 �;�� �8 �6� �� 798 ��� 89��� � � � � � �7�9 �� ��9 �9 �� ;� 6; ��� �;��9 � � 7� � �

I �� � ������� 4 �� ����� �� � � � �� � ��� �� ##� ���� �� �� �� ������� ��� � � ��� �� 4 � ���� ������ �� �� ���� ����� ��� �� ������ ����� �9 �� �� $

I�6 :9�� 8� � ��9 �6�� ;�� � ����� ;�;��� 89 ��9 � �� 7� 6 ; �9 69 � �9 69 �� ��77 ;� 69 � ��� 89 ��9 7� 68 ;� ;� 6; 8 ; 7� ; � �� �

I �� � ����� >� �� �� �� �� � 4 �� �� 4 �� ���� ����� �� � ���� ��� %23 ������ ��� � � ������ � �� �� ��� �� !� �� � �� �9 �� �� �� � � �� ���� ��8 ��� $

I�9 � �� � � 6� 9 9 �9 �9� �;����9 � � �;�9 ��� 89 ���: ;7 ����7� ;�9�� ��� � ��9 8 ;�9��� :9 6�9 8� ������8���9 �

Page 45: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� �����

I5 �� ;� :� � ;� ;67� 6� ���� � �; �� ��� �� �� ��� ����� ;6 � �� �9��� ; 89 � 7� � � � � �9 6��� ;� :� :9 6�� 8 ; �� ���69 ;� ;689���� �;� �

I

�� :9 �9 � �� � � �; ;6�9 ���� ;6�9 ��� : � 6� ;� ��� �� : :� ;69 97�� ;� 69 9 � �� �9 �; 7� 6� ;� 7� 6� �� ��� � �6 � � 89����� � �� ��9 �9 �9 �� ;� 6; ��� �;��9 �

I 7�� �� ��� !� �� ����� �� !� ��� ��� �� � �� ������ 4 ���� �� ��� � �� � �� �� ��� � � ���� ����� ���� ������ $I �9 6� �9 �9 � �� � 6� ��� ��� � � �; ;6�9 ���� � 6� ��� �����

I � ������ �� ���� ����� %23 � ������ ��� � �� � ,�� � ����������� �� ��� ��� ��9 �� �� ������ ��1 $

I � ���� ���9 �� �� 4 ���� � 4 � � �� ��8 ��� �� � ���� �� ��� �9� � � ��� �� �,� �� �� �� 8 �� � � �� >� �� ��9 �� �� � � %�� 1 �� �� ��8 ��� � �� � ��� �� �� �� ��� ��� �� � ���� ����� ��� �� ������ �� ��� �9 �� �� $

I5 � �9 �;�7�� ; 8 ; �6 �;6�9 ���� ;� 69 ��66� 9� � ;�� �6� 9 �;9 8 ;�� ;� 6; ���8���9 9 ������9 �

I�6 �9 �� �9 8 ; ;6�9 ���� ; 8 ;79 � �� 9 � ���9����� ;6:� 8� 8� ��� �;�9 689 �9 ��9 97�� ;� 69 9 ����:9 6�9 8� ��� ����7�9 ��9�� �;:� 89 ���;6��7�� ;� 69 89 ���;6�9 ���� �

Page 46: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

���� �����

I �9 ; ; �9 : ; 8 ; 7� �7� �� :� 89 �6;� � ; � 6� ;� 8 ; � ;� ;� ; 8 ; �?� �I � ; �9 �6� �� ��� ;�;�� 6� 6 6� ��� 7�9 �6 97� 68� 8 ; � ;� ;�� 8 ;

�?� ��� �;� �9 69 ���9 �6 ;6�9 ���� �� �;� :9 6� �9 �6� �� �� ;69 8 ;;6�9 ���� � ;6 9 97�� ;� 69 �

I�� �6� ���9 � ; �� ���9 ;6 :�8� 7�9 �� 6; �� �� ;69 8 ; ;6�9 ����� � � ��� � � �� ��6� �9 � �� �� ;6�9 ���� � �6 � �9 �� :�8� � 9 �� � � ;8 ; � ;� ;� ; � 6� �;7� ;9 �9 ���9 9 � 67�9 ��6� �9 �

I�6� � ��� ;� 69 : ;� �;� �9 7� 6 ; �9 69 ���� 9� 6��9 �6� ������ �8�� 6; 8 ; � ;� ;�� 8 ; �?� � � ��� 9 � ; 8 ; � ;� ;� ; :� ��� 7 �;� ;7 ; 9�� � 9 � � �9 ��; :9 6� 7 �;� ;7 ;�

I =������ �>��� �9 �� �� � � ��� �� �� ��� � � ���� ���? � 4 �� �� �� ���� ���� � ���� ���9 �� �� � � � �� ��� �� �� � � � ���� ���? ��<� ��� �� � �� �� �� �� ���� 4�� �� �� � �� ���� ����� ����� ��� �� � �� � �� ��� �� �� � � ���� ���?���� �� �� �� �� � ������ � �� �9� ������ $

I � � �� �� ��� #��� !� � ��� � � �� ���� ����� � �� �� � ������� �� � $I

5 ��� ;�9 8� ����=�� � ; �� 79 � �; �6�9 � � 6� 8����9 8 ; 8 �9 �;�9 ��;8 ; �;� �;�� � � �� � � �� 9 ��� � �� � � �� �

I � �� ���� ����� :*: .( -�5 '(6+0+ �� ��� �� � ��� �� ���� ��� �� �� ��� � ����� ��8 � $

Page 47: Architettura degli Elaboratori 11 - Il Livello ISA - unibo.itdallago/AE0607/11_LIVELLOISA.pdf · 4-bit 0000 opcode 15 3-address instructions xxxx 16 bits Bit number yyyy zzzz 0001

� ������� � ���� �����

0 10 15 20 25 35 40

Disk interrupt priority 4 held pending

RS232 ISR finishes disk interrupt occurs

Disk ISR finishes

Printer ISR finishes

RS232 interrupt priority 5

Printer interrupt priority 2

User program

Printer ISR

RS232 ISR

Disk ISR

Printer ISR

User program

Time

StackUserPrinter

User UserPrinter

User