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

Size: px
Start display at page:

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

Transcription

1 CS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers MC PSMD01 MIDTERM FALL 2011 CS401 Assembly Language Q: Affected flag of AND operation marks 2 Answer:- (Page 60) AND can be used to check whether particular bits of a number are set or not. Previously we used shifting and JC to test bits one by one. Now we introduce another way to test bits, which is more powerful in the sense that any bit can be tested anytime and not necessarily in order. AND can be applied on a destination with a 1-bit in the desired position and a source, which is to be checked. If the destination is zero as a result, which can be checked with a JZ instruction, the bit at the desired position in the source was clear. Q: Relation between RET and CALL is dependent or independent. Marks 2 Answer:- (Page 64) Technically they are independent in their operation but both the instructions are commonly used as a pair. The RET works regardless of the CALL and the CALL works regardless of the RET. Q: What is the difference between LES and LDS instruction? marks 3 Answer:- (Page 97) LES loads ES while LDS loads DS. These instructions have two parameters, one is the general purpose register to be loaded and the other is the memory location from which to load these registers. MIDTERM FALL 2011 CS401 Assembly Language 0. Write down the procedure to clear the selective bit. (Marks: 2) Answer:- (Page 59) The source operand is loaded with a mask containing one at positions which are retain their old value and zero at positions which are to be zeroed. The effect of applying this operation on the destination with mask in the source is to clear the desired bits. This operation is called masking. 1. Why REP prefix is generally not used with LODS instruction? (Marks: 2) Answer:- (Page 92) 1

2 LODS is generally used in a loop and not with the REP prefix since the value previously loaded in the register is overwritten if the instruction is repeated and only the last value of the block remains in the register. 23. What is difference between REPE and REPNE? (Marks: 3) Answer:- (Page 93) REPE or REPZ repeat the following string instruction while the zero flag is set and REPNE or REPNZ repeat the following instruction while the zero flag is not set. 24. Describe Push and Pop with the help of an example. (Marks: 3) Answer:- (Page 68) The operations of placing items on the stack and removing them from there are called push and pop. Memory is like a shelf numbered as zero at the top and the maximum at the bottom. If a decrementing stack starts at shelf 5, the first item is placed in shelf 5; the next item is placed in shelf 4, the next in shelf 3 and so on. 25. Explain all characteristics of SCAS instruction. (Marks: 5) Answer:- (Page 92) SCAS compares a source byte or word in register AL or AX with the destination string element addressed by ES:DI and updates the flags. DI is updated to point to the next location. SCAS is often used to locate equality or in-equality in a string through the use of an appropriate prefix. SCAS is a bit different from the other instructions. This is more like the CMP instruction in that it does subtraction of its operands. The prefixes REPE (repeat while equal) and REPNE (repeat while not equal) are used with this instruction. The instruction is used to locate a byte in AL in the block of memory. When the first equality or inequality is encountered; both have uses. 26. Describe Local Variable? (Marks: 5) Answer:- (Page 75) Another important role of the stack is in the creation of local variables that are only needed while the subroutine is in execution and not afterwards. They should not take permanent space like global variables. Local variables should be created when the subroutine is called and discarded afterwards. So that the spaced used by them can be reused for the local variables of another subroutine. They only have meaning inside the subroutine and no meaning outside it. The most convenient place to store these variables is the stack. We need some special manipulation of the stack for this task. We need to produce a gap in the stack for our variables. 1. Which flag affected by often and operator MIDTERM SPRING 2011 CS401 Assembly Language 2. Explain divide overflow error. Answer:- (Page 85) If a large number is divided by a very small number it is possible that the quotient is larger than the space provided for it in the implied destination. In this case an interrupt is automatically generated and the program is usually terminated as a result. This is called a divide overflow error. 2

3 3. For what purpose "INT4" is reserved. Answer:- (Page 106) The overflow flag is set if the sign bit unexpectedly changes as a result of a mathematical or logical instruction. However the overflow flag signals a real overflow only if the numbers in question are treated as signed numbers. So this interrupt is not automatically generated but as a result of a special instruction INTO (interrupt on overflow) if the overflow flag is set. Otherwise the INTO instruction behaves like a NOP (no operation). 4. Double working of Exchange instruction with help of an example. Answer:- (Page 73) xchg ax, [bx+si+2] ; exchange ax with second number 5. What is the difference between LES and LDS instruction? 1. Two form of Moves introduction MIDTERM SPRING 2011 CS401 Assembly Language 2. Describe push & pop with help of example Answer:- (Page 71) PUSH PUSH decrements SP (the stack pointer) by two and then transfers a word from the source operand to the top of stack now pointed to by SP. PUSH often is used to place parameters on the stack before calling a procedure; more generally, it is the basic means of storing temporary data on the stack. Consider the example of test tube.(see stack) POP POP transfers the word at the current top of stack (pointed to by SP) to the destination operand and then increments SP by two to point to the new top of stack. POP can be used to move temporary variables from the stack to registers or memory. Observe that the operand of PUSH is called a source operand since the data is moving to the stack from the operand, while the operand of POP is called destination since data is moving from the stack to the operand. 3. How value of Ip Register is saved & updated when call. Instruction executed. Answer:- (Page 16) This is the special register containing the address of the next instruction to be executed. No mathematics or memory access can be done through this register. It is out of our direct control and is automatically used. Playing with it is dangerous and needs special care. Program control instructions change the IP register. 4. AX = 0x3412, BX=0x7856, CX= 0x1CAB, Sp=0x100 Give contents of AX, BX,CX,SP After creating instruction push AX, Push BX, chg, AX,CX, POP CX 3

4 5. Explain Divide over Flows Error. 6. How many parameters a subroutine can receive through stack. Answer:- (Page 72) The maximum parameters a subroutine can receive are seven what is push and pop explain with example 3marks MIDTERM SPRING 2011 CS401 Assembly Language how the string instruction is used in the block of memory 3 affected flag of AND operation 2marks how to convert the 3 dimensional memory in 1 dimensional memory Answer:- (Page ) write the scas instruction 5marks Midterm Paper Spring How many block processing instructions in 8088, just name the number of processing instructions? Answer:- (Page 91 ) There are just 5 block processing instructions in The five instructions are STOS, LODS, CMPS, SCAS, and MOVS called store string, load string, compare string, scan string, and move string respectively 4. What are the instruction use by assembly language for permanent diversion and temporarily diversion? Answer:- (Page 64) The instructions for permanent diversion in 8088 are the jump instructions, while the instruction for temporary diversion is the CALL instruction. 5. How much string instructions are in assembly language? Write down all instructions. Answer:- (Page 83 ) STOS Clearing the Screen LODS String Printing SCAS -String Length LES and LDS 4

