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

Similar documents
Babu Madhav Institute of Information Technology, UTU

Week /8086 Microprocessor Programming I

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

9/25/ Software & Hardware Architecture

Week /8086 Microprocessor Programming II

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

Intel 8086: Instruction Set

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

CC411: Introduction To Microprocessors

Arithmetic and Logic Instructions And Programs

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

Intel 8086 MICROPROCESSOR ARCHITECTURE

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

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

8086 INTERNAL ARCHITECTURE


Intel 8086 MICROPROCESSOR. By Y V S Murthy

Computer Architecture 1 ح 303

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.

Computer Organization and Assembly Language CSC-210

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.

ADVANCE MICROPROCESSOR & INTERFACING

Arithmetic Instructions

EC 333 Microprocessor and Interfacing Techniques (3+1)

2. (a) Draw and explain the pin out diagram of (b) Explain the various operations performed by Bus Interfacing unit in 8086.

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

Experiment 3 3 Basic Input Output

EEM336 Microprocessors I. Data Movement Instructions

PESIT Bangalore South Campus

Lecture (07) x86 programming 6

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMMUNICATION ENGINEERING REG 2008 TWO MARKS QUESTION AND ANSWERS

8088/8086 Programming Integer Instructions and Computations

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

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

ORG ; TWO. Assembly Language Programming

CS-202 Microprocessor and Assembly Language

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language

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

Question Bank Unit-1

EE2007 Microprocessor systems.

Internal architecture of 8086

Introduction to Microprocessor

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

CG2007 Microprocessor systems.

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

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

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

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

Section 001. Read this before starting!

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

Code segment Stack segment

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

Experiment #2. Addressing Modes and Data Transfer using TASM

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

QUESTION BANK CS2252 MICROPROCESSOR AND MICROCONTROLLERS

CS401 Assembly Language Solved MCQS From Midterm Papers

3.1 DATA MOVEMENT INSTRUCTIONS 45

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATION ENGINEERING QUESTION BANK

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Tutorial Letter 103/3/2012 Computer Organization COS2621 Semesters 1 & 2

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

MLR INSTITUTE OF TECHNOLOGY DUNDIGAL , HYDERABAD

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI

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

if 2 16bit operands multiplied the result will be

Chapter 3: Addressing Modes

icroprocessor istory of Microprocessor ntel 8086:

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

EC-333 Microprocessor and Interfacing Techniques

Hardware and Software Architecture. Chapter 2

8086 INSTRUCTION SET

COE 205 Lab Manual Experiment N o 12. Experiment N o Using the Mouse

ASSEMBLY LANGUAGE PROGRAMMING OF THE MICROCOMPUTER

Computer Architecture and System Software Lecture 07: Assembly Language Programming

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

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

UNIT 2 PROCESSORS ORGANIZATION CONT.

Lesson 1. Fundamentals of assembly language


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

Assembly Language Programming of 8085

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

3- ADDRESSING MODES in 8086: In this section we use the MOV instruction to describe the data-addressing modes. Figure 3-1 shows the MOV instruction.

UNIT 4. Modular Programming

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

INSTITUTE OF ENGINEERING AND MANAGEMENT, KOLKATA Microprocessor

EC6504 MICROPROCESSOR AND MICROCONTROLLER

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

INTRODUCTION TO MICROPROCESSORS

IBM PC Hardware CPU 8088, Pentium... ALU (Arithmetic and Logic Unit) Registers. CU (Control Unit) IP.

Lecture 16: Passing Parameters on the Stack. Push Examples. Pop Examples. CALL and RET

Chapter 3. Assembly Language Programming with 8086

8086 Interrupts and Interrupt Responses:

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 153) Pass Marks: 24

6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:

SHEET-2 ANSWERS. [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte.

Basic Execution Environment

EEM336 Microprocessors I. Addressing Modes

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

Transcription:

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 decimal numbers to binary: 22 76 500 3. Convert the following binary number to decimal: 1011 11010001 11101110010110 4. Convert to hexadecimal: 53 decimal 756 decimal 01101100010 binary 11000010111 binary 5. Convert to decimal: D3H 3FEH 44H 6. Convert the following decimal numbers to BCD: 86 62 33 7. Define parity and describe how it is used to detect an error in transmitted data. 8. Show addition of: 10011! and 1011! in binary 37!" and 25!" in BCD 4AH and 77H 9. Express the following decimal numbers in 8-bit sign and magnitude form: +26-7 -26-125 10. Show the subtraction, in binary, of the following decimal numbers. 7-4 37-26 125 93 11. Show the multiplication of 1001 and 011. 12. Show the division of 1100100 by 1010. 13. Do the indicated operations on the following numbers: 3AH + 94H 17AH 4CH 0101 1001 BCD Mr. Sapan Naik 1

+0100 0010 BCD 0111 1001 BCD +01001001 BCD 0101 1001 BCD +0010 0110 BCD -01100 0111 BCD -0011 1001 BCD 14. Show the output produced when the following binary words are ANDed with each other and when they are ORed with each other: 1010 and 0111 1011 and 1100 11010111 and 111000 15. ANDing an 8-bit binary number with 11110000 is sometimes referred to as masking the lower 4 bit why? 16. Describe the main advantage of distributed processing computer system over a simple timesharing system. 17. Describe the sequence of signals that occurs on the address bus, the control bus, and the data bus when a simple microcomputer fetches an instruction. 18. What determines whether a microprocessor is considered an 8-bit, a 16-bit, or a 32-bit device? 19. How many address lines does an 8086 have? 20. How many memory address does this number of address lines allow the 8086 to access directly? 21. At any given time, the 8086 works with four segments in this address space. How many bytes are contained in each segment? 22. What is the main difference between the 8086 and the 8088? 23. Describe the function of the 8086 queue and How does the queue speed up processing? 24. If the code segment for an 8086 program starts at address 70400H, what number will be in the CS register? And assuming this same code segment base, what physical address will a code byte be fetched from if the instruction pointer contain 539CH? 25. What physical address is represented by : 4370:561EH, 7A32:0028H 26. What is the advantage of using a CPU register for temporary data storage over using a memory location? 27. If the stack segment register contain 3000H and the stack pointer register contains 8434H, What is the physical address of the top of the stack? 28. What is the advantage of using assembly language instead of writing a program directly in machine language? 29. Describe the operation an 8086 will perform when it executes ADD AX, BX. 30. What types of program are usually written in assembly language? 31. Describe the operation that an 8086 will perform when it executes each of the following instructions: MOV BX, 03FFH MOV AL,0DBH MOV DH,CL MOVBX,AX 32. Write the 8086 assembly language statement which will perform the following operations: Load the number 7986H into the BP register. Copy the BP register contains to the SP register.

Copy the contents of the AX register to the DS register. Load the number F3H into the AL register. 33. If the 8086 execution unit calculates an effective address of 14A34 and DS contains 7000H what physical address will the BUI produce? 34. If the data segment register (DS) contains 4000H, what physical address will the instruction MOV AL,[234Bh] read? 35. If the 8086 data segment register contains 7000H, write the instruction that will copy the contents of DL to address 74B2CH. 36. Describe the difference between the instructions MOV AX,2437H and MOV AX,[2437H]. Unit 2: 8086 assembly language programming techniques 1. List the major steps in developing an assembly language program. 2. What is the main advantage of a top-down design approach to solving a program problem? 3. Why should you develop a detailed algorithm for a program before writing down any assembly for a program before writing down any assembly language instructions? 4. What are the three basic structure types used to write the algorithm for a program? 5. What is the advantage of using only these structures when writing the algorithm for a program? 6. Use a flowchart or pseudo code to show the algorithm for a program, which gets a number from a memory location, subtracts 20H from it, and outputs 01H to port 3AH if the result of the subtraction is greater than 25H. 7. Given the register contents in figure 1 answer the following questions: a. What physical address will the next instruction be fetched from? b. What is the physical address for the top of the stack? ES = 1234h CS = 2345h SS = 3456h DS = 4567h AX = 4321h BX = 5432h CX = 6543h DX = 7654h SP = 1111h BP = 2222h SI = 3333h DI = 4444h Figure 1. Register content IP = 5678h 8. Describe the operation and results of each of the following instruction, Given the register contents show in figure 1 include in your answer the physical address or register that each instruction will get its operands from and the physical address or register. Assume that the following instructions are independent, not sequential, unless listed together under a letter. a. MOV AX,BX b. MOVCL,37H c. INCBX d. MOVCX.[246BH] e. MOVCX,246BH f. ADDAL,DH g. MULBX h. DECBP i. DIVBL j. SUBAX,DX k. ORCL,BL l. NOTAH Mr. Sapan Naik 3

m. ROLBX,CH n. ANDAL,CH o. AOVDS,AX p. PORBX,CL q. ANDAL,OFH r. MOV,AX,[BX] s. MOV[BX][SI],CL 9. See if you can spot the grammatical (syntax) errors in the following instruction. a. MOVBH,AX b. MOVDX,CL c. ADDAL,2073H d. MOV7632H,CX e. INBL,04H 10. Show the results that will be in the affected registers or memory locations after each of the following groups of the following groups of instructions executes. Assume that each group of instructions starts with the register and memory contents shown in Figure 1. -ADDBL,AL MOV [00041,BL ROR DI, 04 -MOV CL,04 -ADD Al,BH DAA -MOV BX,000AH MOV AL,[BX] SUB AL,CL INC BX MOV [BX),AL 11. Write the 8086 instructions, which will perform the indicated operation. Copy AL to BL. Load 43H into CL Increment the contents of CX by 1. Copy SP to BP. Add 07H to DL. Multiply AL times BL. Copy AX to a memory location at offset 245AH in data segment. Decrement SP by 1. Rotate the most significant bit of AL into the least significant bit position. Copy DL to a memory location whose offset is in BX. Mask the lower 4 bits of BL. Set the most significant bit of AX to a 1,but do not affect the other bits. Invent the lower 4 bits of BL,but do not affect the other bits. 12. Construct the binary code for each of the following 8086 instructions. MOV BL,AL ROR AX,I MOV[BX],CX OUTDX, AL ADD BX,59H[DI] AND AL,OFH SUB[2048],DH NOP XCHGCH,ES:[BX] IN AL,DX 13. Describe how an assembly language program is a developed and debugged using system tool such as editors, assembler, linker, locator, emulators and debuggers.

Unit 3: Procedures, Macros and Assembler Directives 1. Describe stack operations during near procedure CALL and RET. 2. What is reentrant procedure? Differentiate reentrant and recursive procedure. 3. Differentiate procedures and macros. 4. Write instruction format of CALL instruction for inter-segment, indirect call. 5. Explain STD, DAS, ROL,JG and CALL instructions with example. 6. Define: Indirect inter-segment call. 7. List out any two control flags of 8086. 8. Explain LEA, ADC, AAA, JL and CMP instructions with example. 9. Define: Direct inter-segment jump. 10. Describe XCGH, DAA, SBB, ROR and PUSH instructions with example. 11. Describe stack operations during near procedure CALL and RET. 12. List out different types of Unconditional Jump instructions. Describe 8086 binary coding template of the same. 13. What is reentrant procedure? How to make any procedure as reentrant? 14. Define: Indirect intra-segment jump. 15. Describe the operation and result of each of the following instructions given the register contains showing figure including your answered register that each instruction will get its operand from enter physical address of register that each instruction can get result in it. user instruction description in chapter 6 to help you assume that the instruction below are independent, not sequential, unless listed together under a letter a) ROLL AX,CX b) IN AL,DXP c) MOV CX,IBX] d) ADD AX,[BX][SI] e) JMP 023AH f) JMP BX 16. Construct the binary codes for instruction for question 15a through 15f. 17. Predict the state of the 6 of 8086 conditional flags after each of the following instruction or group of instructions executes. use the registers contents shown in figure assume that all flags are reset before the instruction execute use the detail instruction description in the chapter 6 to help you. a) MOV AL,AH b) ADD BL,CL c) ADD CL,DH d) OR CX,BX 18. See if you can find any errors in the following instruction of group of instructions. a) CNTDOWN : MOV BL,72H DEC BL JNZ CNTDOWN b) ADD CX,AL c) JMP BL Mr. Sapan Naik 5

d) JNZ [BX] 19. a ) write an algorithm for programmer which adds a byte number from one memory location to a byte from next memory location, put the sum in third memory location and save the state of flag in the least significant bit of a fourth memory location. b) write an 8086 assembly language program for this algorithm. hints: setup data declarations similar to those in figure use of rotate instruction to get the carry flag state the instruction LSD of register or memory location c) what additional instruction would you have to add to this program so that it correctly add 2 BCD bytes? 20. A common problem when reading a series of ASCII characters from a keyboard is the need to filter out those codes which represent the hex digits 0 to 9 and a to f and convert these ASCII Codes to the hex digits they represents. example, if we read 34h the ASCII code for 4. we want to mask upper 4 bits to leave 04, the 8 Bit hex code for 4 if we read in 42h the ASCII for B, we want to add 09 and mask the upper 4 bits to leave 0B, the 8 bit code for hex B. if we read in an ASCII code that is not in the range 30h to 39h or 31h to 36h then we want to load and error code of FFH instead of the hex value of the entered character. Figure 2 shows describe the action next to each range of ASCII values write an algorithm and assembly language program which implements the actions. hints: a nested IF - THEN - ELSE structure might be useful. 21. Compute the average of 4 bytes stored in an array in memory 22. Compute the average of any number of bytes in an array in memory. number of bytes to be added is in the first byte of the array. 23. Add a five-byte number in one array to a five byte number in another array. put the same in another array. put the state of the carry flag in byte 6 of the array that contains the sum the first value in each array is the least significant byte of that number. 24. 8086 Based process control system outputs a Measured Fahrenheit Temperature to a display on its front panel. you need write a short program which converts Fahrenheit temperature to Celsius so that System can be sold in Europe the Relationship between Fahrenheit and Celsius is C = (F-32)5/9. the Fahrenheit Temperature will always be in the range 50 to 250. Round the Celsius Value to the nearest degree. 25. Write a delay loop which produces a delay of 500us on an 8086 with a 5-MHz delay 26. Write a short program which outputs a 1 KHz square wave on D0 of port FFFAH the basic principle is to output of high, wait 500us (0.5ms.output a low wait 500us output a high etc.) Unit 4: Interfacing 1. Write pin number of 8086 for a) to enable latch, b) INTA. 2. Draw the circuit connections for the 3625 decoder PROM and for two of the 4Kx8 RAMs. 3. Show the truth table you would use for a 3625 PROM decoder to produce CSI signals for 4Kx8 RAMs in an 8086 system. Assume the first RAM starts at address 00000H. Do not forget A0 and BHE. 4. Trace below program and write registers content after each instruction.

