ALP.ppt - CSE-213 Microprocessor and Interfacing Converting...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE-213 Microprocessor and Interfacing
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Converting Assembly Language Instructions to Machine Code An instruction can be coded with 1 to 6 bytes Byte 1 contains three kinds of information – Opcode field (6 bits) specifies the operation (add, subtract, move) – Register Direction Bit (D bit) Tells the register operand in REG field in byte 2 is source or destination operand 1: destination 0: source - Data Size Bit (W bit) Specifies whether the operation will be performed on 8-bit or 16-bit data 0: 8 bits 1: 16 bits
Image of page 2
Converting Assembly Language Instructions to Machine Code(REG MODE) Byte 2 has three fields – Mode field (MOD) – Register field (REG) used to identify the register for the first operand – Register/memory field (R/M field)
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Converting Assembly Language Instructions to Machine Code(MEM MODE) R/M \ MOD 00 01 10 000 BX+SI BX+SI+D8 BX+SI+D16 001 BX+DI BX+DI+D8 BX+SI+D16 010 BP+SI BP+SI+D8 BP+SI+D16 011 BP+DI BP+DI+D8 BP+DI+D16 100 SI SI+D8 SI+D16 101 DI DI+D8 DI+D16 110 D16(DIR ECT ADD) BP+D8 BP+D16 111 BX BX+D8 BX+D16
Image of page 4
Problem MOV CL,[BX] Copy a byte to CL from memory location whose EA is contained in BX. M.A BX + DS 6-bit code 100010 D 1 ; data being moved to reg CL W 0; Byte 3 bit code Reg CL 001 MOD 00; R/M 111 Assembling all of these bits together 1000101000001111
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Instruction Set of 8086
Image of page 6
Instruction Set of 8086 8086 Instructions can be classified into following six groups. Data transfer instructions Arithmetic instructions Logical instructions Flag manipulation Control transfer instructions String manipulating instructions Processor control instructions
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Instruction Set of 8086 Data transfer group Instructions for moving data b/w reg, reg & mem, reg & stack mem, acc & I/O device Arithmetic group Inst for add and sub of binary, BCD and ASCII data. Inst for mul and div of signed and unsigned binary data. Logical group Ins for performing logical operations like AND, OR, X-OR, Complement, Shift, Rotate, etc.,
Image of page 8
Instruction Set of 8086 String manipulation group Ins for moving string data b/w two memory locations, comparing string data w by w or B by B Control transfer group Ins to call a procedure/Subroutine in the main program
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern