MICROPROCESSOR & MICROCONTROLLER

Size: px
Start display at page:

Download "MICROPROCESSOR & MICROCONTROLLER"

Transcription

1 MICROPROCESSOR & MICROCONTROLLER MODULE I Evolution of Microprocessor 4-bit Microprocessors The first microprocessor was introduced in 1971 by Intel Corp. It was named Intel 4004 as it was a 4 bit processor. It was a processor on a single chip. It could perform simple arithmetic and logic operations such as addition, subtraction, boolean AND and boolean OR. It had a control unit capable of performing control functions like fetching an instruction from memory, decoding it, and generating control pulses to execute it. It was able to operate on 4 bits of data at a time.this first microprocessor was quite a success in industry. Soon other microprocessors were also introduced. Intel introduced the enhanced version of 4004, the Some other 4 bit processors are International s PPS4 and Thoshiba s T bit Microprocessors The first 8 bit microprocessor which could perform arithmetic and logic operations on 8 bit words was introduced in 1973 again by Intel. This was Intel 8008 and was later followed by an improved version, Intel Some other 8 bit processors are Zilog- 80 and Motorola M bit Microprocessors The 8-bit processors were followed by 16 bit processors. They are Intel 8086 and bit Microprocessors The 32 bit microprocessors were introduced by several companies but the most popular one is Intel Pentium Series Instead of 80586, Intel came out with a new processor namely Pentium processor. Its performance is closer to RISC performance. Pentium was followed by Pentium Pro CPU. Pentium Pro allows allow multiple CPUs in a single system in order to achive

2 multiprocessing. The MMX extension was added to Pentium Pro and the result was Pentiuum II. The low cost version of Pentium II is celeron. The Pentium III provided high performance floating point operations for certain types of computations by using the SIMD extensions to the instruction set. These new instructions makes the Pentium III faster than high-end RISC CPUs. Interestingly Pentium IV could not execute code faster than the Pentium III when running at the same clock frequency. So Pentium IV had to speed up by executing at a much higher clock frequency Microprocessor - Architecture and signals 8086 Microprocessor is an enhanced version of 8085Microprocessor that was designed by Intel in It is a 16-bit Microprocessor having 20 address lines and16 data lines that provides up to 1MB storage. It consists of powerful instruction set, which provides operations like multiplication and division easily. It supports two modes of operation, i.e. Maximum mode and Minimum mode. Maximum mode is suitable for system having multiple processors and Minimum mode is suitable for system having a single processor. Features of 8086 The most prominent features of a 8086 microprocessor are as follows It has an instruction queue, which is capable of storing six instruction bytes from the memory resulting in faster processing. It was the first 16-bit processor having 16-bit ALU, 16-bit registers, internal data bus, and 16-bit external data bus resulting in faster processing. It is available in 3 versions based on the frequency of operation o MHz

3 o MHz o (c) MHz It uses two stages of pipelining, i.e. Fetch Stage and Execute Stage, which improves performance. Fetch stage can prefetch up to 6 bytes of instructions and stores them in the queue. Execute stage executes these instructions. It has 256 vectored interrupts. It consists of 29,000 transistors. Comparison between 8085 & 8086 Microprocessor Size 8085 is 8-bit microprocessor, whereas 8086 is 16-bit microprocessor. Address Bus 8085 has 16-bit address bus while 8086 has 20-bit address bus. Memory 8085 can access up to 64Kb, whereas 8086 can access up to 1 Mb of memory. Instruction 8085 doesn t have an instruction queue, whereas 8086 has an instruction queue. Pipelining 8085 doesn t support a pipelined architecture while 8086 supports a pipelined architecture. I/O 8085 can address 2^8 = 256 I/O's, whereas 8086 can access 2^16 = 65,536 I/O's. Cost The cost of 8085 is low whereas that of 8086 is high.

4 Architecture of 8086 The following diagram depicts the architecture of a 8086 Microprocessor 8086 Microprocessor is divided into two functional units, i.e., EU (Execution Unit) and BIU (Bus Interface Unit). EU (Execution Unit) Execution unit gives instructions to BIU stating from where to fetch the data and then decode and execute those instructions. Its function is to control operations on data using the instruction decoder & ALU. EU has no direct connection with system buses as shown in the above figure, it performs operations over data through BIU. Let us now discuss the functional parts of 8086 microprocessors.

5 ALU It handles all arithmetic and logical operations, like +,,, /, OR, AND, NOT operations. Flag Register It is a 16-bit register that behaves like a flip-flop, i.e. it changes its status according to the result stored in the accumulator. It has 9 flags and they are divided into 2 groups Conditional Flags and Control Flags. Conditional Flags It represents the result of the last arithmetic or logical instruction executed. Following is the list of conditional flags Carry flag This flag indicates an overflow condition for arithmetic operations. Auxiliary flag When an operation is performed at ALU, it results in a carry/barrow from lower nibble (i.e. D0 D3) to upper nibble (i.e. D4 D7), then this flag is set, i.e. carry given by D3 bit to D4 is AF flag. The processor uses this flag to perform binary to BCD conversion. Parity flag This flag is used to indicate the parity of the result, i.e. when the lower order 8-bits of the result contains even number of 1 s, then the Parity Flag is set. For odd number of 1 s, the Parity Flag is reset. Zero flag This flag is set to 1 when the result of arithmetic or logical operation is zero else it is set to 0. Sign flag This flag holds the sign of the result, i.e. when the result of the operation is negative, then the sign flag is set to 1 else set to 0. Overflow flag This flag represents the result when the system capacity is exceeded.

6 Control Flags Control flags controls the operations of the execution unit. Following is the list of control flags Trap flag It is used for single step control and allows the user to execute one instruction at a time for debugging. If it is set, then the program can be run in a single step mode. Interrupt flag It is an interrupt enable/disable flag, i.e. used to allow/prohibit the interruption of a program. It is set to 1 for interrupt enabled condition and set to 0 for interrupt disabled condition. Direction flag It is used in string operation. As the name suggests when it is set then string bytes are accessed from the higher memory address to the lower memory address and vice-a-versa. General purpose register There are 8 general purpose registers, i.e., AH, AL, BH, BL, CH, CL, DH, and DL. These registers can be used individually to store 8-bit data and can be used in pairs to store 16bit data. The valid register pairs are AH and AL, BH and BL, CH and CL, and DH and DL. It is referred to the AX, BX, CX, and DX respectively. AX register It is also known as accumulator register. It is used to store operands for arithmetic operations. BX register It is used as a base register. It is used to store the starting base address of the memory area within the data segment. CX register It is referred to as counter. It is used in loop instruction to store the loop counter. DX register This register is used to hold I/O port address for I/O instruction.

7 Stack pointer register It is a 16-bit register, which holds the address from the start of the segment to the memory location, where a word was most recently stored on the stack. BIU (Bus Interface Unit) BIU takes care of all data and addresses transfers on the buses for the EU like sending addresses, fetching instructions from the memory, reading data from the ports and the memory as well as writing data to the ports and the memory. EU has no direction connection with System Buses so this is possible with the BIU. EU and BIU are connected with the Internal Bus. It has the following functional parts Instruction queue BIU contains the instruction queue. BIU gets upto 6 bytes of next instructions and stores them in the instruction queue. When EU executes instructions and is ready for its next instruction, then it simply reads the instruction from this instruction queue resulting in increased execution speed. Fetching the next instruction while the current instruction executes is called pipelining. Segment register BIU has 4 segment buses, i.e. CS, DS, SS& ES. It holds the addresses of instructions and data in memory, which are used by the processor to access memory locations. It also contains 1 pointer register IP, which holds the address of the next instruction to executed by the EU. o CS It stands for Code Segment. It is used for addressing a memory location in the code segment of the memory, where the executable program is stored.

8 o DS It stands for Data Segment. It consists of data used by the program andis accessed in the data segment by an offset address or the content of other register that holds the offset address. o SS It stands for Stack Segment. It handles memory to store data and addresses during execution. o ES It stands for Extra Segment. ES is additional data segment, which is used by the string to hold the extra destination data. Instruction pointer It is a 16-bit register used to hold the address of the next instruction to be executed. Memory organisation As far as we know 8086 is 16-bit processor that can supports 1Mbyte (i.e. 20-bit address bus: 220) of external memory over the address range to FFFFF16. The 8086 organizes memory as individual bytes of data. The 8086 can access any two consecutive bytes as a word of data. The lower-addressed byte is the least significant byte of the word, and the higher- addressed byte is its most significant byte. Figure: Part of 1 Mbyte Memory The above figure represents: storage location of address contains the value 716, while the location of address contains the value 7D16. The 16-bit word 225A16is stored in the locations 0000C16 to 0000D16 The word of data is at an even-address boundary (i.e. address of least significant byte is even) is called aligned word. The word of data is at an odd-address boundary is called misaligned word, as shown in Figure below.

9 Figure: Aligned and misaligned word To store double word four locations are needed. The double word that it s least significant byte address is a multiple of 4 (e.g. 0 16, 416, ) is called aligned double word. The double word at address of non-multiples of 4 is called misaligned double word shown in Figure below. Figure: Aligned and misaligned double word a) Memory segmentation The size of address bus of 8086 is 20 and is able to address 1 Mbytes ( ) of physical memory, but all this memory is not active at one time. Actually, this 1Mbytes of memory are partitioned into 16 parts named as segments. Size of the each segment is 64Kbytes (65,536). Only four of these segments are active at a time: Code segment holds the program instruction codes Stack segment is used to store interrupt and subroutine return addresses Data segment stores data for the program Extra segment is an extra data segment (often used for shared data)

10 Each of these segments are addressed by an address stored in corresponding segment registers: CS(code segment), SS(stack segment), DS(data segment), and ES(extra segment). These registers contain a 16-bit base address that points to the lowest addressed byte of the segment. Because the segment registers cannot store 20 bits, they only store the upper 16 bits. The BIU takes care of this problem by appending four 0's to the low-order bits of the segment register. In effect, this multiplies the segment register contents by 16. The segment registers are user accessible, which means that the programmer can change the content of segment registers through software. b) Programming model: How can a 20-bit address be obtained, if there are only 16-bit registers? However, the largest register is only 16 bits (64k); so physical addresses have to be calculated. These calculations are done in hardware within the microprocessor. The 16-bit contents of segment register gives the starting/ base address of particular segment. To address a specific memory location within a segment we need an offset address. The offset address is also 16-bit wide and it is provided by one of the associated pointer or index register.

11 Figure: Software model of 8086 microprocessor To be able to program a microprocessor, one does not need to know all of its hardware architectural features. What is important to the programmer is being aware of the various registers within the device and to understand their purpose, functions, operating capabilities, and limitations. The above figure illustrates the software architecture of the 8086 microprocessor. From this diagram, we see that it includes fourteenl6-bit internal registers: the instruction pointer (IP), four data registers (AX, BX, CX, and DX), two pointer registers (BP and SP), two index registers (SI and DI), four segment registers (CS, DS, SS, and ES) and status register (SR), with nine of its bits implemented as status and control flags. The point to note is that the beginning segment address must begin at an address divisible by 16.Also note that the four segments need not be defined separately. It is allowable for all four segments to completely overlap (CS = DS = ES = SS). c) Logical and Physical Address Addresses within a segment can range from address 00000h to address 0FFFFh. This corresponds to the 64K-bytelength of the segment. An address within a segment is called an offset or logical address. A logical address gives the displacement from the base address of the segment to the desired location within it, as opposed to its "real" address, which maps directly anywhere into the 1 MByte memory space. This "real" address is called the physical address. What is the difference between the physical and the logical address? The physical address is 20 bits long and corresponds to the actual binary code output by the BIU on the address bus lines. The logical address is an offset from location 0 of a

12 given segment. You should also be careful when writing addresses on paper to do so clearly. To specify the logical address XXXX in the stack segment, use the convention SS:XXXX, which is equal to [SS] * 16 + XXXX. Logical address is in the form of: Base Address: Offset Offset is the displacement of the memory location from the starting location of the segment. To calculate the physical address of the memory, BIU uses the following formula: Physical Address = Base Address of Segment * 16 + Offset

13 Example: The value of Data Segment Register (DS) is 2222H. To convert this 16-bit address into 20-bit, the BIU appends 0H to the LSB (by multiplying with 16) of the address. After appending, the starting address of the Data Segment becomes 22220H. Data at any location has a logical address specified as:2222h: 0016H Where 0016H is the offset, 2222 H is the value of DS Therefore the physical address:22220h H : H The following tables describes the default offset values to the corresponding memory segments.

14 Some of the advantages of memory segmentation in the 8086 are as follows: With the help of memory segmentation a user is able to work with registers having only 16-bits. The data and the user s code can be stored separately allowing for more flexibility. Also due to segmentation the logical address range is from 0000H to FFFFH the code can be loaded at any location in the memory. d) Physical memory organization: The 8086 s 1Mbyte memory address space is divided in to two independent 512Kbyte banks: the low (even) bank and the high (odd) bank. Data bytes associated with an even address ( , , etc.) reside in the low bank, and those with odd addresses ( , , etc.) reside in the high bank. Address bits A1 through A19 select the storage location that is to be accessed. They are applied to both banks in parallel. A0and bank high enable (BHE) are used as bankselect signals. The four different cases that happen during accessing data: Case 1: When a byte of data at an even address (such as X) is to be accessed: A0 is set to logic 0 to enable the low bank of memory. BHE is set to logic 1 to disable the high bank.

15 Case 2: When a byte of data at an odd address (such as X+1) is to be accessed: A0is set to logic 1 to disable the low bank of memory. BHE is set to logic 0 to enable the high bank. Case 3: When a word of data at an even address (aligned word) is to be accessed: A0 is set to logic 0 to enable the low bank of memory. BHE is set to logic 0 to enable the high bank. Case 4: When a word of data at an odd address (misaligned word) is to be accessed, then the 8086 need two bus cycles to access it: a) During the first bus cycle, the odd byte of the word (in the high bank) is addressed

16 A0 is set to logic 1 to disable the low bank of memory BHE is set to logic 0 to enable the high bank. b) During the second bus cycle, the odd byte of the word (in the low bank) is addressed A0is set to logic 0 to enable the low bank of memory. BHE is set to logic 1 to disable the high bank. Minimum and maximum mode of operation, Minimum mode Timing Diagram. Difference between MAX and MIN mode Maximum mode Minimum Mode When MN/MX(bar) low 8086 is in maximum When MN/MX(bar) high 8086 is in

17 mode. In maximum mode 8086 generates QS1,QS0,S0(bar),S1(bar),S2(bar), LOCK(bar),RQ(bar)/GT1,RQ(bar)/GT0 control signals. So clearly there are multiple processors in the system. minimum mode. In minimum mode 8086 generates INTA(bar), ALE, DEN(bar), DT/R(bar), M/IO(bar), HLDA,HOLD and WR(bar) control signals. There is only one processor in the system minimum mode. In minimum mode no interfacing Whereas in maximum mode interfacing, or master/slave signals is master/slave and multiplexing and several required.in minimum mode direct such control signals are requiredin RD WR signals can be used. No maximum mode a bus controller is required bus controller required. A simple to produce control signals. This bus demultiplexer would do the job. of controller produces MEMRDC, MEMWRC, producing the control signals. This IORDC, IOWRC, ALE, DEN, DT/R control demultiplexer produces MEMRD, signals. MEMWR, IORD, IOWR control signals. TIMING DIAGRAM of MINIMUM MODE 8086 The HOLD pin is checked at the end of each bus cycle. If it is received active by the processor before T 4 of the previous cycle of during T 1 state of the current cycles, the CPU activates HLDA in the next clock cycle and for the succeeding bus cycles; the bus will be given to another requesting master.

18 The control of the bus is not regained by the processor until the requesting master does not drop the HLDA pin low. When the request is dropped by the requesting master, the HLDA is dropped by the processor at the trailing edge of the next clock, as shown in Fig

19 The other conditions have already been discussed in the signal description section for the HOLD and HLDA signals. Comparison of 8086 and The instruction Queue is 6 byte long. In 8086, memory divides into two banks -even or lower bank The instruction Queue is 4 byte long. The memory in 8088 does not divide into two banks. -odd or higher bank The data bus of 8086 is 16-bit wide It has BHE (bar) signal on pin no. 34 & there is no SSO (bar) signal. Control pin in 8086 is M/IO (bar). It needs one machine cycle to R/W signal if it is at even location otherwise it needs two. In 8086, all address & data Buses are multiplexed. The data bus of 8088 is 8-bit wide. It does not have BHE (bar) signal on pin no. 34 & has only SSO (bar) signal. It has no S7 pin. Control pin in 8088 is IO/M (bar). It needs one machine cycle to R/W signal if it is at even location otherwise it needs two. In 8088, address bus; AD 7 - AD 0 buses are multiplexed.

20 It needs two IC for de-multiplexing AD 0 - AD 19. Maximum supply current 360mA. Three clock speed: 5, 8, 10 MHz It needs one IC for de-multiplexing AD 0 -AD 7. Maximum supply current 340mA. Two clock speed: 5, 8 MHz MODULE II addressing modes The different ways in which a source operand is denoted in an instruction is known as addressing modes. There are 8 different addressing modes in 8086 programming Immediate addressing mode The addressing mode in which the data operand is a part of the instruction itself is known as immediate addressing mode. Example MOV CX, 4929 H, ADD AX, 2387 H, MOV AL, FFH Register addressing mode It means that the register is the source of an operand for an instruction. Example MOV CX, AX ADD BX, AX ; copies the contents of the 16-bit AX register into ; the 16-bit CX register), Direct addressing mode The addressing mode in which the effective address of the memory location is written directly in the instruction. Example MOV AX, [1592H], MOV AL, [0300H]