5 MOVS -Screen Scrolling CMPS String Comparison 4. What is the purpose of following string instructions? a. STOS b. CMPS Answer:- (Page 92 ) STOS:- STOS transfers a byte or word from register AL or AX to the string element addressed by ES:DI and updates DI to point to the next location. STOS is often used to clear a block of memory or fill it with a constant. CMPS:- CMPS subtracts the source location DS:SI from the destination location ES:DI. Source and Destination are unaffected. SI and DI are updated accordingly. CMPS compares two blocks of memory for equality or inequality of the block. It subtracts byte by byte or word by word. What is the syntax of PUSH instruction? 2 Marks Answer:- (Page ) push ax Midterm Paper Spring 2011 For what purpose DS and ES registers are generally used in the context of video memory. 2 Marks Answer:- (Page 81 ) Both DS and ES can be used to access the video memory. However we commonly keep DS for accessing our data, and load ES with the segment of video memory. When the instructions push ax is executed in decrementing stack how the value of SP will change. 3 Marks Answer:- (Page ) What colors are repeated by 0th, 1st and 2nd bits (from least significant side) in Attribute Byte? 3 Marks Answer:- (Page 81) blue, green, Red How SCAS instructions can be used to detect Null at the end of a string? 5 Marks Answer:- (Page 92) SCAS instruction can be used to search for a 0 in a null terminated string to calculate the length of the string. In this form REPNE will be used to repeat while the null is not there. Midterm Paper Spring 2011 Q.No1: What are instructions use by the Assembly language for permanent and temporary division? (2 marks) 5

6 Q.No2: From where does the contents of SL and DS registers are loaded as a result of execution of the instruction of the instruction LDS SL [BP +4]? (2 marks) Q.No:3.How 16-bit MUL operations is different from 32-bit MUL operation? (5 marks) Answer:- (Page ) Multiplication is four bit so the answer is stored in an 8bit register. If the operands were 8bit the answer would be 16bit and if the operands were 16bit the answer would be 32bit. Since eight bits can fit in a byte we have used 4bit multiplication Q.No:4.Describe the working of the CALL instruction with the reference of Stack. (3 marks) Answer:- (Page 68 ) During the CALL operation, the current value of the instruction pointer is automatically saved on the stack, and the destination of CALL is loaded in the instruction pointer. Execution therefore resumes from the destination of CALL. Q.No5: How many BYTES will be move by each of the following block of codes? (3 marks) a) MOV cx,384 REP movsb b) MOV cx,384 REP movsw Q.No:6 Consider the following pseudo code and write the corresponding assembly code for it Note: There is more credit for a shorter code (05 marks) If (al > C1) AND (b1 > a1) { dx=1 } Answer:- (Page ) Midterm Paper Fall Explain the function of rotate right (ROR) instruction Answer:- (Page 53 ) In the rotate right operation every bit moves one position to the right and the bit dropped from the right is inserted at the left. This bit is also copied into the carry flag. 22. Why REP prefix is generally not used with LODS instruction? 6

7 23. Write all steps of algorithm for printing number 352. Answer:- (Page 84 ) The steps of our algorithm are outlined below. Divide the number by base (10 in case of decimal) The remainder is its right most digit Convert the digit to its ASCII representation (Add 0x30 to the remainder in case of decimal) Save this digit on stack If the quotient is non-zero repeat the whole process to get the next digit, otherwise stop Pop digits one by one and print on screen left to right 24. What are the result after performing the instruction (each carry 1 marks ) 1. and ax,bx 2. or ax,bx 3. xor ax,bx Given that ax = and bx = Answer:- (Page 58) The important thing about these operations is that they are bitwise. This means that if and ax, bx instruction is given, then the operation of AND is applied on corresponding bits of AX and BX. There are 16 AND operations as a result; one for every bit of AX. Bit 0 of AX will be set if both its original value and Bit 0 of BX are set, bit 1 will be set if both its original value and Bit 1 of BX are set, and so on for the remaining bits. These operations are conducted in parallel on the sixteen bits. 25. Describe Local Variables? 26. Explain the complete operation of Interrupt when it is generated. Answer:- (Page 104 ) Interrupt is the result of an INT instruction (software interrupt) or it is generated by an external hardware which passes the interrupt number by a different mechanism. The currently executing instruction is completed, the current value of FLAGS is pushed on the stack, then the current code segment is pushed, then the offset of the next instruction is pushed. After this it automatically clears the trap flag and the interrupt flag to disallow further interrupts until the current routine finishes. After this it loads the word at nx4 in IP and the word at nx4+2 in CS if interrupt n was generated. As soon as these values are loaded in CS and IP execution goes to the start of the interrupt handler. When the handler finishes its work it uses the IRET instruction to return to the caller. IRET pops IP, then CS, and then FLAGS. The original value of IF and TF is restored which re-enables further interrupts Midterm Paper Fall

8 Q#21 Mark 2 What are the instructions used by assembly language for permanent and temporary diversions. Q#22 Which instruction is used to determine zero bit in string. Mark 2 Q#23 Explain the use of TEST instruction. Mark 3 Answer:- (Page 104 ) The test instruction is used for bit testing. BX holds the mask and in every next iteration it is shifting left, as our concerned bit is now the next bit. Q#24 Explain LES and LDS Mark 3 Q#25 Describe local variables. Mark 5 Q#26 Describe MOVS and CMPS instructions Mark 5 Answer:- (Page 92) MOVS MOVS transfers a byte or word from the source location DS:SI to the destination ES:DI and updates SI and DI to point to the next locations. MOVS is used to move a block of memory. The DF is important in the case of overlapping blocks. CMPS CMPS subtracts the source location DS:SI from the destination location ES:DI. Source and Destination are unaffected. SI and DI are updated accordingly. CMPS compares two blocks of memory for equality or inequality of the block. It subtracts byte by byte or word by word. If used with a REPE or a REPNE prefix is repeats as long as the blocks are same or as long as they are different. MIDTERM EXAMINATION Spring 2010 Question No: 17 ( Marks: 2 ) Define short jump Answer:- (Page 46) If the offset is stored in a single byte as in 75F2 with the opcode 75 and operand F2, the jump is called a short jump. 8

9 Question No: 18 ( Marks: 2 ) Every character is displayed on the screen in the form of a word. what each byte of this word represents? Question No: 19 ( Marks: 2 ) IF DF=0 what its represent and IF DF=1 what its represent? Answer:- (Page 91) The direction of movement is controlled with the Direction Flag (DF) in the flags register. If this flag is cleared DF=0, the direction is from lower addresses towards higher addresses and if this flag is set DF=1, the direction is from higher addresses to lower addresses. If DF is cleared, DF = 0 this is called the auto increment mode of string instruction, and if DF is set, DF=1, this is called the auto decrement mode. There are two instructions to set and clear the direction flag. Question No: 20 ( Marks: 3 ) When the instruction "push ax" is executed in decrementing stack how the value of SP will change Question No: 21 ( Marks: 3 ) Explain LES and LDS instructions. Question No: 22 ( Marks: 5 ) Explain how extended shifting is performed Answer:- (Page 56) Using our basic shifting and rotation instructions we can effectively shift a 32bit number in memory word by word. We cannot shift the whole number at once since our architecture is limited to word operations. The algorithm we use consists of just two instructions and we name it extended shifting. num1: dd shl word [num1], 1 rcl word [num1+2], 1 The DD directive reserves a 32bit space in memory, however the value we placed there will fit in 16bits. So we can safely shift the number left 16 times. The least significant word is accessible at num1 and the most significant word is accessible at num1+2. The two instructions are carefully crafted such that the first one shifts the lower word towards the left and the most significant bit of that word is dropped in carry. With the next instruction we push that dropped bit into the least significant bit of the next word effectively joining the two 16bit words. The final carry after the second instruction will be the most significant bit of the higher word, which for this number will always be zero. Question No: 23 ( Marks: 5 ) Explain MUL instruction in both cases (i) if the source operand is byte (ii) if the source operand is a word? 9

10 Answer:- (Page 87) MUL (multiply) performs an unsigned multiplication of the source operand and the accumulator. If the source operand is a byte, then it is multiplied by register AL and the double-length result is returned in AH and AL. If the source operand is a word, then it is multiplied by register AX, and the double-length result is returned in registers DX and AX. MIDTERM EXAMINATION Spring 2010 Question No: 17 ( Marks: 2 ) Why is it necessary to provide the segment and offset address in case of FAR jump? Answer:- (Page 46) Far jump must be used a two byte segment and a two byte offset are given to it Because It loads CS with the segment part and IP with the offset part. Question No: 18 ( Marks: 2 ) What s your understanding about Incrementing and Decrementing Stack? Answer:- (Page 68) A decrementing stack moves from higher addresses to lower addresses as elements are added in it while an incrementing stack moves from lower addresses to higher addresses as elements are added. Question No: 19 ( Marks: 2 ) IF DF=0 what its represent and IF DF=1 what its represent? Question No: 20 ( Marks: 3 ) What is the Difference between CALL and RET Answer:- (Page 64 ) The CALL instruction allows temporary diversion and therefore reusability of code. The word return holds in its meaning that we are to return from where we came and need no explicit destination. Therefore RET takes no arguments and transfers control back to the instruction following the CALL that took us in this subroutine. Question No: 21 ( Marks: 3 ) Tell the Formula to scroll up the screen rep movsw scroll up Answer:- (Page 99) scrollup: push bp mov bp,sp push ax push cx push si 10

11 push di push es push ds mov ax, 80 ; load chars per row in ax mul byte [bp+4] ; calculate source position mov si, ax ; load source position in si push si ; save position for later use shl si, 1 ; convert to byte offset mov cx, 2000 ; number of screen locations sub cx, ax ; count of words to move mov ax, 0xb800 mov es, ax ; point es to video base mov ds, ax ; point ds to video base xor di, di ; point di to top left column cld ; set auto increment mode rep movsw ; scroll up mov ax, 0x0720 ; space in normal attribute pop cx ; count of positions to clear rep stosw ; clear the scrolled space pop ds pop es pop di pop si pop cx pop ax pop bp ret 2 Question No: 22 ( Marks: 5 ) Explain how extended shifting is performed Answer:- (Page 56) Using our basic shifting and rotation instructions we can effectively shift a 32bit number in memory word by word. We cannot shift the whole number at once since our architecture is limited to word operations. The algorithm we use consists of just two instructions and we name it extended shifting. num1: dd shl word [num1], 1 rcl word [num1+2], 1 The DD directive reserves a 32bit space in memory; however the value we placed there will fit in 16bits. So we can safely shift the number left 16 times. The least significant word is accessible at num1 and the most significant word is accessible at num1+2. The two instructions are carefully crafted such that the first one shifts the lower word towards the left and the most significant bit of that word is dropped in carry. With the next instruction we push that dropped bit into the least significant bit of the next word effectively joining the two 16bit words. 11

12 The final carry after the second instruction will be the most significant bit of the higher word, which for this number will always be zero. Question No: 23 ( Marks: 5 ) Write a subroutine to calculate the string length? Answer:- (Page 97 ) subroutine to calculate the length of a string ; takes the segment and offset of a string as parameters strlen: push bp mov bp,sp push es push cx push di les di, [bp+4] ; point es:di to string mov cx, 0xffff ; load maximum number in cx xor al, al ; load a zero in al repne scasb ; find zero in the string mov ax, 0xffff ; load maximum number in ax sub ax, cx ; find change in cx dec ax ; exclude null from length pop di pop cx pop es pop bp ret 4 MIDTERM EXAMINATION Spring 2010 Question No: 17 ( Marks: 2 ) What is difference between SHR and SAR instructions? Answer:- (Page 52) The shift logical right operation inserts a zero from the left and moves every bit one position to the right and copies the rightmost bit in the carry flag. Question No: 18 ( Marks: 2 ) For what purpose "INT 1" is reserved? Answer:- (Page 105) INT 1, Trap, Single step Interrupt This interrupt is used in debugging with the trap flag. If the trap flag is set the Single Step Interrupt is generated after every instruction. By hooking this interrupt a debugger can get control after every instruction and display the registers etc was the first processor that has this ability to support debugging. 12

13 Question No: 19 ( Marks: 2 ) Define implied operand? Answer:- (Page 18) An implied operand means that it is always in a particular register say the accumulator, and it need not be mentioned in the instruction. Question No: 20 ( Marks: 3 ) Describe the working of the CALL instruction with the reference of Stack. Question No: 21 ( Marks: 3 ) Tell the Formula to scroll up the screen rep movsw scroll up Question No: 22 ( Marks: 5 ) What is the difference between LES and LDS instructions? Question No: 23 ( Marks: 5 ) Explain the process of ADC? Answer:- (Page 57) The ADC instruction is specifically placed for extending the capability of ADD. Numbers of any size can be added using a proper combination of ADD and ADC. All basic building blocks are provided for the assembly language programmer, and the programmer can extend its capabilities as much as needed by using these fine instructions in appropriate combinations. Further clarifying the operation of ADC, consider an instruction ADC AX, BX. Normal addition would have just added BX to AX, however ADC first adds the carry flag to AX and then adds BX to AX. Therefore the last carry is also included in the result. IF DF=0 what its represent sssand IF DF=1 what its represent? Relation between RET and CALL is dependent or independent. Write all steps of algorithm for printing number 352. When the instruction "push ax" is executed in decrementing stack how the value of SP will change Explain MUL instruction in both cases (i) if the source operand is byte (ii) if the source operand is a word? 13

14 How string instructions work on the block of memory? What is mismatch? Define with one example. Answer:- (Page ) Define the LES and LDS instructions do? Write a subroutine to clear screen. Answer:- (Page 93) clear screen using string instructions [org 0x0100] jmp start subroutine to clear the screen clrscr: push es push ax push cx push di mov ax, 0xb800 mov es, ax ; point es to video base xor di, di ; point di to top left column mov ax, 0x0720 ; space char in normal attribute mov cx, 2000 ; number of screen locations cld ; auto increment mode rep stosw ; clear the whole screen pop di pop cx pop ax pop es ret start: call clrscr ; call clrscr subroutine mov ax, 0x4c00 ; terminate program int 0x21 Replace the following invalid instruction with the single valid instruction a. mov IP b. mov IP,L5 Answer:- (Page ) 14

15 15 Q: Affected flag of AND operation marks 2 Answer:- Affected Flag of AND are: CF, OF, PF, SF, ZF and AC Q: Relation between RET and CALL is dependent or independent. Marks 2 Answer:- (Page 64)

16 Technically they are independent in their operation but both the instructions are commonly used as a pair. The RET works regardless of the CALL and the CALL works regardless of the RET. Q: What is the difference between LES and LDS instruction? marks 3 Answer:- (Page 97) LES loads ES while LDS loads DS. These instructions have two parameters, one is the general purpose register to be loaded and the other is the memory location from which to load these registers. 21. Write down the procedure to clear the selective bit. (Marks: 2) Answer:- (Page 59) The source operand is loaded with a mask containing one at positions which are retain their old value and zero at positions which are to be zeroed. The effect of applying this operation on the destination with mask in the source is to clear the desired bits. This operation is called masking. 22. Why REP prefix is generally not used with LODS instruction? (Marks: 2) Answer:- (Page 92) LODS is generally used in a loop and not with the REP prefix since the value previously loaded in the register is overwritten if the instruction is repeated and only the last value of the block remains in the register. 23. What is difference between REPE and REPNE? (Marks: 3) Answer:- (Page 93) REPE or REPZ repeat the following string instruction while the zero flag is set and REPNE or REPNZ repeat the following instruction while the zero flag is not set. 24. Describe Push and Pop with the help of an example. (Marks: 3) Answer:- (Page 68) The operations of placing items on the stack and removing them from there are called push and pop. Memory is like a shelf numbered as zero at the top and the maximum at the bottom. If a decrementing stack starts at shelf 5, the first item is placed in shelf 5; the next item is placed in shelf 4, the next in shelf 3 and so on. 25. Explain all characteristics of SCAS instruction. (Marks: 5) Answer:- (Page 92) SCAS compares a source byte or word in register AL or AX with the destination string element addressed by ES:DI and updates the flags. DI is updated to point to the next location. SCAS is often used to locate equality or in-equality in a string through the use of an appropriate prefix. SCAS is a bit different from the other instructions. This is more like the CMP instruction in that it does subtraction of its operands. The prefixes REPE (repeat while equal) and REPNE (repeat while not equal) are used with this instruction. The instruction is used to locate a byte in AL in the block of memory. When the first equality or inequality is encountered; both have uses. 26. Describe Local Variable? (Marks: 5) Answer:- (Page 75) Another important role of the stack is in the creation of local variables that are only needed while the subroutine is in execution and not afterwards. They should not take permanent space like global variables. Local variables should be created when the subroutine is called and discarded afterwards. So that the spaced used by them can be reused for the local variables of another subroutine. They only have meaning inside the subroutine and no meaning outside it. The most convenient place to store these variables is the stack. We need some special manipulation of the stack for this task. We need to produce a gap in the stack for our variables. 1. Which flag affected by often and operator 2. Explain divide overflow error. Answer:- (Page 85) If a large number is divided by a very small number it is possible that the quotient is larger than the space provided for it in the implied destination. In this case an interrupt is automatically generated and the program is usually terminated as a result. This is called a divide overflow error. 3. For what purpose "INT4" is reserved. Answer:- (Page 106) INT4 is reserved for Arithmetic Overflow, change of sign bit 4. Double working of Exchange instruction with help of an example. Answer:- (Page 73) XCHG (Exchanges) instruction swaps the contents of the destination (first) and source (second) operands. The operands can be two general-purpose registers or a register and a memory location. If a memory operand is referenced, the processor's locking protocol is automatically implemented for the

17 duration of the exchange operation, regardless of the presence or absence of the LOCK prefix or of the value of the IOPL. xchg ax, [bx+si+2] ; exchange ax with second number 5. What is the difference between LES and LDS instruction? 1. Two form of Moves introduction Answer: (Page 98) MOVS has the two forms MOVSB and MOVSW 2. Describe push & pop with help of example Answer:- (Page 71) PUSH PUSH decrements SP (the stack pointer) by two and then transfers a word from the source operand to the top of stack now pointed to by SP. PUSH often is used to place parameters on the stack before calling a procedure; more generally, it is the basic means of storing temporary data on the stack. Consider the example of test tube.(see stack) POP POP transfers the word at the current top of stack (pointed to by SP) to the destination operand and then increments SP by two to point to the new top of stack. POP can be used to move temporary variables from the stack to registers or memory. Observe that the operand of PUSH is called a source operand since the data is moving to the stack from the operand, while the operand of POP is called destination since data is moving from the stack to the operand. 3. How value of Ip Register is saved & updated when call. Instruction executed. Answer:- (Page 71) When Call instruction is executed the stack pointer (SP) is decremented by 2 and value of IP is pushed onto stack. 4. AX = 0x3412, BX=0x7856, CX= 0x1CAB, Sp=0x100 Give contents of AX, BX,CX,SP After creating instruction push AX, Push BX, chg, AX,CX, POP CX 5. Explain Divide over Flows Error. 6. How many parameters a subroutine can receive through stack. Answer:- (Page 72) The maximum parameters a subroutine can receive are seven what is push and pop explain with example 3marks how the string instruction is used in the block of memory 3 Answer: (Page 92) STOS transfers a byte or word from register AL or AX to the string element addressed by ES:DI and updates DI to point to the next location. STOS is often used to clear a block of memory or fill it with a constant. affected flag of AND operation 2marks how to convert the 3 dimensional memory in 1 dimensional memory write the scas instruction 5marks 1. How many block processing instructions in 8088, just name the number of processing instructions? Answer:- (Page 91 ) There are just 5 block processing instructions in The five instructions are STOS, LODS, CMPS, SCAS, and MOVS called store string, load string, compare string, scan string, and move string respectively 2. What are the instruction use by assembly language for permanent diversion and temporarily diversion? Answer:- (Page 64) The instructions for permanent diversion in 8088 are the jump instructions, while the instruction for temporary diversion is the CALL instruction. 3. How much string instructions are in assembly language? Write down all instructions. Answer:- (Page 83 ) STOS Clearing the Screen LODS String Printing SCAS -String Length LES and LDS MOVS -Screen Scrolling

18 CMPS String Comparison 4. What is the purpose of following string instructions? a. STOS b. CMPS Answer:- (Page 92 ) STOS:- STOS transfers a byte or word from register AL or AX to the string element addressed by ES:DI and updates DI to point to the next location. STOS is often used to clear a block of memory or fill it with a constant. CMPS:- CMPS subtracts the source location DS:SI from the destination location ES:DI. Source and Destination are unaffected. SI and DI are updated accordingly. CMPS compares two blocks of memory for equality or inequality of the block. It subtracts byte by byte or word by word. What is the syntax of PUSH instruction? 2 Marks Answer:- (Page ) push ax For what purpose DS and ES registers are generally used in the context of video memory. 2 Marks Answer:- (Page 81 ) Both DS and ES can be used to access the video memory. However we commonly keep DS for accessing our data, and load ES with the segment of video memory. When the instructions push ax is executed in decrementing stack how the value of SP will change. 3 Marks Answer: (Page 71) When the instructions push ax is executed in decrementing stack, SP is decremented by two and IP is pushed onto the stack. What colors are repeated by 0th, 1st and 2nd bits (from least significant side) in Attribute Byte? 3 Marks Answer:- (Page 81) blue, green, Red How SCAS instructions can be used to detect Null at the end of a string? 5 Marks Answer:-Page 95 (Not Sure) We use SCASB with REPNE and a zero in AL to find a zero byte in the string. In CX we load the maximum possible size, which are 64K bytes. However actual strings will be much smaller. An important thing regarding SCAS and CMPS is that if they stop due to equality or inequality, the index registers have already incremented. Therefore when SCAS will stop DI would be pointing past the null character. Q.No1: What are instructions use by the Assembly language for permanent and temporary division? (2 marks) Q.No2: From where does the contents of SL and DS registers are loaded as a result of execution of the instruction of the instruction LDS SL [BP +4]? (2 marks) Answer: (Page 97) lds si, [bp+4] will load SI from BP+4 and DS from BP+6. Q.No:3.How 16-bit MUL operations is different from 32-bit MUL operation? (5 marks) Answer: (Page 65) If the operands were 16bit the answer would be in 32bit anf if the if the operands were 32bit the answer would be 64bit. For declaration of 16 bit we use dw and for 32-bit we use dd. Q.No:4.Describe the working of the CALL instruction with the reference of Stack. (3 marks) Answer:- (Page 68 ) During the CALL operation, the current value of the instruction pointer is automatically saved on the stack, and the destination of CALL is loaded in the instruction pointer. Execution therefore resumes from the destination of CALL. Q.No5: How many BYTES will be move by each of the following block of codes? a) MOV cx,384 REP movsb (3 marks)

19 b) MOV cx,384 REP movsw Q.No:6 Consider the following pseudo code and write the corresponding assembly code for it Note: There is more credit for a shorter code (05 marks) If (al > C1) AND (b1 > a1) { dx=1 } 21.Explain the function of rotate right (ROR) instruction Answer:- (Page 53 ) In the rotate right operation every bit moves one position to the right and the bit dropped from the right is inserted at the left. This bit is also copied into the carry flag. 22. Why REP prefix is generally not used with LODS instruction? 23. Write all steps of algorithm for printing number 352. Answer:- (Page 84 ) The steps of our algorithm are outlined below. Divide the number by base (10 in case of decimal) The remainder is its right most digit Convert the digit to its ASCII representation (Add 0x30 to the remainder in case of decimal) Save this digit on stack If the quotient is non-zero repeat the whole process to get the next digit, otherwise stop Pop digits one by one and print on screen left to right 24. What are the result after performing the instruction (each carry 1 marks ) 1. and ax,bx 2. or ax,bx 3. xor ax,bx Given that ax = and bx = Answer:- 1. 0x x x Describe Local Variables? 26. Explain the complete operation of Interrupt when it is generated. Answer:- (Page 104 ) Interrupt is the result of an INT instruction (software interrupt) or it is generated by an external hardware which passes the interrupt number by a different mechanism. The currently executing instruction is completed, the current value of FLAGS is pushed on the stack, then the current code segment is pushed, then the offset of the next instruction is pushed. After this it automatically clears the trap flag and the interrupt flag to disallow further interrupts until the current routine finishes. After this it loads the word at nx4 in IP and the word at nx4+2 in CS if interrupt n was generated. As soon as these values are loaded in CS and IP execution goes to the start of the interrupt handler. When the handler finishes its work it uses the IRET instruction to return to the caller. IRET pops IP, then CS, and then FLAGS. The original value of IF and TF is restored which re-enables further interrupts Q#21 Mark 2 What are the instructions used by assembly language for permanent and temporary diversions. Q#22 Which instruction is used to determine zero bit in string. Mark 2 Answer: (Page 94) REPE or REPZ repeat the following string instruction while the zero flag is set and REPNE or REPNZ repeat the following instruction while the zero flag is not set. Q#23 Explain the use of TEST instruction. Mark 3 Answer:- (Page 104 )

20 The test instruction is used for bit testing. BX holds the mask and in every next iteration it is shifting left, as our concerned bit is now the next bit. Q#24 Explain LES and LDS Mark 3 Q#25 Describe local variables. Mark 5 Q#26 Describe MOVS and CMPS instructions Mark 5 Answer:- (Page 92) MOVS MOVS transfers a byte or word from the source location DS:SI to the destination ES:DI and updates SI and DI to point to the next locations. MOVS is used to move a block of memory. The DF is important in the case of overlapping blocks. CMPS CMPS subtracts the source location DS:SI from the destination location ES:DI. Source and Destination are unaffected. SI and DI are updated accordingly. CMPS compares two blocks of memory for equality or inequality of the block. It subtracts byte by byte or word by word. If used with a REPE or a REPNE prefix is repeats as long as the blocks are same or as long as they are different. Question No: 17 ( Marks: 2 ) Define short jump Answer:- (Page 46) If the offset is stored in a single byte as in 75F2 with the opcode 75 and operand F2, the jump is called a short jump. Question No: 18 ( Marks: 2 ) Every character is displayed on the screen in the form of a word. what each byte of this word represents? Answer: (Page 81) The second byte in the word designated for one screen location holds the foreground and background colors for the character. So the pair of the ASCII code in one byte and the attribute in the second byte makes the word that corresponds to one location on the screen. The lower address contains the code while the higher one contains the attribute. Question No: 19 ( Marks: 2 ) IF DF=0 what its represent and IF DF=1 what its represent? Answer: Page 17 This flag tells whether the current operation has to be done from bottom to top of the block (D=0) or from top to bottom of the block (D=1). Question No: 20 ( Marks: 3 ) When the instruction "push ax" is executed in decrementing stack how the value of SP will change Question No: 21 ( Marks: 3 ) Explain LES and LDS instructions. Question No: 22 ( Marks: 5 ) Explain how extended shifting is performed Answer:- (Page 56) Using our basic shifting and rotation instructions we can effectively shift a 32bit number in memory word by word. We cannot shift the whole number at once since our architecture is limited to word operations. The algorithm we use consists of just two instructions and we name it extended shifting. num1: dd shl word [num1], 1 rcl word [num1+2], 1 The DD directive reserves a 32bit space in memory, however the value we placed there will fit in 16bits. So we can safely shift the number left 16 times. The least significant word is accessible at num1 and the most significant word is accessible at num1+2. The two instructions are carefully crafted such that the first one shifts the lower word towards the left and the most significant bit of that word is dropped in carry. With the next instruction we push that dropped bit into the least significant bit of the next word effectively joining the two 16bit words. The final carry after the second instruction will be the most significant bit of the higher word, which for this number will always be zero.

21 Question No: 23 ( Marks: 5 ) Explain MUL instruction in both cases (i) if the source operand is byte (ii) if the source operand is a word? Answer:- (Page 87) MUL (multiply) performs an unsigned multiplication of the source operand and the accumulator. If the source operand is a byte, then it is multiplied by register AL and the double-length result is returned in AH and AL. If the source operand is a word, then it is multiplied by register AX, and the double-length result is returned in registers DX and AX. Question No: 17 ( Marks: 2 ) Why is it necessary to provide the segment and offset address in case of FAR jump? Answer:- (Page 46) Far jump must be used a two byte segment and a two byte offset are given to it Because It loads CS with the segment part and IP with the offset part. Question No: 18 ( Marks: 2 ) What s your understanding about Incrementing and Decrementing Stack? Answer:- (Page 68) A decrementing stack moves from higher addresses to lower addresses as elements are added in it while an incrementing stack moves from lower addresses to higher addresses as elements are added. Question No: 19 ( Marks: 2 ) IF DF=0 what its represent and IF DF=1 what its represent? Question No: 20 ( Marks: 3 ) What is the Difference between CALL and RET Answer:- (Page 64 ) The CALL instruction allows temporary diversion and therefore reusability of code. The word return holds in its meaning that we are to return from where we came and need no explicit destination. Therefore RET takes no arguments and transfers control back to the instruction following the CALL that took us in this subroutine. Question No: 21 ( Marks: 3 ) Tell the Formula to scroll up the screen rep movsw scroll up Answer:- (Page 99) scrollup: push bp mov bp,sp push ax push cx push si push di push es push ds mov ax, 80 ; load chars per row in ax mul byte [bp+4] ; calculate source position mov si, ax ; load source position in si push si ; save position for later use shl si, 1 ; convert to byte offset mov cx, 2000 ; number of screen locations sub cx, ax ; count of words to move mov ax, 0xb800 mov es, ax ; point es to video base mov ds, ax ; point ds to video base xor di, di ; point di to top left column cld ; set auto increment mode rep movsw ; scroll up mov ax, 0x0720 ; space in normal attribute

22 pop cx rep stosw pop ds pop es pop di pop si pop cx pop ax pop bp ret 2 ; count of positions to clear ; clear the scrolled space Question No: 22 ( Marks: 5 ) Explain how extended shifting is performed Answer:- (Page 56) Using our basic shifting and rotation instructions we can effectively shift a 32bit number in memory word by word. We cannot shift the whole number at once since our architecture is limited to word operations. The algorithm we use consists of just two instructions and we name it extended shifting. num1: dd shl word [num1], 1 rcl word [num1+2], 1 The DD directive reserves a 32bit space in memory; however the value we placed there will fit in 16bits. So we can safely shift the number left 16 times. The least significant word is accessible at num1 and the most significant word is accessible at num1+2. The two instructions are carefully crafted such that the first one shifts the lower word towards the left and the most significant bit of that word is dropped in carry. With the next instruction we push that dropped bit into the least significant bit of the next word effectively joining the two 16bit words. The final carry after the second instruction will be the most significant bit of the higher word, which for this number will always be zero. Question No: 23 ( Marks: 5 ) Write a subroutine to calculate the string length? Answer:- (Page 97 ) subroutine to calculate the length of a string; takes the segment and offset of a string as parameters strlen: push bp mov bp,sp push es push cx push di les di, [bp+4] ; point es:di to string mov cx, 0xffff ; load maximum number in cx xor al, al ; load a zero in al repne scasb ; find zero in the string mov ax, 0xffff ; load maximum number in ax sub ax, cx ; find change in cx dec ax ; exclude null from length pop di pop cx pop es pop bp ret 4 Question No: 17 ( Marks: 2 ) What is difference between SHR and SAR instructions? Answer:- (Page 52) The shift logical right operation inserts a zero from the left and moves every bit one position to the right and copies the rightmost bit in the carry flag. Question No: 18 ( Marks: 2 ) For what purpose "INT 1" is reserved? Answer:- (Page 105)

23 INT 1, Trap, Single step Interrupt This interrupt is used in debugging with the trap flag. If the trap flag is set the Single Step Interrupt is generated after every instruction. By hooking this interrupt a debugger can get control after every instruction and display the registers etc was the first processor that has this ability to support debugging. Question No: 19 ( Marks: 2 ) Define implied operand? Answer:- (Page 18) An implied operand means that it is always in a particular register say the accumulator, and it need not be mentioned in the instruction. Question No: 20 ( Marks: 3 ) Describe the working of the CALL instruction with the reference of Stack. Question No: 21 ( Marks: 3 ) Tell the Formula to scroll up the screen rep movsw scroll up Question No: 22 ( Marks: 5 ) What is the difference between LES and LDS instructions? Question No: 23 ( Marks: 5 ) Explain the process of ADC? Answer:- (Page 57) The ADC instruction is specifically placed for extending the capability of ADD. Numbers of any size can be added using a proper combination of ADD and ADC. All basic building blocks are provided for the assembly language programmer, and the programmer can extend its capabilities as much as needed by using these fine instructions in appropriate combinations. Further clarifying the operation of ADC, consider an instruction ADC AX, BX. Normal addition would have just added BX to AX, however ADC first adds the carry flag to AX and then adds BX to AX. Therefore the last carry is also included in the result. IF DF=0 what its represent sssand IF DF=1 what its represent? Relation between RET and CALL is dependent or independent. Write all steps of algorithm for printing number 352. When the instruction "push ax" is executed in decrementing stack how the value of SP will change Explain MUL instruction in both cases (i) if the source operand is byte (ii) if the source operand is a word? How string instructions work on the block of memory? What is mismatch? Define with one example. Answer: Page 29 If we write our code in bytes but we declare in word then there will be a logical error in the code and It is called size mismatch error ; a program to add three numbers using byte variables [org 0x0100] mov al, [num1] ; load first number in al mov bl, [num1+1] ; load second number in bl add al, bl ; accumulate sum in al mov bl, [num1+2] ; load third number in bl add al, bl ; accumulate sum in al mov [num1+3], al ; store sum at num1+3 mov ax, 0x4c00 ; terminate program int 0x21 num1: dw 5, 10, 15, 0 Define the LES and LDS instructions do? Write a subroutine to clear screen. Answer:- (Page 93)

24 ; clear screen using string instructions [org 0x0100] jmp start ; subroutine to clear the screen clrscr: push es push ax push cx push di mov ax, 0xb800 mov es, ax ; point es to video base 15 xor di, di ; point di to top left column mov ax, 0x0720 ; space char in normal attribute mov cx, 2000 ; number of screen locations cld ; auto increment mode rep stosw ; clear the whole screen pop di pop cx pop ax pop es ret start: call clrscr ; call clrscr subroutine mov ax, 0x4c00 ; terminate program int 0x21 Replace the following invalid instruction with the single valid instruction a. (a)mov IP b. (b)mov IP,L5 a.mov IP Answer:- RET:-The instruction Ret will pop the Ip address. b.mov IP,L5 Answer:- CALL:-The instruction Ret will pop the Ip address. Why is it necessary to provide the segment and offset address in case of FAR jump? Segment and offset must be given to a far jump. Because, sometimes we may need to go from one code segment to another, and near and short jumps cannot take us there. Far jump must be used and a two byte segment and a two byte offset are given to it. It loads CS with the segment part and IP with the offset part. Question No: 18 ( Marks: 2 ) understanding about Incrementing and Decrementing Stack? What s your Whenever an element is pushed on the stack SP is decremented by two and whenever an element is popped on the stack SP is incremented by two. A decrementing stack moves from higher addresses to lower addresses as elements are added in it while an incrementing stack moves from lower addresses to higher addresses as elements are added.