5. 6. data segment a. ans db? b. num db 0f1h 7. ends 8. 9. code segment 10. start: a. mov ax, @data b. mov ds, ax c. mov al, num d. rol al, 02 e. ror al, 03 f. rol al, 04 g. ror al, 05 h. xchg ah, al i. mov ans, ah j. mov ax, 4c00h k. int 21h 11. ends 12. end start 13. Explain 8086 memory banks and describe RAM address decoding on the SDK-86. 14. Differentiate memory mapped I/O and direct I/O. 15. Show the truth table you would use for a 3625 PROM decoder to produce CSI signals for eight 8Kx8 ROMs in an 8086 system. Assume the first RAM starts at address 00000H. Do not forget A0 and BHE. 16. Draw the block diagram of 8086 memory banks. Explain signals for byte and word operations for the same. 17. Explain 8086 memory banks and describe RAM address decoding on the SDK-86. 18. List out ways of accessing I/O. Which way is better in which situation? 19. Show the truth table you would use for a decoder to produce CSI signals for four 8Kx8 ROMs in an 8086 system. 20. User does not want to waste memory for accessing I/O. In this situation which method of accessing I/O is preferable and why? 21. Draw the circuit connections for the 3625 decoder PROM and for two of the 16Kx8 RAMS. Show the truth table of address also. Unit 5: 8086 Interrupts and Interrupt Application 1. Write down the name of Type 3 interrupt. 2. Where in memory interrupt-pointer table is stored for 8086? Draw the structure of it. 3. On which memory locations, the Interrupt pointer table is stored? What is the use of it? 4. List out any two ways of taking input from keyboard and give example of both. 5. How to clear screen and set the cursor using interrupt? Describe screen features in detail. 6. What is the use of TYPE 2 and TYPE 3 interrupts? 7. Define BIOS Keyboard data area. What is the use of INT 16H interrupt? 8. Draw 8086 interrupt-pointer table. Explain 8086 interrupts and interrupt responses. 9. Explain 09H, 02H and 40H functions for screen display of INT 21H with example. 10. What is the use of 09H function of INT 21h? 11. Write down the names of Type 0 and Type 1 interrupt. Mr. Sapan Naik 7

12. How much memory does interrupt pointer table occupy? What is the starting address of TYPE 3 interrupt? 13. List out any functions of INT 21H for screen interrupt and give example of both. 14. Explain 8086 interrupt types in detail. 15. What is BIOS keyboard data area? Explain interrupt for taking input from keyboard. Unit 6: Programmable Peripheral Devices 1. What is the chip number for programmable interrupt controller and DMA controller? 2. Draw internal block diagram of 8255A programmable parallel port device. 3. Write short note on 8251 Programmable interface device Serial I/O. 4. List out modules of 8251 - Programmable Interface device. What is the use of data buffer module? 5. Write short note on 8259 - Programmable Interrupt Controller. 6. How many interrupt lines are available in 8259 - Programmable Interrupt Controller? Can it handle nonmaskable interrupts? 7. Write short note on 8237 - DMA Controller. 8. List out mode of 8255 - Programmable Peripheral Interface and write use of all modes.