21 Register indirect addressing mode This addressing mode allows data to be addressed at any memory location through an offset address held in any of the following registers: BP, BX, DI & SI. Example MOV AX, [BX] ; Suppose the register BX contains 4895H, then the contents ; 4895H are moved to AX ADD CX, {BX} Based addressing mode In this addressing mode, the offset address of the operand is given by the sum of contents of the BX/BP registers and 8-bit/16-bit displacement. Example MOV DX, [BX+04], ADD CL, [BX+08] Indexed addressing mode In this addressing mode, the operands offset address is found by adding the contents of SI or DI register and 8-bit/16-bit displacements. Example MOV BX, [SI+16], ADD AL, [DI+16] Based-index addressing mode In this addressing mode, the offset address of the operand is computed by summing the base register to the contents of an Index register. Example ADD CX, [AX+SI], MOV AX, [AX+DI] Based indexed with displacement mode In this addressing mode, the operands offset is computed by adding the base register contents. An Index registers contents and 8 or 16-bit displacement.

22 Example MOV AX, [BX+DI+08], ADD CX, [BX+SI+16] 8086 Instruction set The 8086 microprocessor supports 8 types of instructions Data Transfer Instructions Arithmetic Instructions Bit Manipulation Instructions String Instructions Program Execution Transfer Instructions (Branch & Loop Instructions) Processor Control Instructions Iteration Control Instructions Interrupt Instructions Let us now discuss these instruction sets in detail. Data Transfer Instructions These instructions are used to transfer the data from the source operand to the destination operand. Following are the list of instructions under this group Instruction to transfer a word MOV Used to copy the byte or word from the provided source to the provided destination. PPUSH Used to put a word at the top of the stack. POP Used to get a word from the top of the stack to the provided location.

23 PUSHA Used to put all the registers into the stack. POPA Used to get words from the stack to all registers. XCHG Used to exchange the data from two locations. XLAT Used to translate a byte in AL using a table in the memory. Instructions for input and output port transfer IN Used to read a byte or word from the provided port to the accumulator. OUT Used to send out a byte or word from the accumulator to the provided port. Instructions to transfer the address LEA Used to load the address of operand into the provided register. LDS Used to load DS register and other provided register from the memory LES Used to load ES register and other provided register from the memory. Instructions to transfer flag registers LAHF Used to load AH with the low byte of the flag register. SAHF Used to store AH register to low byte of the flag register. PUSHF Used to copy the flag register at the top of the stack. POPF Used to copy a word at the top of the stack to the flag register. Arithmetic Instructions These instructions are used to perform arithmetic operations like addition, subtraction, multiplication, division, etc. Following is the list of instructions under this group

24 Instructions to perform addition ADD Used to add the provided byte to byte/word to word. ADC Used to add with carry. INC Used to increment the provided byte/word by 1. AAA Used to adjust ASCII after addition. DAA Used to adjust the decimal after the addition/subtraction operation. Instructions to perform subtraction SUB Used to subtract the byte from byte/word from word. SBB Used to perform subtraction with borrow. DEC Used to decrement the provided byte/word by 1. NPG Used to negate each bit of the provided byte/word and add 1/2 s complement. CMP Used to compare 2 provided byte/word. AAS Used to adjust ASCII codes after subtraction. DAS Used to adjust decimal after subtraction. Instruction to perform multiplication MUL Used to multiply unsigned byte by byte/word by word. IMUL Used to multiply signed byte by byte/word by word. AAM Used to adjust ASCII codes after multiplication. Instructions to perform division DIV Used to divide the unsigned word by byte or unsigned double word by word.

25 IDIV Used to divide the signed word by byte or signed double word by word. AAD Used to adjust ASCII codes after division. CBW Used to fill the upper byte of the word with the copies of sign bit of the lower byte. CWD Used to fill the upper word of the double word with the sign bit of the lower word. Bit Manipulation Instructions These instructions are used to perform operations where data bits are involved, i.e. operations like logical, shift, etc. Following is the list of instructions under this group Instructions to perform logical operation NOT Used to invert each bit of a byte or word. AND Used for adding each bit in a byte/word with the corresponding bit in another byte/word. OR Used to multiply each bit in a byte/word with the corresponding bit in another byte/word. XOR Used to perform Exclusive-OR operation over each bit in a byte/word with the corresponding bit in another byte/word. TEST Used to add operands to update flags, without affecting operands. Instructions to perform shift operations SHL/SAL Used to shift bits of a byte/word towards left and put zero(s) in LSBs.

26 SHR Used to shift bits of a byte/word towards the right and put zero(s) in MSBs. SAR Used to shift bits of a byte/word towards the right and copy the old MSB into the new MSB. Instructions to perform rotate operations ROL Used to rotate bits of byte/word towards the left, i.e. MSB to LSB and to Carry Flag [CF]. ROR Used to rotate bits of byte/word towards the right, i.e. LSB to MSB and to Carry Flag [CF]. RCR Used to rotate bits of byte/word towards the right, i.e. LSB to CF and CF to MSB. RCL Used to rotate bits of byte/word towards the left, i.e. MSB to CF and CF to LSB. String Instructions String is a group of bytes/words and their memory is always allocated in a sequential order. Following is the list of instructions under this group REP Used to repeat the given instruction till CX 0. REPE/REPZ Used to repeat the given instruction until CX = 0 or zero flag ZF = 1. REPNE/REPNZ Used to repeat the given instruction until CX = 0 or zero flag ZF = 1. MOVS/MOVSB/MOVSW Used to move the byte/word from one string to another. COMS/COMPSB/COMPSW Used to compare two string bytes/words.

27 INS/INSB/INSW Used as an input string/byte/word from the I/O port to the provided memory location. OUTS/OUTSB/OUTSW Used as an output string/byte/word from the provided memory location to the I/O port. SCAS/SCASB/SCASW Used to scan a string and compare its byte with a byte in AL or string word with a word in AX. LODS/LODSB/LODSW Used to store the string byte into AL or string word into AX. Program Execution Transfer Instructions (Branch and Loop Instructions) These instructions are used to transfer/branch the instructions during an execution. It includes the following instructions Instructions to transfer the instruction during an execution without any condition CALL Used to call a procedure and save their return address to the stack. RET Used to return from the procedure to the main program. JMP Used to jump to the provided address to proceed to the next instruction. Instructions to transfer the instruction during an execution with some conditions JA/JNBE Used to jump if above/not below/equal instruction satisfies. JAE/JNB Used to jump if above/not below instruction satisfies. JBE/JNA Used to jump if below/equal/ not above instruction satisfies.

28 JC Used to jump if carry flag CF = 1 JE/JZ Used to jump if equal/zero flag ZF = 1 JG/JNLE Used to jump if greater/not less than/equal instruction satisfies. JGE/JNL Used to jump if greater than/equal/not less than instruction satisfies. JL/JNGE Used to jump if less than/not greater than/equal instruction satisfies. JLE/JNG Used to jump if less than/equal/if not greater than instruction satisfies. JNC Used to jump if no carry flag (CF = 0) JNE/JNZ Used to jump if not equal/zero flag ZF = 0 JNO Used to jump if no overflow flag OF = 0 JNP/JPO Used to jump if not parity/parity odd PF = 0 JNS Used to jump if not sign SF = 0 JO Used to jump if overflow flag OF = 1 JP/JPE Used to jump if parity/parity even PF = 1 JS Used to jump if sign flag SF = 1 Processor Control Instructions These instructions are used to control the processor action by setting/resetting the flag values. Following are the instructions under this group STC Used to set carry flag CF to 1

29 CLC Used to clear/reset carry flag CF to 0 CMC Used to put complement at the state of carry flag CF. STD Used to set the direction flag DF to 1 CLD Used to clear/reset the direction flag DF to 0 STI Used to set the interrupt enable flag to 1, i.e., enable INTR input. CLI Used to clear the interrupt enable flag to 0, i.e., disable INTR input. Iteration Control Instructions These instructions are used to execute the given instructions for number of times. Following is the list of instructions under this group LOOP Used to loop a group of instructions until the condition satisfies, i.e., CX = 0 LOOPE/LOOPZ Used to loop a group of instructions till it satisfies ZF = 1 & CX = 0 LOOPNE/LOOPNZ Used to loop a group of instructions till it satisfies ZF = 0 & CX = 0 JCXZ Used to jump to the provided address if CX = 0 Interrupt Instructions These instructions are used to call the interrupt during program execution. INT Used to interrupt the program during execution and calling service specified. INTO Used to interrupt the program during execution if OF = 1 IRET Used to return from interrupt service to the main program

30 Assembler Directives - Assembly Language Programming with Subroutines, Macros, Passing Parameters, Use of stack. Directives And Operator: Assembler: is a program that accepts an assembly language program as input and converts it into an object module and prepares for loading the program into memory for execution. Loader (linker) further converts the object module prepared by the assembler into executable form, by linking it with other object modules and library modules. The final executable map of the assembly language program is prepared by the loader at the time of loading into the primary memory for actual execution. The assembler prepares the relocation and linkages information (subroutine, ISR) for loader. The operating system that actually has the control of the memory, which is to be allotted to the program for execution, passes the memory address at which the program is to be loaded for execution and the map of the available memory to the loader. Based on this information and the information generated by the assembler, the loader generates an executable map of the program and further physically loads it into the memory and transfers control to for execution. Thus the basic task of an assembler is to generate the object module and prepare the loading and linking information. Procedure for assembling a program Assembling a program proceeds statement by statement sequentially. The first phase of assembling is to analyze the program to be converted. o It also analyses the segments used by the program types and labels and their memory requirements. The second phase looks for the addresses and data assigned to the labels. o It also finds out codes of the instructions from the instruction machine, code database and the program data. o o It processes the pseudo operands and directives. It is the task of the assembler designer to select the suitable strings for using them as directives,pseudo operands or reserved words and decides syntax. Directives Also called as pseudo operations that control the assembly process. They indicate how an operand or section of a program to be processed by the assembler.

31 They generate and store information in the memory. Assembler Memory models Each model defines the way that a program is stored in the memory system. Tiny: data fits into one segment written in.com format Small: has two segments data and memory. There are several other models too. Directive for string data in a memory segment DB (DEFINE BYTE) The DB directive is used to declare a byte type variable, or a set aside one or more storage locations of type byte in memory. PRICES DB 49H, 98H, 29H;Declare array of 3 bytes named PRICES and initialize them with specified values. NAMES DB SAKSHI ; Declare array of 6 bytes and initialize with ASCII codes for the letters in SAKSHI. TEMP DB 100 DUP (?); Set aside 100 bytes of storage in memory and give it the name TEMP. But leave the 100 bytes un-initialized. PRESSURE DB 20H DUP (0); Set aside 20H bytes of storage in memory, give it the name PRESSURE and put 0 in all 20H locations. DD (DEFINE DOUBLE WORD) The DD directive is used to declare a variable of type double word or to reserve memory locations, which can be accessed as type double word. Example: ARRAY DD H This will define a double word named ARRAY and initialize the double word with the specified value when the program is loaded into memory to be run. The low word, 9261H, will be put in memory at a lower address than the high word. DQ (DEFINE QUADWORD) The DQ directive is used to tell the assembler to declare a variable 4 words in length or to reserve 4 words of storage in memory. Example: BIG_NUMBER DQ A92BH This will declare a variable named BIG_NUMBER and initialize the 4 words set aside with the specified number when the program is loaded into memory to be run. DT (DEFINE TEN BYTES) The DT directive is used to tell the assembler to declare a variable, which is 10 bytes in length or to reserve 10 bytes of storage in memory. Example:

32 PACKED_BCD DT This will declare an array named PACKED_BCD, which is 10 bytes in length. It will initialize the 10 bytes with the values 11, 22, 33, 44, 55, 66, 77, 88, 99, and 00 when the program is loaded into memory to be run. The statement RESULT DT 20H DUP (0) will declare an array of 20H blocks of 10 bytes each and initialize all 320 bytes to 00 when the program is loaded into memory to be run. DW (DEFINE WORD) The DW directive is used to tell the assembler to define a variable of type word or to reserve storage locations of type word in memory. The statement MULTIPLIER DW 437AH, for example, declares a variable of type word named MULTIPLIER, and initialized with the value 437AH when the program is loaded into memory to be run. Example: WORDS DW 1234H, 3456H; Declares an array of 2 words and initialize them with the specified values. STORAGE DW 100 DUP (0); Reserve an array of 100 words of memory and initialize all 100 words with Array is named as STORAGE. STORAGE DW 100 DUP (?); Reserve 100 word of storage in memory and give it the name STORAGE, but leave the words un-initialized. Segment: The SEGMENT directive is used to indicate the start of a logical segment. Preceding the SEGMENT directive is the name you want to give the segment. For example, the statement CODE SEGMENT indicates to the assembler the start of a logical segment called CODE. The SEGMENT and ENDS directive are used to bracket a logical segment containing code of data. Additional terms are often added to a SEGMENT directive statement to indicate some special way in which we want the assembler to treat the segment. The statement CODE SEGMENT WORD tells the assembler that we want the content of this segment located on the next available word (even address) when segments ate combined and given absolute addresses. Without this WORD addition, the segment will be located on the next available paragraph (16-byte) address, which might waste as much as 15 bytes of memory. The statement CODE SEGMENT PUBLIC tells the assembler that the segment may be put together with other segments named CODE from other assembly modules when the modules are linked together. Example Name SEGMENT Variable_name DB.

33 Variable_name DW. Name ENDS Data SEGMENT Data1 DB. Data2 DW. Data ENDS Code SEGMENT START: MOV AX,BX Code ENDS ENDS (END SEGMENT) This directive is used with the name of a segment to indicate the end of that logical segment. CODE SEGMENT; Start of logical segment containing code instruction statements CODE ENDS; End of segment named CODE END (END PROCEDURE) The END directive is put after the last statement of a program to tell the assembler that this is the end of the program module. The assembler will ignore any statements after an END directive, so you should make sure to use only one END directive at the very end of your program module. A carriage return is required after the END directive. ALIGN Memory array is stored in word boundaries. Example: ALIGN 2 means storing from an even address The data XX is aligned to the even address. ASSUME ASSUME tells the assembler what names have been chosen for Code, Data Extra andstack segments. Informs the assembler that the register CS is to be initialized with theaddress allotted by the loader to the label CODE and DS is similarly initialized with theaddress of label DATA. Example ASSUME CS: Name of code segment ASSUME DS: Name of the data segment ASSUME CS: Code1, DS: Data1 EQU (EQUATE) EQU is used to give a name to some value or symbol. Each time the assembler finds the given name in the program, it replaces the name with the value or symbol you

34 equated with that name. Example Data SEGMENT Num1 EQU 50H Num2 EQU 66H Data ENDS Numeric value 50H and 66H are assigned to Num1 and Num2 ORG (ORIGIN) ORG Changes the starting offset address of the data in the data segment. As an assembler assembles a section of a data declarations or instruction statements, it uses a location counter to keep track of how many bytes it is from the start of a segment at any time. The location counter is automatically set to 0000 when assembler starts reading a segment. The ORG directive allows you to set the location counter to a desired value at any point in the program. Example:The statement ORG 2000H tells the assembler to set the location counter to 2000H. A $ it often used to symbolically represent the current value of the location counter, the $ actually represents the next available byte location where the assembler can put a data or code byte. The $ is often used in ORG statements to tell the assembler to make some change in the location counter relative to its current value. The statement ORG $ tells the assembler increment the value of the location counter by 100 from its current value. PROC (PROCEDURE) The PROC directive is used to identify the start of a procedure. The PROC directive follows a name you give the procedure. After the PROC directive, the term near or the term far is used to specify the type of the procedure. Example: DIVIDE PROC FAR This identifies the start of a procedure named DIVIDE and tells the assembler that the procedure is far (in a segment with different name from the one that contains the instructions which calls the procedure). The PROC directive is used with the ENDP directive to bracket a procedure. NEAR: the procedure resides in the same code segment. (Local) FAR: resides at any location in the memory. Example Add PROC NEAR

35 ADD AX,BX MOV CX,AX RET Add ENDP PROC directive stores the contents of the register in the stack. ENDP (END PROCEDURE) The directive is used along with the name of the procedure to indicate the end of a procedure to the assembler. The directive, together with the procedure directive, PROC, is used to bracket a procedure. Example: SQUARE_ROOT PROC; Start of procedure. SQUARE_ROOT ENDP; End of procedure. EXTRN The EXTRN directive is used to tell the assembler that the name or labels following the directive are in some other assembly module. For example, if you want to call a procedure, which in a program module assembled at a different time from that which contains the CALL instruction, you must tell the assembler that the procedure is external. The assembler will then put this information in the object code file so that the linker can connect the two modules together. For a reference to externally named variable, you must specify the type of the variable, as in the statement EXTRN DIVISOR: WORD. The statement EXTRN DIVIDE: FAR tells the assembler that DIVIDE is a label of type FAR in another assembler module. Name or labels referred to as external in one module must be declared public with the PUBLIC directive in the module in which they are defined. Example: PROCEDURE SEGMENT EXTRN DIVIDE: FAR Found in segment PROCEDURES PROCEDURE ENDS If you want to call a Factorial procedure of Module1 from Module2 it must be declared as PUBLIC in Module1. PUBLIC Large program are usually written as several separate modules. Each module is individually assembled, tested, and debugged. When all the modules are working correctly, their object code files are linked together to form the complete program. In order for the modules to link together correctly, any variable name or label referred to in other modules must be declared PUBLIC in the module in which it is defined. The PUBLIC directive is used to tell the assembler that a specified name or label will be accessed from other modules.

36 Example: The statement PUBLIC DIVISOR, DIVIDEND, which makes the two variables DIVISOR and DIVIDEND available to other assembly modules. A sample for full segment definition Data SEGMENT Num1 DB 10H Num2 DB 20H Num3 EQU 30H Data ENDS ASSUME CS:Code,DS:Data Code SEGMENT START: MOV AX,Data MOV DS,AX MOV AX,Num1 MOV CX,Num2 ADD AX,CX Code ENDS LENGTH LENGTH is an operator, which tells the assembler to determine the number of elements in some named data item, such as a string or an array. Example: MOV CX, LENGTH STRING1 This will determine the number of elements in STRING1 and load it into CX. If the string was declared as a string of bytes, LENGTH will produce the number of bytes in the string. If the string was declared as a word string, LENGTH will produce the number of words in the string. OFFSET OFFSET is an operator, which tells the assembler to determine the offset or displacement of a named data item (variable), a procedure from the start of the segment, which contains it. Example: MOV BX; OFFSET PRICES; It will determine the offset of the variable PRICES from the start of the segment in which PRICES is defined and will load this value into BX. PTR (POINTER) The PTR operator is used to assign a specific type to a variable or a label. It is necessary to do this in any instruction where the type of the operand is not clear. Example:

37 INC [BX] It will not know whether to increment the byte pointed to by BX. We use the PTR operator to clarify how we want the assembler to code the instruction. INC BYTE PTR [BX] This statement tells the assembler that we want to increment the byte pointed to by BX. INC WORD PTR [BX] This statement tells the assembler that we want to increment the word pointed to by BX. The PTR operator assigns the type specified before PTR to the variable specified after PTR. We can also use the PTR operator to clarify our intentions when we use indirect Jump instructions. Example: If we want to do a near jump, we write the instruction as JMP WORD PTR [BX]. If we want to do a far jump, we write the instruction as JMP DWORD PTR [BX]. EVEN (ALIGN ON EVEN MEMORY ADDRESS) As an assembler assembles a section of data declaration or instruction statements, it uses a location counter to keep track of how many bytes it is from the start of a segment at any time. The EVEN directive tells the assembler to increment the location counter to the next even address, if it is not already at an even address. A NOP instruction will be inserted in the location incremented over. Example: DATA SEGMENT; SALES DB 9 DUP (?); Location counter will point to 0009 after this instruction. EVEN; Increment location counter to 000AH INVENTORY DW 100 DUP (0); Array of 100 words starting on even address for quicker read DATA ENDS; NAME The NAME directive is used to give a specific name to each assembly module when programs consisting of several modules are written. LABEL As an assembler assembles a section of a data declarations or instruction statements, it uses a location counter to be keep track of how many bytes it is from the start of a segment at any time. The LABEL directive is used to give a name to the current value in the location counter. The LABEL directive must be followed by a term that specifics the type you want to associate with that name. If the label is going to be used as the destination for a jump or

38 a call, then the label must be specified as type near or type far. If the label is going to be used to reference a data item, then the label must be specified as type byte, type word, or type double word. Here s how we use the LABEL directive for a jump address. ENTRY_POINT LABEL FAR; Can jump to here from another segment NEXT: MOV AL, BL; Can not do a far jump directly to a label with a colon The following example shows how we use the label directive for a data reference. STACK_SEG SEGMENT STACK DW 100 DUP (0); Set aside 100 words for stack STACK_TOP LABEL WORD; Give name to next location after last word in stack STACK_SEG ENDS To initialize stack pointer, use MOV SP OFFSET STACK_TOP SHORT The SHORT operator is used to tell the assembler that only a 1 byte displacement is needed to code a jump instruction in the program. The destination must in the range of 128 bytes to +127 bytes from the address of the instruction after the jump. Example: JMP SHORT NEARBY_LABEL TYPE The TYPE operator tells the assembler to determine the type of a specified variable. The assembler actually determines the number of bytes in the type of the variable. For a byte-type variable, the assembler will give a value of 1, for a word-type variable, the assembler will give a value of 2, and for a double word-type variable, it will give a value of 4. GLOBAL (DECLARE SYMBOLS AS PUBLIC OR EXTRN) The GLOBAL directive can be used in place of a PUBLIC directive or in place of an EXTRN directive. For a name or symbol defined in the current assembly module, the GLOBAL directive is used to make the symbol available to other modules. Example: GLOBAL DIVISOR This statement makes the variable DIVISOR public so that it can be accessed from other assembly modules. INCLUDE (INCLUDE SOURCE CODE FROM FILE) This directive is used to tell the assembler to insert a block of source code from the named file into the current source module.

39 OTHER DIRECTIVES: There are several other directives that can be used for Conditional Assembly as listed below: IF If the expression is true IFB If the argument is blank IFNB If the argument is not blank IFDEF If the label has been defined IFNDEF If the label has not been defined IFIDN If argument 1 equals argument 2 IFDIF If argument 1 does not equal argument 2 With each of the above constructs, the code that follows gets assembled only if the stated condition is true. MACROS Macros provide several powerful mechanisms useful for the development of generic programs. A Macro is a group of instructions with a name. When a macro is invoked, the associated set of instructions is inserted in place in to the source, replacing the macro name. This macro expansion is done by a Macro Preprocessor and it happens before assembly. Thus the actual Assembler sees the expanded source! We could consider the macro as shorthand for a piece of text; somewhat like a new pseudo code instruction. Macros and Procedures: Macros are similar to procedures in some respects, yet are quite different in many other respects. Procedure: Only one copy exists in memory. Thus memory consumed is less. Called when required; Execution time overhead is present because of the call and return instructions. Macro: When a macro is invoked, the corresponding text is inserted in to the source. Thus multiple copies exist in the memory leading to greater space requirements. However, there is no execution overhead because there are no additional call and return instructions. The code is in-place. These concepts are illustrated in the following figure: MACRO Definition:

40 A macro has a name. The body of the macro is defined between a pair of directives, MACRO and ENDM. Two macros are defined in the example given below. Examples of Macro Definitions: Definition of a Macro named PUSHA2C PUSHA2C MACRO; PUSH AX; PUSH BX; PUSH CX; ENDM; Another Macro named POPA2C is defined here POPA2C MACRO; POP CX; POP BX; POP AX; ENDM; Examples of Macro usage: The following examples illustrate the use of macros. Program with macro invocations: PUSHA2C MOV CX, DA1 MOV BX, DA2 ADD AX, BX ADD AX, CX MOV DA2, AX POPA2C When the Macro Preprocessor expands the macros in the above source, the expanded source looks as shown below: PUSH AX PUSH BX PUSH CX MOV CX, DA1 MOV BX, DA2 ADD AX, BX ADD AX, CX MOV DA2, AX POP CX POP BX POP AX Note how the macro name is replaced by the associated set of instructions. Thus, macro name does not appear in the expanded source code. In other words, the actual Assembler does not see the macros. What gets assembled is the expanded source.

8086 INTERNAL ARCHITECTURE

8086 INTERNAL ARCHITECTURE 8086 INTERNAL ARCHITECTURE Segment 2 Intel 8086 Microprocessor The 8086 CPU is divided into two independent functional parts: a) The Bus interface unit (BIU) b) Execution Unit (EU) Dividing the work between

More information

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil Microprocessor By Mrs. R.P.Chaudhari Mrs.P.S.Patil Chapter 1 Basics of Microprocessor CO-Draw Architecture Of 8085 Salient Features of 8085 It is a 8 bit microprocessor. It is manufactured with N-MOS technology.

More information

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013)

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013) SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013) UNIT I THE 8086 MICROPROCESSOR PART A (2 MARKS) 1. What are the functional

More information

Intel 8086: Instruction Set

Intel 8086: Instruction Set IUST-EE (Chapter 6) Intel 8086: Instruction Set 1 Outline Instruction Set Data Transfer Instructions Arithmetic Instructions Bit Manipulation Instructions String Instructions Unconditional Transfer Instruction

More information

ASSEMBLY LANGUAGE PROGRAMMING OF THE MICROCOMPUTER

ASSEMBLY LANGUAGE PROGRAMMING OF THE MICROCOMPUTER CHAPTER ASSEMBLY LANGUAGE PROGRAMMING OF THE MICROCOMPUTER 2.1 Introduction To run a program, a microcomputer must have the program stored in binary form in successive memory locations. There are three

More information

3.1 DATA MOVEMENT INSTRUCTIONS 45

3.1 DATA MOVEMENT INSTRUCTIONS 45 3.1.1 General-Purpose Data Movement s 45 3.1.2 Stack Manipulation... 46 3.1.3 Type Conversion... 48 3.2.1 Addition and Subtraction... 51 3.1 DATA MOVEMENT INSTRUCTIONS 45 MOV (Move) transfers a byte, word,

More information

Intel 8086 MICROPROCESSOR ARCHITECTURE

Intel 8086 MICROPROCESSOR ARCHITECTURE Intel 8086 MICROPROCESSOR ARCHITECTURE 1 Features It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 2 20 memory locations (1 MB). It can support up to 64K I/O ports. It provides 14, 16

More information

Internal architecture of 8086

Internal architecture of 8086 Case Study: Intel Processors Internal architecture of 8086 Slide 1 Case Study: Intel Processors FEATURES OF 8086 It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 220 memory locations (1

More information

9/25/ Software & Hardware Architecture

9/25/ Software & Hardware Architecture 8086 Software & Hardware Architecture 1 INTRODUCTION It is a multipurpose programmable clock drive register based integrated electronic device, that reads binary instructions from a storage device called

More information

ADVANCE MICROPROCESSOR & INTERFACING

ADVANCE MICROPROCESSOR & INTERFACING VENUS INTERNATIONAL COLLEGE OF TECHNOLOGY Gandhinagar Department of Computer Enggineering ADVANCE MICROPROCESSOR & INTERFACING Name : Enroll no. : Class Year : 2014-15 : 5 th SEM C.E. VENUS INTERNATIONAL

More information

Intel 8086 MICROPROCESSOR. By Y V S Murthy

Intel 8086 MICROPROCESSOR. By Y V S Murthy Intel 8086 MICROPROCESSOR By Y V S Murthy 1 Features It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 2 20 memory locations (1 MB). It can support up to 64K I/O ports. It provides 14,

More information

Northern India Engineering College, Delhi (GGSIP University) PAPER I

Northern India Engineering College, Delhi (GGSIP University) PAPER I PAPER I Q1.Explain IVT? ANS. interrupt vector table is a memory space for storing starting addresses of all the interrupt service routine. It stores CS:IP PAIR corresponding to each ISR. An interrupt vector

More information

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad Introduction to MS-DOS Debugger DEBUG In this laboratory, we will use DEBUG program and learn how to: 1. Examine and modify the contents of the 8086 s internal registers, and dedicated parts of the memory

More information

Question Bank Part-A UNIT I- THE 8086 MICROPROCESSOR 1. What is microprocessor? A microprocessor is a multipurpose, programmable, clock-driven, register-based electronic device that reads binary information

More information

WINTER 12 EXAMINATION Subject Code : Model Answer Page No : / N. a) Describe the function of SID and SOD pins of 8085 microprocessor

WINTER 12 EXAMINATION Subject Code : Model Answer Page No : / N. a) Describe the function of SID and SOD pins of 8085 microprocessor Subject Code : Model Answer Page No : / N Q.1) SOLVE ANY FIVE : (20 MARKS) a) Describe the function of SID and SOD pins of 8085 microprocessor Ans: - SID: - (2 Mark) Serial Input Data SID pin is used to

More information

US06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 1: Assembly Language Terms & Directives

US06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 1: Assembly Language Terms & Directives Introduction: US06CCSC04: Introduction to Microprocessors and A microprocessor is the chip containing some control and logic circuits that is capable of a making arithmetic and logical decision based on

More information

Introduction to Microprocessor

Introduction to Microprocessor Introduction to Microprocessor The microprocessor is a general purpose programmable logic device. It is the brain of the computer and it performs all the computational tasks, calculations data processing

More information

8086 INSTRUCTION SET

8086 INSTRUCTION SET 8086 INSTRUCTION SET Complete 8086 instruction set Quick reference: AAA AAD AAM AAS ADC ADD AND CALL CBW CLC CLD CLI CMC CMP CMPSB CMPSW CWD DAA DAS DEC DIV HLT IDIV IMUL IN INC INT INTO I JA JAE JB JBE

More information

Chapter Four Instructions Set

Chapter Four Instructions Set Chapter Four Instructions set Instructions set 8086 has 117 instructions, these instructions divided into 6 groups: 1. Data transfer instructions 2. Arithmetic instructions 3. Logic instructions 4. Shift

More information

PESIT Bangalore South Campus

PESIT Bangalore South Campus INTERNAL ASSESSMENT TEST 2 Date : 28/03/2016 Max Marks: 50 Subject & Code : Microprocessor (10CS45) Section: IV A and B Name of faculty: Deepti.C Time: 8:30-10:00 am Note: Answer any complete five questions

More information

PESIT Bangalore South Campus

PESIT Bangalore South Campus INTERNAL ASSESSMENT TEST 2 Date : 02/04/2018 Max Marks: 40 Subject & Code : Microprocessor (15CS44) Section : IV A and B Name of faculty: Deepti.C Time : 8:30 am-10:00 am Note: Note: Answer any five complete

More information

Arithmetic and Logic Instructions And Programs

Arithmetic and Logic Instructions And Programs Dec Hex Bin 3 3 00000011 ORG ; FOUR Arithmetic and Logic Instructions And Programs OBJECTIVES this chapter enables the student to: Demonstrate how 8-bit and 16-bit unsigned numbers are added in the x86.

More information

UNIT II OVERVIEW MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Introduction to 8086 microprocessors. Architecture of 8086 processors

UNIT II OVERVIEW MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Introduction to 8086 microprocessors. Architecture of 8086 processors OVERVIEW UNIT II Introduction to 8086 microprocessors Architecture of 8086 processors Register Organization of 8086 Memory Segmentation of 8086 Pin Diagram of 8086 Timing Diagrams for 8086 Interrupts of

More information

EC 333 Microprocessor and Interfacing Techniques (3+1)

EC 333 Microprocessor and Interfacing Techniques (3+1) EC 333 Microprocessor and Interfacing Techniques (3+1) Lecture 6 8086/88 Microprocessor Programming (Arithmetic Instructions) Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC

More information

8088/8086 Programming Integer Instructions and Computations

8088/8086 Programming Integer Instructions and Computations Unit3 reference 2 8088/8086 Programming Integer Instructions and Computations Introduction Up to this point we have studied the software architecture of the 8088 and 8086 microprocessors, their instruction

More information

Week /8086 Microprocessor Programming I

Week /8086 Microprocessor Programming I Week 4 8088/8086 Microprocessor Programming I Example. The PC Typewriter Write an 80x86 program to input keystrokes from the PC s keyboard and display the characters on the system monitor. Pressing any

More information

UNIT 2 PROCESSORS ORGANIZATION CONT.

UNIT 2 PROCESSORS ORGANIZATION CONT. UNIT 2 PROCESSORS ORGANIZATION CONT. Types of Operand Addresses Numbers Integer/floating point Characters ASCII etc. Logical Data Bits or flags x86 Data Types Operands in 8 bit -Byte 16 bit- word 32 bit-

More information

b) List the 16 Bit register pairs of 8085?(Any 2 pair, 1 Mark each) 2M Ans: The valid 16 bit register pair of 8085 are

b) List the 16 Bit register pairs of 8085?(Any 2 pair, 1 Mark each) 2M Ans: The valid 16 bit register pair of 8085 are Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate

More information

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY BACKGROUND 8086 CPU has 8 general purpose registers listed below: AX - the accumulator register (divided into AH / AL): 1. Generates shortest machine code 2. Arithmetic, logic and data transfer 3. One

More information

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN ROAD MAP SDK-86 Intel 8086 Features 8086 Block Diagram 8086 Architecture Bus Interface Unit Execution Unit 8086 Architecture 8086 Programmer s Model Flag Register

More information

Code segment Stack segment

Code segment Stack segment Registers Most of the registers contain data/instruction offsets within 64 KB memory segment. There are four different 64 KB segments for instructions, stack, data and extra data. To specify where in 1

More information

INTRODUCTION TO MICROPROCESSORS

INTRODUCTION TO MICROPROCESSORS INTRODUCTION TO MICROPROCESSORS Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu January 7, 2016 Richa Upadhyay Prabhu (MPSTME) INTRODUCTION January 7, 2016 1 / 63 Course Design Prerequisite:

More information

ELE 3230 Microprocessors and Computer Systems

ELE 3230 Microprocessors and Computer Systems ELE 3230 Microprocessors and Computer Systems Chapter 4 8088 System Architecture (*Hall:ch2; Brey:ch1; Triebel:ch2) ELE 3230 - Chapter 4 1 Historical Background 1969/70 Intel 4004, first Microprocessor

More information

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit 1 1. introduction The internal function of 8086 processor are partitioned logically into processing units,bus Interface Unit(BIU)

More information

CC411: Introduction To Microprocessors

CC411: Introduction To Microprocessors CC411: Introduction To Microprocessors OBJECTIVES this chapter enables the student to: Describe the Intel family of microprocessors from 8085 to Pentium. In terms of bus size, physical memory & special

More information

PHI Learning Private Limited

PHI Learning Private Limited MICROPROCESSORS The 8086/8088, 80186/80286, 80386/80486 and the Pentium Family Nilesh B. Bahadure Reader Department of Electronics and Telecommunication Engineering Bhilai Institute of Technology, Durg

More information

Unit I Introduction. Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad , India.

Unit I Introduction. Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad , India. Unit I Introduction Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad 501218, India. Pre-requisites Digital Logic Design (A1404) Computer Architecture

More information

icroprocessor istory of Microprocessor ntel 8086:

icroprocessor istory of Microprocessor ntel 8086: Microprocessor A microprocessor is an electronic device which computes on the given input similar to CPU of a computer. It is made by fabricating millions (or billions) of transistors on a single chip.

More information

Q1: Multiple choice / 20 Q2: Protected mode memory accesses

Q1: Multiple choice / 20 Q2: Protected mode memory accesses 16.317: Microprocessor-Based Systems I Summer 2012 Exam 2 August 1, 2012 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g.,

More information

complement) Multiply Unsigned: MUL (all operands are nonnegative) AX = BH * AL IMUL BH IMUL CX (DX,AX) = CX * AX Arithmetic MUL DWORD PTR [0x10]