25 As the 8088 stack works on word sized elements. Single bytes cannot be pushed or popped from the stack. Question No: 19 ( Marks: 2 ) IF DF=0 what its represent and IF DF=1 what its represent? Number2: The direction of movement is controlled with the Direction Flag (DF) in the flags register. If this flag is cleared DF=0, the direction is from lower addresses towards higher addresses and if this flag is set DF=1, the direction is from higher addresses to lower addresses. If DF is cleared, DF = 0 this is called the autoincrement mode of string instruction, and if DF is set, DF=1, this is called the autodecrement mode. There are two instructions to set and clear the direction flag. Question No: 20 ( Marks: 3 ) Difference between CALL and RET What is the The CALL instruction allows temporary diversion and therefore reusability of code. The word return holds in its meaning that we are to return from where we came and need no explicit destination. Therefore RET takes no arguments and transfers control back to the instruction following the CALL that took us in this subroutine. Question No: 21 ( Marks: 3 ) scroll up the screen Tell the Formula to rep movsw scroll up scrollup: push bp mov bp,sp push ax push cx push si

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

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

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI Note: PUSHF / POPF have no operands The figure below shows that if (SS) = 3000H, (SP) = 0042H, so the execution of POP CX loads CX by the word 4050H form the stack segment. The SP is incremented by 2.

More information

if 2 16bit operands multiplied the result will be

if 2 16bit operands multiplied the result will be how many operands in ADC? ans:3 how 32 bit word is defined? ans define double if 2 16bit operands multiplied the result will be ans 32bit if div by ero occurs then?? ans div by zero int for software int

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

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

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

Experiment N o 8. String Handling Instructions

Experiment N o 8. String Handling Instructions Experiment N o 8 String Handling Instructions Introduction: In this experiment you will deal with string handling instructions, such as reading a string, moving a string from one memory location to another,

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

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

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

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

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

Architecture and components of Computer System Execution of program instructions

Architecture and components of Computer System Execution of program instructions Execution of program instructions Microprocessor realizes each program instruction as the sequence of the following simple steps: 1. fetch next instruction or its part from memory and placing it in the

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

SARDAR MUDDASAR ALI KHAN

SARDAR MUDDASAR ALI KHAN CS401 Computer Architecture and Assembly Language Programming www.vudesk.com SARDAR MUDDASAR ALI KHAN FILE VERSION UPDATE: Table of Content (DATED: 19-MAY-2011)... ERROR! BOOKMARK NOT DEFINED. TABLE OF

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

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

String Processing. Chapter 9 S. Dandamudi

String Processing. Chapter 9 S. Dandamudi String Processing Chapter 9 S. Dandamudi Outline String representation Using string length Using a sentinel character String instructions Repetition prefixes Direction flag String move instructions String

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

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

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

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

Computer Architecture and Assembly Language Programming CS401 Lecture No: 1 Address, Data, and Control Buses A computer system comprises of a

Computer Architecture and Assembly Language Programming CS401 Lecture No: 1 Address, Data, and Control Buses A computer system comprises of a Computer Architecture and Assembly Language Programming CS401 Lecture No: 1 Address, Data, and Control Buses A computer system comprises of a processor, memory, and I/O devices. I/O is used for interfacing

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

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

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

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

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 7 8086/88 Microprocessor Programming (Data Movement Instructions) Dr Hashim Ali Spring 2018 Department of Computer Science and Engineering

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

Come and join us at WebLyceum

Come and join us at WebLyceum Come and join us at WebLyceum For Past Papers, Quiz, Assignments, GDBs, Video Lectures etc Go to http://www.weblyceum.com and click Register In Case of any Problem Contact Administrators Rana Muhammad

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

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

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

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

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

Lecture Notes on Assembly Language - J. Vaughan

Lecture Notes on Assembly Language - J. Vaughan Lecture Notes on Assembly Language - 18. Shifts and Rotates SHL, SHR: Bitwise Logical Shifts SHL r/m8,1 ; D0 /4 SHL r/m8,cl ; D2 /4 SHL r/m8,imm8 SHL r/m16,1 ; C0 /4 ib ; o16 D1 /4 SHL r/m16,cl ; o16 D3

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

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

Logical and bit operations

Logical and bit operations Assembler lecture 6 S.Šimoňák, DCI FEEI TU of Košice Logical and bit operations instructions performing logical operations, shifts and rotations logical expressions and bit manipulations strings Logical

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

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

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

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

Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998

Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998 Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998 Assembler Syntax Everything looks like this: label: instruction dest,src instruction label Comments: comment $ This is a comment

More information

Inline Assembler. Willi-Hans Steeb and Yorick Hardy. International School for Scientific Computing

Inline Assembler. Willi-Hans Steeb and Yorick Hardy. International School for Scientific Computing Inline Assembler Willi-Hans Steeb and Yorick Hardy International School for Scientific Computing e-mail: steebwilli@gmail.com Abstract We provide a collection of inline assembler programs. 1 Using the

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

Memory address space is selected when which of the following instructions is given to the processor MOV DEC IN ADD My Ok Page # 115

Memory address space is selected when which of the following instructions is given to the processor MOV DEC IN ADD My Ok Page # 115 Muhammad Rizwan Ashraf 0300-7487664 bits of the work independently and individually index register base register flags register accumulator Page # 12 Motorola 68K processors have 23bit general purpose

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

SOEN228, Winter Revision 1.2 Date: October 25,

SOEN228, Winter Revision 1.2 Date: October 25, SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003 1 Contents Flags Mnemonics Basic I/O Exercises Overview of sample programs 2 Flag Register The flag register stores the condition flags that retain

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

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

Computer Organization & Assembly Language Programming. CSE 2312 Lecture 15 Addressing and Subroutine

Computer Organization & Assembly Language Programming. CSE 2312 Lecture 15 Addressing and Subroutine Computer Organization & Assembly Language Programming CSE 2312 Lecture 15 Addressing and Subroutine 1 Sections in 8088 Code TEXT section, for the processor instructions. DATA section for the initialization

More information

Chapter 12. Selected Pentium Instructions

Chapter 12. Selected Pentium Instructions Chapter 12 Selected Pentium Instructions 1 2 Chapter 12 12 1 Carry flag indicates out-of-range error for unsigned operations. Chapter 12 3 12 2 Overflow flag indicates out-of-range error for signed operations.

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

Chapter 4: Data Movement Instructions. 4 1 MOV Revisited

Chapter 4: Data Movement Instructions. 4 1 MOV Revisited Chapter 4: Data Movement Instructions 4 1 MOV Revisited In this chapter, the MOV instruction introduces machine language instructions available with various addressing modes and instructions. It may be

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

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

Assembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:

Assembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler: Assembling, Linking and Executing 1) Assembling: - Assembling converts source program into object program if syntactically correct and generates an intermediate.obj file or module. - It calculates the

More information

1. Introduction to Assembly Language

