Anzeige

1st course summary.pptx

HebaEng
27. Mar 2023
Anzeige

Más contenido relacionado

Anzeige

1st course summary.pptx

  1. AH AL BH BL CH CL DH DL SP BP DI SI CS DS SS ES IP Internal communication register Σ EU Control System Temporary Register Flags ALU BUS Control Logic ALU Data BUS (16 bit) Instruction Queue Queue BUS (8bit) Data BUS (16 bit) 8086 BUSES Add BUS (20 bit) General Registers 4 3 2 1 6 5 1. BIU O/Ps IP 2. IP=IP+1 3. Instruction  Queue 4. EU draws Instr. & Execute it. 5. BIU Fetches another Inst. While in the same time EU executing the 1st Inst. PIPE LINEING FIFO FETCH overlaps with Execute
  2. 1MB 0 7 S4 64KB S1 64KB S3 64KB S2 64KB 00000H FFFFFH S4 64KB S1 64KB S3 64KB S2 64KB S4 64KB S1 64KB S3 64KB S2 64KB S4 64KB S1 64KB S3 64KB S2 64KB XXXX:0000 XXXX:FFFF XXXX:0000 XXXX:FFFF XXXX:0000 XXXX:FFFF XXXX:0000 XXXX:FFFF X100:0000 X100:FFFF
  3. OFFSET VALUE 15 0 Effective Address EA SEGMENT REGISTER 15 0 Segment Base Register SBA 0000 20-BIT 19 0 Physical Memory Address PA Adder
  4. 0 7 SEGMENT 64KB 00000h FFFFFh 0022h 15 0 1234h 15 0 0h SBA+EA=12340+0022=12362 19 0 Adder EA SBA PA 12340h 12362h = 22 +
  5. PA = SBR or (SR) : EA = : + + The Operand resides in an internal Register. Examples: AND AL,DH AND BX,CX It is a method for specifying an Operand The Operand is a part of the Instruction. Examples: AND AL,80h AND 0800h,BX Direct Add. Register indirect Add. Based Add. Indexed Add. Based Indexed Add. CS DS ES SS BX BP SI DI 8-BIT or 16-BIT Displacement
  6. (1)
  7. SHIFT & ROTATION Group BRANCH Group CHARRECTER STRING Group DATA Transfer Group LOGICAL Group ARITHMATIC Group 8086 CONTROL Group
  8.              
  9. 1MB 0 7 S4 64KB S1 64KB S3 64KB S2 64KB 00000H FFFFFH XXXX:0000 XXXX:FFFF XXXX:0000 XXXX:FFFF XXXX:0000 XXXX:FFFF XXXX:0000 XXXX:FFFF SS 64KB SS:0000 SS:FFFF [SP]= TOS
  10. ;This program is used to test PPI1 Mode2 and . . . . . . . . ;Date: 28/7/2008 code segment assume cs:code,ds:code org 0 start: mov ax,cs ;Comments mov ds,ax ;ds=cs hlt DSeg DB 00,10h,0F2h, code ends end start Assembly Program Structure LABLES COMMENTS DIRECTIVES INSTRUCTIONS
  11. The DB & DW directives: Examples: Variable Name DB Aah ;VARIABLE NAME(BYTE) = AAh DATA1 DW Aah ;DATA1(WORD) = AAh X DB 50DUP(?) ;50 BYTES OF MEM. ARE RESERVED ;FOR X WITH NO INITIAL VALUE STUDENTS DW 38DUP(?) ;38 WORDS OF MEM. ARE RESERVED FOR ; STUDENTS WITH NO INITIAL VALUE TABLE DB 11h,0Abh,29h,50h,33h,0FDh,0B0h ;THESE VALUES ARE ASSIGNED FOR ;TABLE VARIABLE NAMES DB 100DUP(‘U’) ;FILL 100-BYTES OF MEMORY STARTING ;AT EA=NAMES WITH ASCII (U)
  12. INPUTS & OUTPUTS FOR MASM & LINK MASM LINK prog.obj prog.exe prog.asm prog.lst
  13. Examples: Convert the following Instruction mnemonics to there machine codes. (A) MOV BL,AL 1- OPCODE = 100010 2- W=0 (8-BIT) 3- Let REG be the source i.e: D=0 4- then REG = 000 for AL 5- MOD =11 6- Then R/M = 011 100010 0 0 11 000 011 = 88C3h
  14. D 0 1 REG = code for Source reg REG = code for Dest. reg MODE
  15. (B) ADD AX,[SI] 1- OPCODE = 000000 2- W=1 (16-BIT) 3- The REG is dest. i.e: D=1 4- then REG = 000 for AX 5- MOD =00 6- Then R/M = 100 000000 1 1 00 000 100 = 0304h
  16. D 0 1 REG = code for Source reg REG = code for Dest. reg MODE
  17. (C) XOR CL,[1234h] 1- OPCODE = 001100 2- W=0 (8-BIT) 3- The REG is dest. i.e: D=1 4- then REG = 001 for CL 5- MOD =00 6- Then R/M = 110 001100 1 0 00 001 110 = 320E3412h 0011 0100 0001 0010
  18. D 0 1 REG = code for Source reg REG = code for Dest. reg MODE
  19. (C) ADD [BX][DI][1234],AX 1- OPCODE = 000000 2- W=1 (8-BIT) 3- The REG is source i.e: D=0 4- then REG = 000 for AL 5- MOD =10 6- Then R/M = 001 000000 0 1 10 000 001 = 01813412h 0011 0100 0001 0010
  20. D 0 1 REG = code for Source reg REG = code for Dest. reg MODE
  21. (C) MOV WORD PTR [BP][DI][1234],0ABCDh 1- OPCODE = 110001 2- W=1 (16-BIT) 3- D=1 from table 4- then REG = 000 from table 5- MOD =10 6- Then R/M = 011 110001 1 1 10 000 011 = 01813412CDABh 0011 0100 0001 0010 1100 1101 1010 1011
  22. D 0 1 REG = code for Source reg REG = code for Dest. reg MODE
  23. (C) MOV [BP][DI][1234],DS 1- OPCODE = 10001100 2- then REG = 011 from table 3- MOD =10 4- Then R/M = 011 100011 0 0 10 011 011 = 8C9B3412h 0011 0100 0001 0010
Anzeige