complement) Multiply Unsigned: MUL (all operands are nonnegative) AX = BH * AL IMUL BH IMUL CX (DX,AX) = CX * AX Arithmetic MUL DWORD PTR [0x10] The following pages contain references for use during the exam: tables containing the x86 instruction set (covered so far) and condition codes. You do not need to submit these pages when you finish your

More information

Basic Execution Environment

Basic Execution Environment Basic Execution Environment 3 CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel Architecture processor as seen by assembly-language programmers.

More information

L1 Remember, L2 Understand, L3 - Apply, L4 Analyze, L5 Evaluate, L6 Create

L1 Remember, L2 Understand, L3 - Apply, L4 Analyze, L5 Evaluate, L6 Create Sample µp questions Syllabus: Microprocessors And Microcontrollers - 15CS44: Modules 1, 2, 3, 4, 5 Text book: Muhammad Ali Mazidi, Janice GillispieMazidi, Danny Causey, The x86 PC Assembly Language Design

More information

US06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 3: Assembly Language Instructions II

US06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 3: Assembly Language Instructions II Unconditional & Conditional JUMP instructions: Conditional JUMP instructions: JA/JNBE Jump if above / Jump if not Below or Equal These two mnemonics represent the same instruction. The term above and below

More information

UNIT-I. 1.Draw and explain the Architecture of a 8085 Microprocessor?

UNIT-I. 1.Draw and explain the Architecture of a 8085 Microprocessor? UNIT-I INTRODUCTION TO MICROPROCESSOR A common way of categorizing microprocessors is by the no. of bits that their ALU can work with at a time. (i) The first commercially available microprocessor was

More information

CS-202 Microprocessor and Assembly Language

CS-202 Microprocessor and Assembly Language CS-202 Microprocessor and Assembly Language Lecture 2 Introduction to 8086 Assembly Language Dr Hashim Ali Spring - 2019 Department of Computer Science and Engineering HITEC University Taxila!1 Lecture

More information

8086 ASSEMBLY LANGUAGE PROGRAMMING

8086 ASSEMBLY LANGUAGE PROGRAMMING UNIT-II 8086 ASSEMBLY LANGUAGE PROGRAMMING Contents at a glance: 8086 Instruction Set Assembler directives Procedures and macros. 8086 MEMORY INTERFACING: 8086 addressing and address decoding Interfacing

More information

CS401 Assembly Language Solved MCQS From Midterm Papers

CS401 Assembly Language Solved MCQS From Midterm Papers CS401 Assembly Language Solved MCQS From Midterm Papers May 14,2011 MC100401285 Moaaz.pk@gmail.com MC100401285@gmail.com PSMD01(IEMS) Question No:1 ( Marks: 1 ) - Please choose one The first instruction

More information

Topic 2 :16 Bit Microprocessor: 8086 (24 Marks)

Topic 2 :16 Bit Microprocessor: 8086 (24 Marks) Topic 2 :16 Bit Microprocessor: 8086 (24 Marks) Features of 8086 8086 is a 16 bit processor. It s ALU, internal registers works with 16bit binary word 8086 has a 16bit data bus. It can read or write data

More information

Signed number Arithmetic. Negative number is represented as

Signed number Arithmetic. Negative number is represented as Signed number Arithmetic Signed and Unsigned Numbers An 8 bit number system can be used to create 256 combinations (from 0 to 255), and the first 128 combinations (0 to 127) represent positive numbers

More information

Arithmetic Instructions

Arithmetic Instructions Segment 3C Arithmetic Instructions This topic covers the following instructions: Addition (ADD, INC, ADC) Subtraction (SUB, DEC, SBB,CMP) Multiplication (MUL, IMUL) Division (DIV, IDIV) BCD Arithmetic

More information

EEM336 Microprocessors I. Data Movement Instructions

EEM336 Microprocessors I. Data Movement Instructions EEM336 Microprocessors I Data Movement Instructions Introduction This chapter concentrates on common data movement instructions. 2 Chapter Objectives Upon completion of this chapter, you will be able to:

More information

EC-333 Microprocessor and Interfacing Techniques

EC-333 Microprocessor and Interfacing Techniques EC-333 Microprocessor and Interfacing Techniques Lecture 3 The Microprocessor and its Architecture Dr Hashim Ali Fall - 2018 Department of Computer Science and Engineering HITEC University Taxila Slides

More information

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. 8086 Microprocessor Microprocessor Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. It is used as CPU (Central Processing Unit) in computers.

More information

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY BACKGROUND Segment The "SEGMENT" and "ENDS" directives indicate to the assembler the beginning and ending of a segment and have the following format label SEGMENT [options] ;place the statements belonging

More information

A Presentation created By Ramesh.K Press Ctrl+l for full screen view

A Presentation created By Ramesh.K Press Ctrl+l for full screen view Press Ctrl+l for full screen view A Presentation created By Ramesh.K rameshpkd@gmail.com Press Ctrl+l for full screen view A Microprocessor sor is a multipurpose, programmable logic device that reads binary

More information

UNIT-1. It is a 16-bit Microprocessor (μp).it s ALU, internal registers works with 16bit binary word.

UNIT-1. It is a 16-bit Microprocessor (μp).it s ALU, internal registers works with 16bit binary word. UNIT-1 Introduction to 8086: 8086 Microprocessor is an enhanced version of 8085Microprocessor that was designed by Intel in 1976. It is a 16-bit Microprocessor having 20 address lines and16 data lines

More information

Assembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language

Assembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language 4345 Assembly Language Assembly Language Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology Assembly Language 3-1 Overview of Assembly Language Advantages: Faster as compared

More information

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy Digital Logic Design Ch1-1 8086 Microprocessor Features: The 8086 microprocessor is a 16 bit microprocessor. The term 16 bit means

More information

Ex: Write a piece of code that transfers a block of 256 bytes stored at locations starting at 34000H to locations starting at 36000H. Ans.

Ex: Write a piece of code that transfers a block of 256 bytes stored at locations starting at 34000H to locations starting at 36000H. Ans. INSTRUCTOR: ABDULMUTTALIB A H ALDOURI Conditional Jump Cond Unsigned Signed = JE : Jump Equal JE : Jump Equal ZF = 1 JZ : Jump Zero JZ : Jump Zero ZF = 1 JNZ : Jump Not Zero JNZ : Jump Not Zero ZF = 0

More information

Assignment no:4 on chapter no :3 : Instruction set of 8086

Assignment no:4 on chapter no :3 : Instruction set of 8086 Assignment no:4 on chapter no :3 : Instruction set of 8086 1) Describe any two string operation instruction of 8086 with syntax & one example of each. 1] REP: REP is a prefix which is written before one

More information

Kingdom of Saudi Arabia Ministry of Higher Education. Taif University. Faculty of Computers & Information Systems

Kingdom of Saudi Arabia Ministry of Higher Education. Taif University. Faculty of Computers & Information Systems Kingdom of Saudi Arabia Ministry of Higher Education Taif University Faculty of Computers & Information Systems المملكة العربية السعودية وزارة التعليم العالي جامعة الطاي ف آلية الحاسبات ونظم المعلومات

More information

Microprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)

Microprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017) Microprocessor and Assembly Language Week-5 System Programming, BCS 6th, IBMS (2017) High Speed Memory Registers CPU store data temporarily in these location CPU process, store and transfer data from one

More information

ORG ; TWO. Assembly Language Programming

ORG ; TWO. Assembly Language Programming Dec 2 Hex 2 Bin 00000010 ORG ; TWO Assembly Language Programming OBJECTIVES this chapter enables the student to: Explain the difference between Assembly language instructions and pseudo-instructions. Identify

More information

Basic Assembly SYSC-3006

Basic Assembly SYSC-3006 Basic Assembly Program Development Problem: convert ideas into executing program (binary image in memory) Program Development Process: tools to provide people-friendly way to do it. Tool chain: 1. Programming

More information

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) WINTER 2018 EXAMINATION MODEL ANSWER

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) WINTER 2018 EXAMINATION MODEL ANSWER Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate

More information

APPENDIX C INSTRUCTION SET DESCRIPTIONS

APPENDIX C INSTRUCTION SET DESCRIPTIONS APPENDIX C INSTRUCTION SET DESCRIPTIONS This appendix provides reference information for the 80C186 Modular Core family instruction set. Tables C-1 through C-3 define the variables used in Table C-4, which

More information

UNIT III MICROPROCESSORS AND MICROCONTROLLERS MATERIAL OVERVIEW: Addressing Modes of Assembler Directives. Procedures and Macros

UNIT III MICROPROCESSORS AND MICROCONTROLLERS MATERIAL OVERVIEW: Addressing Modes of Assembler Directives. Procedures and Macros OVERVIEW: UNIT III Addressing Modes of 8086 Assembler Directives Procedures and Macros Instruction Set of 8086 Data Transfer Group Arithmetic Group Logical Instructions Rotate and Shift instructions Loop

More information

Module 3 Instruction Set Architecture (ISA)