1. Introduction to Assembly Language www.vchowk.com 1. Introduction to Assembly Language Solved EXERCISE 1 Note: Dear fellows I tried my best to solve this exercise questions if there s any mistake or doubt in any question correct it and

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

MPID MICROPROCESSOR AND ITS INTERFACING DEVICES EEE III II SEMESTER OBJECTIVE QUESTIONS

MPID MICROPROCESSOR AND ITS INTERFACING DEVICES EEE III II SEMESTER OBJECTIVE QUESTIONS MPID MICROPROCESSOR AND ITS INTERFACING DEVICES EEE III II SEMESTER OBJECTIVE QUESTIONS UNIT I 8086 ARCHITECTURE OBJECTIVE TYPE QUESTIONS 1 The number of address spaces of 8085 is ( a) 4 ( b ) 8 ( c )

More information

8086 programming Control Flow Instructions and Program Structures

8086 programming Control Flow Instructions and Program Structures 8086 programming Control Flow Instructions and Program Structures Example: write a procedure named Square that squares the contents of BL and places the result in BX. Square: PUSH AX MOV AL, BL MUL BL

More information

Data Movement Instructions

Data Movement Instructions Segment 3B Data Movement Instructions PUSH/POP Contents Load-Effective address (LEA, LDS, LES) String Data Transfer (LODS, STOS, MOVS) XCHG, XLAT IN and OUT Course Instructor Mohammed Abdul kader Lecturer,

More information

Section 001. Read this before starting!

Section 001. Read this before starting! Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 3 for Fall Semester,

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

Computer Architecture and System Software Lecture 06: Assembly Language Programming

Computer Architecture and System Software Lecture 06: Assembly Language Programming Computer Architecture and System Software Lecture 06: Assembly Language Programming Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Assignment 3 due thursday Midterm

More information

x86 Assembly Tutorial COS 318: Fall 2017

x86 Assembly Tutorial COS 318: Fall 2017 x86 Assembly Tutorial COS 318: Fall 2017 Project 1 Schedule Design Review: Monday 9/25 Sign up for 10-min slot from 3:00pm to 7:00pm Complete set up and answer posted questions (Official) Precept: Monday

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

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

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

The registers(di,si) are automatically incremented or decremented depending on the value of the direction flag:

The registers(di,si) are automatically incremented or decremented depending on the value of the direction flag: String Instructions String instructions were designed to operate on large data structures. The SI and DI registers are used as pointers to the data structures being accessed or manipulated. The operation

More information

Logic Instructions. Basic Logic Instructions (AND, OR, XOR, TEST, NOT, NEG) Shift and Rotate instructions (SHL, SAL, SHR, SAR) Segment 4A

Logic Instructions. Basic Logic Instructions (AND, OR, XOR, TEST, NOT, NEG) Shift and Rotate instructions (SHL, SAL, SHR, SAR) Segment 4A Segment 4A Logic Instructions Basic Logic Instructions (AND, OR, XOR, TEST, NOT, NEG) Shift and Rotate instructions (SHL, SAL, SHR, SAR) Course Instructor Mohammed Abdul kader Lecturer, EEE, IIUC Basic

More information

db "Please enter up to 256 characters (press Enter Key to finish): ",0dh,0ah,'$'

db Please enter up to 256 characters (press Enter Key to finish): ,0dh,0ah,'$' PA4 Sample Solution.model large.stack 100h.data msg1 db "This programs scans a string of up to 256 bytes and counts the repetitions of the number 4206 and sums them.",0dh,0ah,'$' msg2 db "Please enter

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

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

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

LABORATORY WORK NO. 7 FLOW CONTROL INSTRUCTIONS

LABORATORY WORK NO. 7 FLOW CONTROL INSTRUCTIONS LABORATORY WORK NO. 7 FLOW CONTROL INSTRUCTIONS 1. Object of laboratory The x86 microprocessor family has a large variety of instructions that allow instruction flow control. We have 4 categories: jump,

More information

TYPES OF INTERRUPTS: -

TYPES OF INTERRUPTS: - There are 3 types of interrupts. TYPES OF INTERRUPTS: - External Interrupts. Internal Interrupts. Software interrupts. Hardware Interrupts (1) External interrupts come from I/O devices, from a timing device

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

8086 Programming. Multiplication Instructions. Multiplication can be performed on signed and unsigned numbers.

8086 Programming. Multiplication Instructions. Multiplication can be performed on signed and unsigned numbers. Multiplication Instructions 8086 Programming Multiplication can be performed on signed and unsigned numbers. MUL IMUL source source x AL source x AX source AX DX AX The source operand can be a memory location

More information

Computer Architecture and System Programming Laboratory. TA Session 3

Computer Architecture and System Programming Laboratory. TA Session 3 Computer Architecture and System Programming Laboratory TA Session 3 Stack - LIFO word-size data structure STACK is temporary storage memory area register points on top of stack (by default, it is highest

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

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

Practical Malware Analysis

Practical Malware Analysis Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the

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

M80C286 HIGH PERFORMANCE CHMOS MICROPROCESSOR WITH MEMORY MANAGEMENT AND PROTECTION

M80C286 HIGH PERFORMANCE CHMOS MICROPROCESSOR WITH MEMORY MANAGEMENT AND PROTECTION HIGH PERFORMANCE CHMOS MICROPROCESSOR WITH MEMORY MANAGEMENT AND PROTECTION Military Y High Speed CHMOS III Technology Pin for Pin Clock for Clock and Functionally Compatible with the HMOS M80286 Y 10

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

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

CHAPTER 8086 INSTRUCTIONS SET AND PROGRAMMING

CHAPTER 8086 INSTRUCTIONS SET AND PROGRAMMING 3 CHAPTER 886 INSTRUCTIONS SET AN PROGRAMMING 84 3.1. INSTRUCTION FORMAT The instruction format of 886 has one or more number of fields associated with it. The first filled is called operation code field

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

Lab 3. The Art of Assembly Language (II)

Lab 3. The Art of Assembly Language (II) Lab. The Art of Assembly Language (II) Dan Bruce, David Clark and Héctor D. Menéndez Department of Computer Science University College London October 2, 2017 License Creative Commons Share Alike Modified

More information

A CRASH COURSE IN X86 DISASSEMBLY

A CRASH COURSE IN X86 DISASSEMBLY A CRASH COURSE IN X86 DISASSEMBLY As discussed in previous chapters, basic static and dynamic malware analysis methods are good for initial triage, but they do not provide enough information to analyze

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

UNIVERSITY OF CALIFORNIA, RIVERSIDE

UNIVERSITY OF CALIFORNIA, RIVERSIDE Final Page 1 of 7 UNIVERSITY OF CALIFORNIA, RIVERSIDE Computer Science Department CS61 Machine Organization & Assembly Language Final September 1, 2000 53 Name: Solution Key Student ID#: Please print legibly

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

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

Read this before starting!

Read this before starting! Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 3 for Fall Semester,

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

Assembly Language LAB

Assembly Language LAB Assembly Language LAB Islamic University Gaza Engineering Faculty Department of Computer Engineering 2013 ECOM 2125: Assembly Language LAB Created by: Eng. Ahmed M. Ayash Modified and Presented By: Eihab

More information