Module 3 Instruction Set Architecture (ISA) Module 3 Instruction Set Architecture (ISA) I S A L E V E L E L E M E N T S O F I N S T R U C T I O N S I N S T R U C T I O N S T Y P E S N U M B E R O F A D D R E S S E S R E G I S T E R S T Y P E S O

More information

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات 1) Input/output In computing, input/output or I/O, is the communication between an information processing system (such as a computer) and the outside world, possibly a human or another information processing

More information

UNIT 4. Modular Programming

UNIT 4. Modular Programming 1 UNIT 4. Modular Programming Program is composed from several smaller modules. Modules could be developed by separate teams concurrently. The modules are only assembled producing.obj modules (Object modules).

More information

Defining and Using Simple Data Types

Defining and Using Simple Data Types 85 CHAPTER 4 Defining and Using Simple Data Types This chapter covers the concepts essential for working with simple data types in assembly-language programs The first section shows how to declare integer

More information

CS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers. MC

CS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers. MC CS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 MIDTERM FALL 2011 CS401 Assembly Language Q: Affected flag of AND operation

More information

Mr. Sapan Naik 1. Babu Madhav Institute of Information Technology, UTU

Mr. Sapan Naik 1. Babu Madhav Institute of Information Technology, UTU 5 Years Integrated M.Sc.(IT) Semester 4 060010402 System Programming Question Bank Unit 1: Introduction 1. Write the decimal equivalent for each integral power of 2 from 2! to 2!". 2. Convert the following

More information

Computer Architecture 1 ح 303

Computer Architecture 1 ح 303 Lecture 4 A. Addressing MODES 1. Introduction to assembly language programming: Program is a sequence of commands used to tell a microcomputer what to do. Each command in a program is an instruction Programs

More information

16-Bit Intel Processor Architecture

16-Bit Intel Processor Architecture IBM-PC Organization 16-Bit Intel Processor Architecture A-16 bit microprocessor can operate on 16 bits of data at a time. 8086/8088 have the simplest structure 8086/8088 have the same instruction set,

More information

EEM336 Microprocessors I. The Microprocessor and Its Architecture

EEM336 Microprocessors I. The Microprocessor and Its Architecture EEM336 Microprocessors I The Microprocessor and Its Architecture Introduction This chapter presents the microprocessor as a programmable device by first looking at its internal programming model and then

More information

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI 8 Unsigned and Signed Integer Numbers 1. Unsigned integer numbers: each type of integer can be either byte-wide or word-wide. This data type can be used to represent decimal numbers in the range 0 through

More information

1-Operand instruction types 1 INC/ DEC/ NOT/NEG R/M. 2 PUSH/ POP R16/M16/SR/F 2 x ( ) = 74 opcodes 3 MUL/ IMUL/ DIV/ DIV R/M

1-Operand instruction types 1 INC/ DEC/ NOT/NEG R/M. 2 PUSH/ POP R16/M16/SR/F 2 x ( ) = 74 opcodes 3 MUL/ IMUL/ DIV/ DIV R/M Increment R16 1-Operand instruction types 1 INC/ DEC/ NOT/NEG R/M 4 x (16+48) = 256 opcodes 2 PUSH/ POP R16/M16/SR/F 2 x (8+24+4+1) = 74 opcodes 3 MUL/ IMUL/ DIV/ DIV R/M 4 x (16+48) = 256 opcodes INC

More information

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313) Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 02/06/2018 Section 1 Weighting 40% of

More information

The higher the values of above, the more powerful the CPU. Microprocessors are categorized in additional as: RISC or CISC.

The higher the values of above, the more powerful the CPU. Microprocessors are categorized in additional as: RISC or CISC. MICROPROCESSOR: A silicon chip that contains a CPU. A microprocessor (sometimes abbreviated μp) is a digital electronic component with miniaturized transistors on a single semiconductor integrated circuit

More information

UNIT 1. Introduction to microprocessor. Block diagram of simple computer or microcomputer.

UNIT 1. Introduction to microprocessor. Block diagram of simple computer or microcomputer. UNIT 1 Unit 1 contents at a glance: 1. Architecture of 8086 microprocessor, 2. Register organization, 3. 8086 flag register and its functions, 4. addressing modes of 8086, 5. Pin diagram of 8086, 6. Minimum

More information

International Islamic University Chittagong (IIUC) Department of Electrical and Electronic Engineering (EEE)

International Islamic University Chittagong (IIUC) Department of Electrical and Electronic Engineering (EEE) International Islamic University Chittagong (IIUC) Department of Electrical and Electronic Engineering (EEE) EEE-3506: Microprocessor and Interfacing Sessional Experiment No. 05: Program control instructions

More information

WINTER 17 EXAMINATION

WINTER 17 EXAMINATION Subject Name: Microprocessor and Programming Model Answer Sub Code: Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer

More information

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. 2 Microprocessor Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. It is used as CPU (Central Processing Unit) in computers. 3 Microprocessor

More information

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers. Lecture 5: Computer Organization Instruction Execution Computer Organization Addressing Buses Fetch-Execute Cycle Computer Organization CPU Control Unit U Input Output Memory Components Control Unit fetches

More information

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM EXPERIMENT WRITE UP AIM: Assembly language program for 16 bit BCD addition LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM TOOLS/SOFTWARE

More information

EEM336 Microprocessors I. Arithmetic and Logic Instructions

EEM336 Microprocessors I. Arithmetic and Logic Instructions EEM336 Microprocessors I Arithmetic and Logic Instructions Introduction We examine the arithmetic and logic instructions. The arithmetic instructions include addition, subtraction, multiplication, division,

More information

The Microprocessor and its Architecture

The Microprocessor and its Architecture The Microprocessor and its Architecture Contents Internal architecture of the Microprocessor: The programmer s model, i.e. The registers model The processor model (organization) Real mode memory addressing

More information

Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H.

Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H. Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H. MOV AX, 5000H MOV DS, AX MOV AL, 20H MOV CL, 30H ADD AL, CL MOV CL, 10H MUL CL

More information

Introduction to IA-32. Jo, Heeseung

Introduction to IA-32. Jo, Heeseung Introduction to IA-32 Jo, Heeseung IA-32 Processors Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer

More information

INTRODUCTION TO IA-32. Jo, Heeseung

INTRODUCTION TO IA-32. Jo, Heeseung INTRODUCTION TO IA-32 Jo, Heeseung IA-32 PROCESSORS Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer

More information

Instructions moving data

Instructions moving data do not affect flags. Instructions moving data mov register/mem, register/mem/number (move data) The difference between the value and the address of a variable mov al,sum; value 56h al mov ebx,offset Sum;

More information

CS401 - Computer Architecture and Assembly Language Programming Glossary By

CS401 - Computer Architecture and Assembly Language Programming Glossary By CS401 - Computer Architecture and Assembly Language Programming Glossary By absolute address : A virtual (not physical) address within the process address space that is computed as an absolute number.

More information

Marking Scheme. Examination Paper. Module: Microprocessors (630313)

Marking Scheme. Examination Paper. Module: Microprocessors (630313) Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 12/06/2017 Section 1 Weighting 40% of

More information

Lecture (08) x86 programming 7

Lecture (08) x86 programming 7 Lecture (08) x86 programming 7 By: Dr. Ahmed ElShafee 1 Conditional jump: Conditional jumps are executed only if the specified conditions are true. Usually the condition specified by a conditional jump

More information

The 8086 Microprocessor

The 8086 Microprocessor The 8086 Microprocessor 1. Draw the pin diagram of 8086. Ans. There would be two pin diagrams one for MIN mode and the other for MAX mode of 8086, shown in Figs. 11.1 and 11.2 respectively. The pins that

More information

Lecture 5 Program Logic and Control

Lecture 5 Program Logic and Control Lecture 5 Program Logic and Control Chapter Outline Short, near and far address JMP Instruction The CMP Instruction Conditional Jump instruction The Loop instruction While Loop REPEAT Loop Short,near,and

More information

Week /8086 Microprocessor Programming II

Week /8086 Microprocessor Programming II Week 5 8088/8086 Microprocessor Programming II Quick Review Shift & Rotate C Target register or memory SHL/SAL 0 C SHR 0 SAR C Sign Bit 2 Examples Examples Ex. Ex. Ex. SHL dest, 1; SHL dest,cl; SHL dest,

More information

Summer 2003 Lecture 4 06/14/03

Summer 2003 Lecture 4 06/14/03 Summer 2003 Lecture 4 06/14/03 LDS/LES/LSS General forms: lds reg,mem lseg reg,mem Load far pointer ~~ outside of current segment {E.g., load reg w/value @ mem, & seg w/mem+2 XCHG Exchange values General

More information

Assembler lecture 5 S.Šimoňák, DCI FEEI TU of Košice

Assembler lecture 5 S.Šimoňák, DCI FEEI TU of Košice Assembler lecture 5 S.Šimoňák, DCI FEEI TU of Košice Jumps and iterations conditional and unconditional jumps iterations (loop) implementation of HLL control structures Unconditional jump unconditional

More information