46
1 INDEX INDEX INDEX INDEX S.NO. S.NO. S.NO. S.NO. EXPERIMENTS EXPERIMENTS EXPERIMENTS EXPERIMENTS PAGE PAGE PAGE PAGE NO NO NO NO. 1. Architecture or Functional Block Diagram of 8086 2 2. Instruction Set of 8085 Microprocessor 7 3. Introduction to MASM Software 10 4. How to use MASM software 12 5. Basic Commands of MASM 8086 Microprocessor Software 13 6. Program to add and subtract two 8 bits Hexadecimal numbers using 8086 µP 14 7. Program to add and subtract two 16 bits Hexadecimal numbers using 8086 µP 16 8. Program to multiply two 8 bits Hexadecimal numbers using 8086 µP 18 9. Program to multiply two 16 bits Hexadecimal numbers using 8086 µP 19 10. Write an ALP for division of two 8 bits Hexadecimal numbers using 8086 µP 20 11. Write an ALP for division of two 16 bits Hexadecimal numbers using 8086 µP 21 12. Write an ALP to find the factorial of a given number using 8086 µP 22 13. Write an ALP to find the number of characters in a given string using 8086 µP 24 14. Write an ALP to arrange an array of Data in ascending/descending order using 8086 µP 26 15. Microprocessor Lab Viva Questions with Answers 28

S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

  • Upload
    hakien

  • View
    245

  • Download
    5

Embed Size (px)

Citation preview

Page 1: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

1

INDEXINDEXINDEXINDEX

S.NO.S.NO.S.NO.S.NO. EXPERIMENTSEXPERIMENTSEXPERIMENTSEXPERIMENTS PAGEPAGEPAGEPAGE NONONONO....

1. Architecture or Functional Block Diagram of 8086 22. Instruction Set of 8085 Microprocessor 73. Introduction to MASM Software 104. How to use MASM software 125. Basic Commands of MASM 8086 Microprocessor Software 136. Program to add and subtract two 8 bits Hexadecimal numbers using 8086 µP 147. Program to add and subtract two 16 bits Hexadecimal numbers using 8086

µP16

8. Program to multiply two 8 bits Hexadecimal numbers using 8086 µP 189. Program to multiply two 16 bits Hexadecimal numbers using 8086 µP 19

10. Write an ALP for division of two 8 bits Hexadecimal numbers using 8086µP

20

11. Write an ALP for division of two 16 bits Hexadecimal numbers using 8086µP

21

12. Write an ALP to find the factorial of a given number using 8086 µP 2213. Write an ALP to find the number of characters in a given string using 8086

µP24

14. Write an ALP to arrange an array of Data in ascending/descending orderusing 8086 µP

26

15. Microprocessor Lab Viva Questions with Answers 28

Page 2: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

2

1.1.1.1. BlockBlockBlockBlock DiagramDiagramDiagramDiagram ofofofof IntelIntelIntelIntel 8086808680868086

The 8086 CPU is divided into two independent functional units:1.1.1.1. Bus Interface Unit (BIU)2.2.2.2. Execution Unit (EU)

Fig.Fig.Fig.Fig. 1:1:1:1: BlockBlockBlockBlock DiagramDiagramDiagramDiagram ofofofof IntelIntelIntelIntel 8086808680868086

FeaturesFeaturesFeaturesFeatures ofofofof 8086808680868086 Microprocessor:Microprocessor:Microprocessor:Microprocessor:1.1.1.1. Intel 8086 was launched in 1978.2.2.2.2. It was the first 16-bit microprocessor.3.3.3.3. This microprocessor had major improvement over the execution speed of 8085.4.4.4.4. It is available as 40-pin Dual-Inline-Package (DIP).5.5.5.5. It is available in three versions:

a.a.a.a. 8086 (5 MHz)b.b.b.b. 8086-2 (8 MHz)c.c.c.c. 8086-1 (10 MHz)

6.6.6.6. It consists of 29,000 transistors.

Page 3: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

3

BusBusBusBus InterfaceInterfaceInterfaceInterface UnitUnitUnitUnit (BIU)(BIU)(BIU)(BIU)The function of BIU is to:

· Fetch the instruction or data from memory.· Write the data to memory.· Write the data to the port.· Read data from the port.

InstructionInstructionInstructionInstruction QueueQueueQueueQueue1.1.1.1. To increase the execution speed, BIU fetches as many as six instruction bytes aheadto time from memory.2.2.2.2. All six bytes are then held in first in first out 6 byte register called instructionqueue.3.3.3.3. Then all bytes have to be given to EU one by one.4.4.4.4. This pre fetching operation of BIU may be in parallel with execution operation ofEU, which improves the speed execution of the instruction.

ExecutionExecutionExecutionExecution UnitUnitUnitUnit (EU)(EU)(EU)(EU)The functions of execution unit are:

· To tell BIU where to fetch the instructions or data from.· To decode the instructions.· To execute the instructions.

The EU contains the control circuitry to perform various internal operations. Adecoder in EU decodes the instruction fetched memory to generate different internalor external control signals required to perform the operation. EU has 16-bit ALU,which can perform arithmetic and logical operations on 8-bit as well as 16-bit.

GeneralGeneralGeneralGeneral PurposePurposePurposePurpose RegistersRegistersRegistersRegisters ofofofof 8086808680868086These registers can be used as 8-bit registers individually or can be used as 16-bit inpair to have AX, BX, CX, and DX.

1.1.1.1. AXAXAXAX Register:Register:Register:Register:AX register is also known as accumulator register that stores operands for arithmeticoperation like divided, rotate.

2.2.2.2. BXBXBXBXRegister:Register:Register:Register:This register is mainly used as a base register. It holds the starting base location of amemory region within a data segment.

3.3.3.3. CXCXCXCX Register:Register:Register:Register:It is defined as a counter. It is primarily used in loop instruction to store loop counter.

4. DXDXDXDX Register:Register:Register:Register:DX register is used to contain I/O port address for I/O instruction.

Page 4: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

4

SegmentSegmentSegmentSegment RegistersRegistersRegistersRegistersAdditional registers called segment registers generate memory address whencombined with other in

5.5.5.5. the microprocessor. In 8086 microprocessor, memory is divided into 4 segments asfollow:

Fig.Fig.Fig.Fig. 2:2:2:2: MemoryMemoryMemoryMemory SegmentsSegmentsSegmentsSegments ofofofof 80868086808680861.1.1.1. CodeCodeCodeCode SegmentSegmentSegmentSegment (CS):(CS):(CS):(CS):The CS register is used for addressing a memory location in the Code Segment of thememory, where the executable program is stored.2.2.2.2. DataDataDataData SegmentSegmentSegmentSegment (DS):(DS):(DS):(DS):The DS contains most data used by program. Data are accessed in the Data Segmentby an offset address or the content of other register that holds the offset address.3. StackStackStackStack SegmentSegmentSegmentSegment (SS):(SS):(SS):(SS):SS defined the area of memory used for the stack.4.4.4.4. ExtraExtraExtraExtra SegmentSegmentSegmentSegment (ES):(ES):(ES):(ES):ES is additional data segment that is used by some of the string to hold the destinationdata.FlagFlagFlagFlag RegistersRegistersRegistersRegisters ofofofof 80868086808680865.5.5.5. Flag register in EU is of 16-bit and is shown in fig. 3:

Page 5: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

5

Fig.Fig.Fig.Fig. 3:3:3:3: FlagFlagFlagFlag RegisterRegisterRegisterRegister ofofofof 8086808680868086

Flags Register determines the current state of the processor. They are modifiedautomatically by CPU after mathematical operations, this allows to determine the typeof the result, and to determine conditions to transfer control to other parts of theprogram. 8086 has 9 flags and they are divided into two categories:

1.1.1.1. Conditional Flags2.2.2.2. Control Flags

ConditionalConditionalConditionalConditional FlagsFlagsFlagsFlagsConditional flags represent result of last arithmetic or logical instruction executed.Conditional flags are as follows:

· CarryCarryCarryCarry FlagFlagFlagFlag (CF):(CF):(CF):(CF): This flag indicates an overflow condition for unsigned integerarithmetic. It is also used in multiple-precision arithmetic.· AuxiliaryAuxiliaryAuxiliaryAuxiliary FlagFlagFlagFlag (AF):(AF):(AF):(AF): If an operation performed in ALU generates a carry/barrowfrom lower nibble (i.e. D0 – D3) to upper nibble (i.e. D4 – D7), the AF flag is set i.e.carry given by D3 bit to D4 is AF flag. This is not a general-purpose flag, it is usedinternally by the processor to perform Binary to BCD conversion.· ParityParityParityParity FlagFlagFlagFlag (PF):(PF):(PF):(PF): This flag is used to indicate the parity of result. If lower order8-bits of the result contains even number of 1’s, the Parity Flag is set and for oddnumber of 1’s, the Parity Flag is reset.· ZeroZeroZeroZero FlagFlagFlagFlag (ZF):(ZF):(ZF):(ZF): It is set; if the result of arithmetic or logical operation is zero elseit is reset.· SignSignSignSign FlagFlagFlagFlag (SF):(SF):(SF):(SF): In sign magnitude format the sign of number is indicated by MSBbit. If the result of operation is negative, sign flag is set.· OverflowOverflowOverflowOverflow FlagFlagFlagFlag (OF):(OF):(OF):(OF): It occurs when signed numbers are added or subtracted. AnOF indicates that the result has exceeded the capacity of machine.

ControlControlControlControl FlagsFlagsFlagsFlagsControl flags are set or reset deliberately to control the operations of the executionunit. Control flags are as follows:

1.1.1.1. TrapTrapTrapTrap FlagFlagFlagFlag (TP):(TP):(TP):(TP):a.a.a.a. It is used for single step control.b.b.b.b. It allows user to execute one instruction of a program at a time for debugging.c.c.c.c. When trap flag is set, program can be run in single step mode.2.2.2.2. InterruptInterruptInterruptInterrupt FlagFlagFlagFlag (IF):(IF):(IF):(IF):

Page 6: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

6

a.a.a.a. It is an interrupt enable/disable flag.b.b.b.b. If it is set, the maskable interrupt of 8086 is enabled and if it is reset, the interrupt isdisabled.c.c.c.c. It can be set by executing instruction sit and can be cleared by executing CLIinstruction.3.3.3.3. DirectionDirectionDirectionDirection FlagFlagFlagFlag (DF):(DF):(DF):(DF):a.a.a.a. It is used in string operation.b.b.b.b. If it is set, string bytes are accessed from higher memory address to lower memoryaddress.c.c.c.c. When it is reset, the string bytes are accessed from lower memory address to highermemory address.

Page 7: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

7

2.2.2.2. 8086808680868086 InstructionInstructionInstructionInstruction SetSetSetSet andandandand itsitsitsits ClassificationClassificationClassificationClassification

The instructions of 8086 are classified into SIX groups. They are:1. DATA TRANSFER INSTRUCTIONS2. ARITHMETIC INSTRUCTIONS3. BIT MANIPULATION INSTRUCTIONS4. STRING INSTRUCTIONS5. PROGRAM EXECUTION TRANSFER INSTRUCTIONS6. PROCESS CONTROL INSTRUCTIONS

1.1.1.1.DATADATADATADATATRANSFERTRANSFERTRANSFERTRANSFER INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONSThe DATA TRANSFER INSTRUCTIONS are those, which transfers the DATA fromany one source to any one destination.The datas may be of any type. They are againclassified into four groups.They are:

GENERALGENERALGENERALGENERALPURPOSEPURPOSEPURPOSEPURPOSE BYTEBYTEBYTEBYTE

ORORORORWORDWORDWORDWORDTRANSFERTRANSFERTRANSFERTRANSFER

INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONS

SIMPLESIMPLESIMPLESIMPLE INPUTINPUTINPUTINPUTANDANDANDAND OUTPUTOUTPUTOUTPUTOUTPUT

PORTPORTPORTPORTTRANSFERTRANSFERTRANSFERTRANSFER

INSTRUCTIONINSTRUCTIONINSTRUCTIONINSTRUCTION

SPECIALSPECIALSPECIALSPECIALADDRESSADDRESSADDRESSADDRESSTRANSFERTRANSFERTRANSFERTRANSFER

INSTRUCTIONINSTRUCTIONINSTRUCTIONINSTRUCTION

FLAGFLAGFLAGFLAGTRANSFERTRANSFERTRANSFERTRANSFER

INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONS

MOVPUSHPOP

XCHGXLAT

INOUT

LEALDSLES

LAHFSAHF

PUSHFPOPF

2.ARITHMETIC2.ARITHMETIC2.ARITHMETIC2.ARITHMETIC INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONSThese instructions are those which are useful to perform Arithmetic calculations, suchas addition, subtraction, multiplication and division.They are again classified into fourgroups.They are:

ADDITIONINSTRUCTIONS

SUBTRACTIONINSTRUCTIONS

MULTIPLICATION

INSTRUCTIONS

DIVISIONINSTRUCTIONS

ADDADCINCAAADAA

SUBSBBDECNEGCMPAASDAS

MULIMULAAM

DIVIDIVAADCBWCWD

Page 8: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

8

3.BIT3.BIT3.BIT3.BITMANIPULATIONMANIPULATIONMANIPULATIONMANIPULATION INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONSThese instructions are used to perform Bit wise operations.

LOGICALLOGICALLOGICALLOGICALINSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONS

SHIFTSHIFTSHIFTSHIFT INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONS ROTATEROTATEROTATEROTATEINSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONS

NOTANDOR

XORTEST

SHL / SALSHRSAR

ROLRORRCLRCR

4.4.4.4. STRINGSTRINGSTRINGSTRING INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONSThe string instructions function easily on blocks of memory.They are user friendlyinstructions, which help for easy program writing and execution. They can speed upthe manipulating code.They are useful in array handling, tables and records.

STRINGSTRINGSTRINGSTRING INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONSREP

REPE / REPZREPNE / REPNZ

MOVS / MOVSB / MOVSWCOMPS / COMPSB / COMPSW

SCAS / SCASB / SCASWLODS / LODSB / LODSWSTOS / STOSB / STOSW

5.5.5.5.PROGRAMPROGRAMPROGRAMPROGRAM EXECUTIONEXECUTIONEXECUTIONEXECUTION TRANSFERTRANSFERTRANSFERTRANSFER INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONS

These instructions transfer the program control from one address to other address.( Not in a sequence). They are again classified into four groups.They are:

UNCONDITIONALTRANSFER

INSTRUCTIONS

CONDITIONALTRANSFER

INSTRUCTIONS

ITERATIONCONTROL

INSTRUCTIONS

INTERRUPTINSTRUCTION

SCALLRETJMP

JA/JNBEJAE/JNBJB/

JNAE

JLE / JNGJNC

JNE / JNZJNO

JNP / JPOJNS

LOOPLOOPE / LOOPZ

LOOPNE/LOOPNZ

JCXZ

INTINTOIRET

Page 9: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

9

JBE/JNAJC

JE / JZ

JG/JNLEJGE/JNLJL/

JNGE

JOJP / JPE

JS

6.6.6.6. PROCESSPROCESSPROCESSPROCESS CONTROLCONTROLCONTROLCONTROL INSTRUCTIONSINSTRUCTIONSINSTRUCTIONSINSTRUCTIONS

These instructions are used to change the process of the Microprocessor. They changethe process with the stored information. They are again classified into Twogroups.They are:

FLAG SET /CLEAR INSTRUCTIONS

EXTERNAL HARDWARESYNCHRONIZATION

INSTRUCTIONSSTCCLCCMCSTDCLDSTICLI

HLTWAITESC

LOCKNOP

Page 10: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

10

3.3.3.3. MicrosoftMicrosoftMicrosoftMicrosoft MacroMacroMacroMacroAssemblerAssemblerAssemblerAssembler

The MicrosoftMicrosoftMicrosoftMicrosoft MacroMacroMacroMacro AssemblerAssemblerAssemblerAssembler (MASM)(MASM)(MASM)(MASM) is an x86 assembler that uses the Intelsyntax for MS-DOS and Microsoft Windows. Beginning with MASM 8.0 there aretwo versions of the assembler - one for 16-bit and 32-bit assembly sources, andanother (ML64) for 64-bit sources only.MASM is maintained by Microsoft, but since version 6.12 has not been sold as aseparate product, it is instead supplied with various Microsoft SDKs and C compilers.Recent versions of MASM are included with Microsoft Visual Studio.

HistoryHistoryHistoryHistoryThe earliest versions of MASM date back to 1981.Up to version 5.0, MASM was available as an MS-DOS application only. Versions 5.1and 6.0 were available as both MS-DOS and OS/2 applications.Version 6.0, released in 1992, added high-level programming support and a moreC-like syntax. By the end of the year, version 6.1A updated the memory managementto be compatible with code produced by Visual C++. In 1993 full support for 32-bitapplications and the Pentium instruction set was added. The MASM binary at thattime was shipped as a "bi-modal" DOS-extended binary (using the Phar Lap TNTDOS extender).Versions 6.12 to 6.14 were implemented as patches for version 6.11. These patcheschanged the type of the binary to native PE format; version 6.11 is the last version ofMASM that will run under MS-DOS.By the end of 1997 MASM fully supported Windows 95 and included someAMD-specific instructions.In 1999 Intel released macros for SIMD and MMX instructions, which were shortlyafter supported natively by MASM. With the 6.15 release in 2000, Microsoftdiscontinued support for MASM as a separate product, instead subsuming it into theVisual Studio toolset. Though it was still compatible with Windows 98, currentversions of Visual Studio were not. Support for 64-bit processors was not added untilthe release of Visual Studio 2005, with MASM 8.0.

ObjectObjectObjectObject modulemodulemodulemodule formatsformatsformatsformats supportedsupportedsupportedsupported bybybyby MASMMASMMASMMASM

Early versions of MASM generated object modules using the OMF format, which wasused to create binaries for MS-DOS or OS/2.Since version 6.1, MASM is able to produce object modules in the PortableExecutable (PE/COFF) format. PE/COFF is compatible with recent Microsoft Ccompilers, and object modules produced by either MASM or the C compiler can beroutinely intermixed and linked into Win32 and Win64 binaries.

Page 11: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

11

SomeSomeSomeSome third-partythird-partythird-partythird-party toolstoolstoolstools thatthatthatthat supportsupportsupportsupport MASMMASMMASMMASM

IDEsIDEsIDEsIDEs• RadASM• WinAsm Studio• EasyCode• Visual Studio

DebuggersDebuggersDebuggersDebuggers• OllyDbg

DisassemblersDisassemblersDisassemblersDisassemblers• IDAPro the Interactive Disassembler

AssemblersAssemblersAssemblersAssemblers compatiblecompatiblecompatiblecompatible withwithwithwith MASMMASMMASMMASMSome other assemblers can assemble most code written for MASM, with theexception of more complex macros.� Turbo Assembler(TASM) developed by Borland, later owned by Embarcadero,

last updated in 2002 and supplied with Delphi and C++Builder for several years,later discontinued.

� JWASMMacro Assembler, licenced under the Sybase Open Watcom EULA.� Pelle's Macro Assembler, a component of the Pelles C development environment.

Page 12: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

12

4444.... HOWHOWHOWHOWTOTOTOTOUSEUSEUSEUSEMASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE

StepStepStepStep 1:1:1:1: Write a program in NotepadStepStepStepStep 2:2:2:2: Save program as .asm. e.g. There is a program of addition, First write in

Notepad then click on save as and save the program as addition.asm.StepStepStepStep 3:3:3:3: Run the MASM file. Means double click on the MASM file, It will open

a window. Then type FILE NAME.asm (addition.asm)<CR><CR><CR><CR>

StepStepStepStep 4:4:4:4: It will create OBJECT File automatically. ( Means addition.obj )StepStepStepStep 5:5:5:5: Run the LINK File. Means double click on the LINK file, It will open a

window. Then type FILE NAME.obj (addition.obj)<CR><CR><CR><CR>

StepStepStepStep 6:6:6:6: It will create EXE File automatically. ( Means addition.exe )StepStepStepStep 7:7:7:7: Open DOS promptStepStepStepStep 8:8:8:8: Type folder link

Means cd masm, it will show C:\ masm>StepStepStepStep 9:9:9:9: Type debug FILE NAME.exe <CR> ( means debug addition.exe <CR> )StepStepStepStep 10:10:10:10: _ will come on screen. Type G (GO COMMAND ) for executionStepStepStepStep 11:11:11:11: The result of program will come on screen.StepStepStepStep 12:12:12:12: Type q for quit from command prompt

Page 13: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

13

5.5.5.5. SOMESOMESOMESOME BASICBASICBASICBASIC COMMANDSCOMMANDSCOMMANDSCOMMANDS

ASSEMBLE A [ADDRESS]COMPARE C RANGE ADDRESSDUMP D [RANGE]ENTER E ADDRESS [LIST]FILL F RANGE LISTGO G [=ADDRESS] [ADDRESSES]HEX H VALUE 1 VALUE 2INPUT I PORTLOAD L [ADDRESS] [DRIVE] [FIRSTSECTOR] [NUMBER]MOVE M RANGE ADDRESSNAME N [PATHNAME] [ARGLIST]OUTPUT O PORT TYPEPROCEED P [=ADDRESS] [NUMBER]QUIT QREGISTER R [REGISTER]SEARCH S RANGE LISTTRACE T [=ADDRESS] [VALUE]UNASSEMBLE U [RANGE]WRITE W [ADDRESS] [DRIVE] [FIRSTSECTOR] [NUMBER]

Page 14: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

14

6(i)6(i)6(i)6(i).... AimAimAimAim:::: ToToToTo performperformperformperform (i)(i)(i)(i) additionadditionadditionaddition andandandand (ii)(ii)(ii)(ii) subtractionsubtractionsubtractionsubtraction ofofofof twotwotwotwo 8888 bitbitbitbit numbersnumbersnumbersnumbers usingusingusingusing8088088088086666 microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTNUM DW 00hDATA ENDS

CODE SEGMENTASSUME DS:DATA, CS:CODE

START: MOV AX,DATAMOV DS,AXMOV AX, 10HADD AX, 10HMOV NUM, AXINT 03HCODE ENDSEND STARTEND

Page 15: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

15

6(ii)6(ii)6(ii)6(ii).... AimAimAimAim:::: ToToToTo performperformperformperform (i)(i)(i)(i) additionadditionadditionaddition andandandand (ii)(ii)(ii)(ii) subtractionsubtractionsubtractionsubtraction ofofofof twotwotwotwo 8888 bitbitbitbit numbersnumbersnumbersnumbers usingusingusingusing8088088088086666 microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTNUM DW 00hDATA ENDS

CODE SEGMENTASSUME DS:DATA, CS:CODE

START: MOV AX,DATAMOV DS,AXMOV AX, 33HSUB AX, 11HMOV NUM, AXINT 03HCODE ENDSEND STARTEND

Page 16: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

16

7(i)7(i)7(i)7(i).... AimAimAimAim:::: ToToToTo performperformperformperform (i)(i)(i)(i) additionadditionadditionaddition andandandand (ii)(ii)(ii)(ii) subtractionsubtractionsubtractionsubtraction ofofofof twotwotwotwo 16161616 bitbitbitbit numbersnumbersnumbersnumbersusingusingusingusing 8088088088086666 microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTNUM1 DW 1111HNUM2 DW 2222HRESULT DW 00DATA ENDS

CODE SEGMENTASSUME CS: CODE, DS: DATA

START:MOV AX, DATAMOV DS, AXMOV AX, 00HMOV AX, NUM1ADD AX, NUM2

MOV RESULT, AXINT 03HCODE ENDSEND STARTEND

Page 17: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

17

7(ii)7(ii)7(ii)7(ii).... AimAimAimAim:::: ToToToTo performperformperformperform (i)(i)(i)(i) additionadditionadditionaddition andandandand (ii)(ii)(ii)(ii) subtractionsubtractionsubtractionsubtraction ofofofof twotwotwotwo 16161616 bitbitbitbitssss numbersnumbersnumbersnumbersusingusingusingusing 8085808580858085 microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTNUM1 DW 5555HNUM2 DW 2222HRESULT DW 00DATA ENDS

CODE SEGMENTASSUME CS: CODE, DS: DATA

START:MOV AX, DATAMOV DS, AXMOV AX, 00HMOV AX, NUM1SUB AX, NUM2MOV RESULT, AXINT 03HCODE ENDSEND STARTEND

Page 18: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

18

8888.... AimAimAimAim:::: ToToToTo performperformperformperform multiplicationmultiplicationmultiplicationmultiplication ofofofof twotwotwotwo 8888ssss bitbitbitbit numbersnumbersnumbersnumbers usingusingusingusing 8088088088086666microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

MAIN SEGMENTNUM1 DB 02NUM2 DB 05REST1 DB 00REST2 DB 00MAIN ENDS

MAT SEGMENTSTART: MOV AX, MAINMOV DS, AXMOV AX, 00MOV AL, NUM1MOV BL, NUM2MUL BLMOV REST1, ALMOV RSET2, AHINT 03HMAT ENDSEND STARTEND

Page 19: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

19

9.9.9.9. AimAimAimAim:::: ToToToTo performperformperformperform multiplicationmultiplicationmultiplicationmultiplication ofofofof twotwotwotwo 16161616 bitbitbitbitssss numbersnumbersnumbersnumbers usingusingusingusing 8088088088086666microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTDATA1 DW 3333H

DATA2 DW 2222HPROD DW 00

DATA ENDSCODE SEGMENT

ASSUME CS:CODE,DS:DATASTART:

MOV AX,DATAMOV DS,AXMOV AX,DATA1

MUL DATA2MOV PROD,AXMOV PROD+2,DXINT 03HCODE ENDSEND STARTEND

Page 20: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

20

10.10.10.10. AimAimAimAim:::: ToToToTo performperformperformperform divisiondivisiondivisiondivision ofofofof 16161616 bitsbitsbitsbits numbernumbernumbernumber bybybyby 8888 bitbitbitbitssss numbersnumbersnumbersnumbers usingusingusingusing 8088088088086666microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTNUM1 DW 0048HNUM2 DB 08HQUO DB 01H DUP(?)REM DB 01H DUP(?)

DATA ENDSCODE SEGMENT

START: MOV AX, DATAMOV DS, AXMOV AH, 00HMOV AL, NUM1DIV NUM2MOV QUO, ALMOV REM, AHINT 03HCODE ENDSEND START

END

Page 21: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

21

11.11.11.11. AimAimAimAim:::: ToToToTo performperformperformperform divisiondivisiondivisiondivision ofofofof 16161616 bitbitbitbitssss numbernumbernumbernumber bybybyby 16161616 bitsbitsbitsbits numbernumbernumbernumber usingusingusingusing 8088088088086666microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTNUM1 DW 4848HNUM2 DW 1111H

QUO DW 01H DUP(?)REM DW 01H DUP(?)DATA ENDS

CODE SEGMENTSTART: MOV AX, DATAMOV DS, AXMOV AX, NUM1DIV NUM2MOV QUO, AXMOV REM, DXINT 03HCODE ENDSEND STARTEND

Page 22: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

22

12.12.12.12. AimAimAimAim:::: WriteWriteWriteWrite anananan ALPALPALPALP totototo findfindfindfind thethethethe factorialfactorialfactorialfactorial ofofofof aaaa givengivengivengiven numbernumbernumbernumber usingusingusingusing 8088088088086666microprocessormicroprocessormicroprocessormicroprocessor andandandand getgetgetget thethethethe resultresultresultresult inininin hexadecimal.hexadecimal.hexadecimal.hexadecimal.ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTNUMBER DW 0005FACT DW ?

DATA ENDSSTACK_SEG SEGMENT STACK

DW 40 DUP (0)STACK_TOP LABEL WORDSTACK_SEG ENDS

CODE SEGMENTSTART:

MOV AX, DATAMOV DS, AXMOV AX, STACK_SEGMOV SS, AXMOV SP, OFFSET STACK_TOPMOV CX, NUMBERMOV BX, 01

NEXT: MOV AX, CXCMP AX, 0HJE FINISHMUL BXMOV BX, AXLOOP NEXT

FINISH: MOV FACT, BXINT 03HCODE ENDS

END STARTEND

Page 23: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

23

Page 24: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

24

13.13.13.13. AimAimAimAim:::: WriteWriteWriteWrite anananan ALPALPALPALP totototo findfindfindfind thethethethe numbernumbernumbernumber ofofofof characterscharacterscharacterscharacters inininin aaaa givengivengivengiven stringstringstringstring usingusingusingusing8088088088086666 microprocessormicroprocessormicroprocessormicroprocessor....ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTDATA1 DB 'BaLKRISHNaPRaVEEN$'ALPHABET DB ?

DATA ENDS

CODE SEGMENTSTART: MOV AX, DATA

MOV DS, AXMOV ALPHABET, 0MOV DH, 0MOV AH, 0MOV BX, OFFSET DATA1MOV CX, 21

NEXT: MOV AL, [BX]CMP AL, 61HJNE APHAMOV AL, ALPHABETADD AL, 01DAAMOV ALPHABET, AL

APHA: INC BXLOOP NEXTMOV AL, ALPHABETINT 03HCODE ENDSEND STARTEND

Page 25: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

25

Page 26: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

26

14.14.14.14. AimAimAimAim:::: WriteWriteWriteWrite anananan ALPALPALPALP totototo arrangearrangearrangearrange anananan arrayarrayarrayarray ofofofof DataDataDataData inininin ascending/descendingascending/descendingascending/descendingascending/descendingorderorderorderorder usingusingusingusing 8088088088086666 microprocessormicroprocessormicroprocessormicroprocessor........ApparatusApparatusApparatusApparatus UsedUsedUsedUsed:::: MASMMASMMASMMASM SOFTWARESOFTWARESOFTWARESOFTWARE....Program:Program:Program:Program:

DATA SEGMENTDATA1 DB 20H,28H,15H,26H,19H,27H,16H,29HTEMP DB ?

DATA ENDS

STACK_SEG SEGMENT STACKDW 40 DUP (0)STACK_TOP LABEL WORD

STACK_SEG ENDS

CODE SEGMENTASSUME CS:CODE, DS:DATA, SS:STACK_SEG

START: MOV AX, DATAMOV DS, AX

MOV AX, STACK_SEGMOV SS, AXMOV SP, OFFSET STACK_TOPMOV CX, 07

LOOP1: MOV BX, CXMOV SI, 0000

LOOP2: MOV AL, DATA1[SI]CMP AL, DATA1[SI+1]JGE INCREMMOV AH, DATA1[SI+1]MOV DATA1[SI+1], ALMOV AL, AHMOV DATA1[SI], AL

INCREM: INC SIDEC BXJNZ LOOP2LOOP LOOP1

INT 03HCODE ENDSEND STARTEND

Page 27: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

27

Page 28: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

28

15.15.15.15. MicroprocessorMicroprocessorMicroprocessorMicroprocessor LabLabLabLabVivaVivaVivaViva QuestionsQuestionsQuestionsQuestions withwithwithwithAnswersAnswersAnswersAnswers

1.What1.What1.What1.What isisisis aaaa Microprocessor?Microprocessor?Microprocessor?Microprocessor?Microprocessor is a CPU fabricated on a single chip, program-controlled device,which fetches the instructions from memory, decodes and executes the instructions.

2.2.2.2.WhatWhatWhatWhat isisisis InstructionInstructionInstructionInstruction Set?Set?Set?Set?It is the set of the instructions that the Microprocessor can execute.

3.3.3.3.WhatWhatWhatWhat isisisis BandwidthBandwidthBandwidthBandwidth ????The number of bits processed by the processor in a single instruction.

4.4.4.4.WhatWhatWhatWhat isisisis ClockClockClockClock SpeedSpeedSpeedSpeed ????Clock speed is measured in the MHz and it determines that how many instructions aprocessor can processed. The speed of the microprocessor is measured in the MHz orGHz.

5.5.5.5.WhatWhatWhatWhat areareareare thethethethe featuresfeaturesfeaturesfeatures ofofofof IntelIntelIntelIntel 8086808680868086 ????Features:� Released by Intel in 1978� Produced from 1978 to 1990s� A 16-bit microprocessor chip.� Max. CPU clock rate:5 MHz to 10 MHz� Instruction set: x86-16� Package: 40 pin DIP� 16-bit Arithmetic Logic Unit� 16-bit data bus (8088 has 8-bit data bus)� 20-bit address bus - 220 = 1,048,576 = 1 meg� The address refers to a byte in memory.� In the 8088, these bytes come in on the 8-bit data bus. In the 8086, bytes at even

addresses come in on the low half of the data bus (bits 0-7) and bytes at oddaddresses come in on the upper half of the data bus (bits 8-15).

� The 8086 can read a 16-bit word at an even address in one operation and at anodd address in two operations. The 8088 needs two operations in either case.

� The least significant byte of a word on an 8086 family microprocessor is at thelower address.

Page 29: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

29

6.6.6.6.WhatWhatWhatWhat isisisis LogicalLogicalLogicalLogical Address:?Address:?Address:?Address:?� A memory address on the 8086 consists of two numbers, usually written inhexadecimal and separated by a colon, representing the segment and the offset. Thiscombination of segment and offset is referred to as a logical address� Logical address=segment: offset

7.7.7.7.WhatWhatWhatWhat isisisis TheTheTheThe EffectiveEffectiveEffectiveEffectiveAddress:Address:Address:Address:� In general, memory accesses take the form of the following example:� Mov ax, [baseReg + indexReg + constant]� This example copies a word sized value into the register AX.� Combined, the three parameters in brackets determine what is called the effective

address, which is simply the offset referenced by the instruction

8.8.8.8.WhatWhatWhatWhat isisisis PhysicalPhysicalPhysicalPhysical Address?Address?Address?Address?Physical memory address pointed by SEGMENT:OFFSET pair is calculated as:Physical address = (<SegmentAddr> * 10) + <OffsetAddr>

9.What9.What9.What9.What areareareare thethethethe flagsflagsflagsflags inininin 8086?8086?8086?8086?In 8086 Carry flag, Parity flag, Auxiliary carry flag, Zero flag, Overflow flag, Traceflag, Interrupt flag, Direction flag, and Sign flag.

10.Why10.Why10.Why10.Why crystalcrystalcrystalcrystal isisisis aaaa preferredpreferredpreferredpreferred clockclockclockclock source?source?source?source?Because of high stability, large Q (Quality Factor) & the frequency that doesn’t driftwith aging. Crystal is used as a clock source most of the times.

11.What11.What11.What11.What isisisis Tri-stateTri-stateTri-stateTri-state logic?logic?logic?logic?Three Logic Levels are used and they are High, Low, High impedance state. The highand low are normal logic levels & high impedance state is electrical open circuitconditions. Tri-state logic has a third line called enable line.

12.What12.What12.What12.What happenshappenshappenshappens whenwhenwhenwhen HLTHLTHLTHLT instructioninstructioninstructioninstruction isisisis executedexecutedexecutedexecuted inininin processor?processor?processor?processor?The Micro Processor enters into Halt-State and the buses are tri-stated.

13.What13.What13.What13.What isisisis ProgramProgramProgramProgram counter?counter?counter?counter?Program counter holds the address of either the first byte of the next instruction to befetched for execution or the address of the next byte of a multi byte instruction, whichhas not been completely fetched. In both the cases it gets incremented automaticallyone by one as the instruction bytes get fetched. Also Program register keeps theaddress of the next instruction.

14.What14.What14.What14.What isisisis 1st1st1st1st //// 2nd2nd2nd2nd //// 3rd3rd3rd3rd //// 4th4th4th4th generationgenerationgenerationgeneration processor?processor?processor?processor?The processor made of PMOS / NMOS / HMOS / HCMOS technology is called 1st /2nd / 3rd / 4th generation processor, and it is made up of 4 / 8 / 16 / 32 bits.

Page 30: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

30

15.Name15.Name15.Name15.Name thethethethe processorprocessorprocessorprocessor lineslineslineslines ofofofof twotwotwotwo majormajormajormajor manufacturers?manufacturers?manufacturers?manufacturers?High-end: Intel - Pentium (II, III, 4), AMD - Athlon. Low-end: Intel - Celeron, AMD -Duron. 64-bit: Intel - Itanium 2, AMD - Opteron.

16.How16.How16.How16.Howmanymanymanymany bitbitbitbit combinationscombinationscombinationscombinations areareareare theretheretherethere inininin aaaa byte?byte?byte?byte?Byte contains 8 combinations of bits.

17.Have17.Have17.Have17.Have youyouyouyou studiedstudiedstudiedstudied buses?buses?buses?buses? WhatWhatWhatWhat types?types?types?types?There are three types of buses.AddressAddressAddressAddress bus:bus:bus:bus: This is used to carry the Address to the memory to fetch eitherInstruction or Data.DataDataDataData busbusbusbus :::: This is used to carry the Data from the memory.ControlControlControlControl busbusbusbus :::: This is used to carry the Control signals like RD/WR, Select etc.

18.What18.What18.What18.What isisisis thethethetheMaximumMaximumMaximumMaximum clockclockclockclock frequencyfrequencyfrequencyfrequency inininin 8086?8086?8086?8086?5 MHz is the Maximum clock frequency in 8086.

19.What19.What19.What19.What isisisis meantmeantmeantmeant bybybybyMaskableMaskableMaskableMaskable interrupts?interrupts?interrupts?interrupts?An interrupt that can be turned off by the programmer is known as Maskableinterrupt.

20.What20.What20.What20.What isisisis Non-MaskableNon-MaskableNon-MaskableNon-Maskable interrupts?interrupts?interrupts?interrupts?An interrupt which can be never be turned off (ie. disabled) is known asNon-Maskable interrupt

21.What21.What21.What21.What areareareare thethethethe differentdifferentdifferentdifferent functionalfunctionalfunctionalfunctional unitsunitsunitsunits inininin 8086?8086?8086?8086?Bus Interface Unit and Execution unit, are the two different functional units in 8086.

22.What22.What22.What22.What areareareare thethethethe variousvariousvariousvarious segmentsegmentsegmentsegment registersregistersregistersregisters inininin 8086?8086?8086?8086?Code, Data, Stack, Extra Segment registers in 8086.

23.What23.What23.What23.What doesdoesdoesdoes EUEUEUEU do?do?do?do?Execution Unit receives program instruction codes and data from BIU, executes theseinstructions and store the result in general registers.

24.Which24.Which24.Which24.Which StackStackStackStack isisisis usedusedusedused inininin 8086?8086?8086?8086? kkkk isisisis usedusedusedused inininin 8086?8086?8086?8086?FIFO (First In First Out) stack is used in 8086.In this type of Stack the first storedinformation is retrieved first.

25.What25.What25.What25.What areareareare thethethethe flagsflagsflagsflags inininin 8086?8086?8086?8086?In 8086 Carry flag, Parity flag, Auxiliary carry flag, Zero flag, Overflow flag, Traceflag, Interrupt flag, Direction flag, and Sign flag.

Page 31: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

31

26.What26.What26.What26.What isisisis SIMSIMSIMSIM andandandand RIMRIMRIMRIM instructions?instructions?instructions?instructions?SIM is Set Interrupt Mask. Used to mask the hardware interrupts.RIM is Read Interrupt Mask. Used to check whether the interrupt is Masked or not.

27.What27.What27.What27.What areareareare thethethethe differentdifferentdifferentdifferent typestypestypestypes ofofofofAddressingAddressingAddressingAddressingModes?Modes?Modes?Modes?A:- There are 12 different types of Addressing Modes.They are:-1. Immediate:-The Immediate data is a part of instruction, and appears in the form

of successive bytes.2. Direct:-A 16-bit memory address(offset) is directly specified in the instruction as

a part of it.3. Register:-Data is stored in a register and it is referred using the particular register

(except IP).4. Register Indirect:-The address of the memory location which contains data or

operand is determined in an indirect way.5. Indexed:-offset of the operand is stored in one of the index registers.6. Register Relative:-The data is available at an effective address formed by adding

an 8-bit or 16-bit displacement with the content of any one of the registersBX,BP,SI and DI in the default (either DS or ES) segment.

7. Based Indexed:-The effective address of the data is formed,in this addressingmode,by adding content of a base register to the content of an index register.

8. Relative Based Indexed:- The effective address is formed by adding an 8 or 16-bitdisplacement with the sum of contents of any one of the base registers and anyone of the index registers,in the default segment.

9. Intrasegment Direct Mode:-In this mode,the address to which the control is to bvetransferred lies in the segment in which the control transfer instruction lies andappears directly in the instruction as an immediate displacement value.

10. Intrasegment Indirect Mode:-In this mode,the displacement to which the controlis to be transferred,is in the same segment in which the control transferinstruction lies,but it is passed to the instruction indirectly.

11. Intersegment Direct:-In this mode,the address to which the control is to betransferred is in a different segment.

12. Intersegment Indirect:-In this mode,the address to which the control is to betransferred lies in a different segment and it is passed to the instruction indirectlysequentially.

28.What28.What28.What28.What areareareare thethethethe GeneralGeneralGeneralGeneral DataDataDataData RegistersRegistersRegistersRegisters &&&& theirtheirtheirtheir uses?uses?uses?uses?A:- The Registers AX,BX,CX,DX are the general Purpose 16-bit registers.AX registeras 16-bit accumulator.BX register is used as an offset Storage.CX register is used asdefault or implied counter.Dx register is used as an implicit operand or destination incase of a few instructions.

29.What29.What29.What29.What areareareare SegmentSegmentSegmentSegment RegistersRegistersRegistersRegisters &&&& theirtheirtheirtheir uses?uses?uses?uses?A:-There are 4 Segment Registers Code Segment(CS),Data Segment(DS),ExtraSegment(ES) & Stack Segment(SS) registers.CS is used for addressing memory

Page 32: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

32

location in code.DS is used to points the data.ES refers to a segment which isessentially in another data segment.SS is used fopr addressing stack segment ofmemory.

30.What30.What30.What30.What areareareare FlagFlagFlagFlag registers?registers?registers?registers?A:-Divided into 2 parts:-Condition code or status flags and machine control flags.S-Sign Flag:-Is to set when the result of any computation is negative.Z-Zero Flag:-Is to set if the result of the computation or comparison performed by theprevious instruction is zero.C-Carry Flag:-Is set when there is carry out of MSB in case of addition or a borrow incase of subtraction.T-Trap Flag:-Is set,the processor enters the single step execution mode.I-Interrupt Flag:-Is set,the maskable interrupts are recognised by the CPU.D-Direction Flag:-Is set for auto incrementing or auto decrementing mode in stringmanipulation instructions.AC-Auxiliary Carry Flag:-Is set if there is a carry from the lowest nibble duringaddition or borrow for the lowest nibble.O-Overflow Flag:-Is set if the result of a signed operation is large enough to beaccommodated in a destination register.

31.What31.What31.What31.What doesdoesdoesdoes thethethethe 8086808680868086ArchitectureArchitectureArchitectureArchitecture contain?contain?contain?contain?A:-The complete architecture of 8086 can be divided into 2types :-Bus InterfaceUnit(BIU) & Execution Unit.The BIU contains the circuit for physical address calculations and a precodinginstruction byte queue & it makes the bus signals available for external interfacing ofthe devices.The EU contains the register set of 8086 except segment registers and IP.It has a16-bit ALU,able to perform arithmetic and Logic operations.

32)32)32)32)WhatWhatWhatWhat areareareare DataDataDataData Copy/TransferCopy/TransferCopy/TransferCopy/Transfer Instructions?Instructions?Instructions?Instructions?A:- Mov

PushPopXchgInOutXlatLeaLds/LesLahfSahfPushfPopf

Page 33: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

33

33.33.33.33.WhatWhatWhatWhat areareareare MachineMachineMachineMachine ControlControlControlControl Instructions?Instructions?Instructions?Instructions?A:- Nop

HltWaitLock

34)34)34)34)WhatWhatWhatWhat areareareare FlagFlagFlagFlag ManipulationManipulationManipulationManipulation Instructions?Instructions?Instructions?Instructions?A:- Cld

StdCliSti

35)35)35)35)WhatWhatWhatWhat areareareare StringStringStringString Instructions?Instructions?Instructions?Instructions?A:- Rep

MovSB/MovSWCmpsScasLodsStos

36)36)36)36)WhatWhatWhatWhat areareareare differentdifferentdifferentdifferent partspartspartsparts forforforfor 8086808680868086 architecture?architecture?architecture?architecture?A:- The complete architecture of 8086 can be divided into 2types :-Bus InterfaceUnit(BIU) & Execution Unit.The BIU contains the circuit for physical address calculations and a precodinginstruction byte queue & it makes the bus signals available for external interfacing ofthe devices.The EU contains the register set of 8086 except segment registers and IP.It has a16-bit ALU,able to perform arithmetic and Logic operations.

37.What37.What37.What37.What isisisis anananan InterruptsInterruptsInterruptsInterruptsDef:- An interrupt operation suspends execution of a program so that the system cantake special action.The interrupt routine executes and normally returns control to theinterrupted procedure, which then resumes execution.BIOS handles Int 00H-1FH,whereas DOS handles INT 20H-3FH.

38.38.38.38.WhatWhatWhatWhat isisisis anananan Opcode?Opcode?Opcode?Opcode?A:-The part of the instruction that specifies the operation to be performed is called theOperation code or Op code.

39.What39.What39.What39.What isisisis anananan Operand?Operand?Operand?Operand?A:-The data on which the operation is to be performed is called as an Operand.

40.Explain40.Explain40.Explain40.Explain thethethethe differencedifferencedifferencedifference betweenbetweenbetweenbetween aaaa JMPJMPJMPJMPandandandand CALLCALLCALLCALL instruction?instruction?instruction?instruction?A:-A JMP instruction permantely changes the program counter.

Page 34: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

34

A CALL instruction leaves information on the stack so that the original programexecution sequence can be resumed.

41.What41.What41.What41.What isisisis meantmeantmeantmeant bybybyby Polling?Polling?Polling?Polling?A:- Polling or device Polling is a process which idenfies the device that hasinterrupted the microprocessor.

42.What42.What42.What42.What isisisis meantmeantmeantmeant bybybyby Interrupt?Interrupt?Interrupt?Interrupt?A:-Interrupt is an external signal that causes a microprocessor to jump to a specificsubroutine.

43.What43.What43.What43.What isisisis anananan Instruction?Instruction?Instruction?Instruction?A:-An instruction is a binary pattern enetered through an input device to command themicroprocessor to perform that specific function.

44.What44.What44.What44.What isisisis MicrocontrollerMicrocontrollerMicrocontrollerMicrocontroller andandandand Microcomputer?Microcomputer?Microcomputer?Microcomputer?A:- Microcontroller is a device that includes microprocessor:memory and I/O signallines on a single chip,fabricated using VLSI technology.Microcomputer is a computer that is designed using microprocessor as its CPU.Itincludes microprocessor,memory and I/O.

45.What45.What45.What45.What isisisis Assembler?Assembler?Assembler?Assembler?A:-The assembler translates the assembly language program text which is given asinput to the assembler to their binary equivalents known as object code.The time required to translate the assembly code to object code is called accesstime.The assembler checks for syntax errors&displays them before giving the objectcode.

46.Define46.Define46.Define46.Define Variable?Variable?Variable?Variable?A:-A Variable is an identifier that is associated with the first byte of data item.

47.Explain47.Explain47.Explain47.Explain Dup?Dup?Dup?Dup?A:-The DUP directive can be used to initialize several location & to assign values tothese locations.

48.Define48.Define48.Define48.Define Pipelining?Pipelining?Pipelining?Pipelining?A:-In 8086,to speedup the execution program,the instructions fetching and executionof instructions are overlapped each other.this is known as Pipelining.

49.What49.What49.What49.What isisisis thethethethe useuseuseuse ofofofof HLDA?HLDA?HLDA?HLDA?A:-HLDA is the acknowledgment signal for HOLD. It indicates whether the HOLDsignal is received or not.HOLD and HLDA are used as the control signals for DMA operations.

Page 35: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

35

50.50.50.50. ExplainExplainExplainExplain aboutaboutaboutabout "LEA"?"LEA"?"LEA"?"LEA"?A:-LEA(Load Effective Address) is used for initializing a register with an offsetaddress.A common use for LEA is to intialize an offset in BX, DI or SI for indexing anaddress in memory.An equivalent operation to LEA is MOV with the OFFSET operator, which generatesslightly shorter machine code.

51.51.51.51. DifferenceDifferenceDifferenceDifference betweenbetweenbetweenbetween "Shift""Shift""Shift""Shift" andandandand "Rotate"."Rotate"."Rotate"."Rotate".A:-Shift and Rotate commands are used to convert a number to another form wheresome bits are shifted or rotated.A rotate instruction is a closed loop instruction.That is,the data moved out at one endis put back in at the other end.The shift instruction loses the data that is moved out of the last bit locations.Basic difference between shift and rotate is shift command makes "fall of " bits at theend of the register.Where rotate command makes "wrap around" at the end of the register.

52.52.52.52. ExplainExplainExplainExplain aboutaboutaboutabout .MODEL.MODEL.MODEL.MODELSMALL?SMALL?SMALL?SMALL?A:- .MODEL directive:-This simplified segment directive creates default segmentsand the required ASSUME and GROUP statements.Its format is .MODEL memory-model.The following are the memory modelsTiny:-Code and data in one segment, for .COM programs.Small:-Code in one segment (<=64K), data in one segment (<=64K). It generates16-bit offset addresses.Medium:-Any number of code segments, data in one segment (<=64K).Compact:-Code in one segment (<=64K), any number of data segments. It generates32-bit addresses, which require more time for execution.Large:-Code and data both in any number of segments, no array >64K.Huge:-Code and data both in any number of segments, arrays may be >64K.Flat:-Defines one area up to 4 gigabytes for both code and data.It is unsegmented.Theprogram uses 32-bit addressing and runs under Windows in protected mode.

53.Difference53.Difference53.Difference53.Difference betweenbetweenbetweenbetween JMPJMPJMPJMPandandandand JNC?JNC?JNC?JNC?A:-JMP is Unconditional Branch.JNC is Conditional Branch.

54.List54.List54.List54.List thethethethe StringStringStringStringManipulationManipulationManipulationManipulation Commands?Commands?Commands?Commands?A:-REP=Repeat.MOVS=Move Byte/WordCMPS=Compare Byte/WordSCAS=Scan Byte/WordLODS=Load byte/Wd to AL/AXSTOS=Stor Byte/Wd from AL/A

Page 36: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

36

55.What55.What55.What55.What areareareare thethethethe 4444 Segments?Segments?Segments?Segments?A:-Code Segment Register {CS}Data Segment Register {DS}Extra Segment Register {ES}Stack Segment Register{SS}

56.What56.What56.What56.What isisisis thethethethe mainmainmainmain useuseuseuse ofofofof readyreadyreadyready pin?pin?pin?pin?A:-READY is used by the microprocessor to check whether a peripheral is ready toaccept or transfer data.A peripheral may be a LCD display or analog to digital converter or any other.These peripherals are connected to microprocessor using the READY pin.If READY is high then the periphery is ready for data transfer. If not themicroprocessor waits until READY goes high.

57.Explain57.Explain57.Explain57.Explain aboutaboutaboutabout DirectionDirectionDirectionDirection Flag?Flag?Flag?Flag?A:-This is used by string manipulation instructions.If this flag bit is 0 , the string is processed beginning from the lowest to the highestaddress,i.e.,.Autoincrement mode.Otherwise,the string is processed from the highest towards the lowestaddress,i.e.,.Autodecrementing mode.

58.What58.What58.What58.What areareareare thethethethe basicbasicbasicbasic unitsunitsunitsunits ofofofof aaaa microprocessormicroprocessormicroprocessormicroprocessor ????The basic units or blocks of a microprocessor are ALU, an array ofregisters and control unit.

59.what59.what59.what59.what isisisis SoftwareSoftwareSoftwareSoftware andandandand Hardware?Hardware?Hardware?Hardware?The Software is a set of instructions or commands needed for performing a specifictask by a programmable device or a computing machine.The Hardware refers to the components or devices used to form computing machinein which the software can be run and tested. Without software the Hardware is an idlemachine.

60.What60.What60.What60.What isisisis assemblyassemblyassemblyassembly language?language?language?language?The language in which the mnemonics (short -hand form of instructions) are used towrite a program is called assembly language. The manufacturers of microprocessorgive the mnemonics.

61.What61.What61.What61.What areareareare machinemachinemachinemachine languagelanguagelanguagelanguage andandandand assemblyassemblyassemblyassembly languagelanguagelanguagelanguage programs?programs?programs?programs?The software developed using 1's and 0's are called machine language, programs. Thesoftware developed using mnemonics are called assembly language programs.

Page 37: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

37

62.62.62.62. WhatWhatWhatWhat isisisis thethethethe drawbackdrawbackdrawbackdrawback inininin machinemachinemachinemachine languagelanguagelanguagelanguage andandandand assemblyassemblyassemblyassembly language,language,language,language,programs?programs?programs?programs?The machine language and assembly language programs are machine dependent. Theprograms developed using these languages for a particular machine cannot be directlyrun on another machine .

63.63.63.63. DefineDefineDefineDefine bit,bit,bit,bit, bytebytebytebyte andandandand word.word.word.word.A digit of the binary number or code is called bit. Also, the bit is the fundamentalstorage unit of computer memory. The 8-bit (8-digit) binary number or code is calledbyte and 16-bit binary number or code is called word. (Some microprocessormanufactures refer the basic data size operated by the processor as word).

64.64.64.64.WhatWhatWhatWhat isisisis aaaa bus?bus?bus?bus?Bus is a group of conducting lines that carries data, address and control signals.

65.65.65.65.WhyWhyWhyWhy datadatadatadata busbusbusbus isisisis bi-directional?bi-directional?bi-directional?bi-directional?The microprocessor has to fetch (read) the data from memory or input device forprocessing and after processing, it has to store (write) the data to memory or outputdevice. Hence the data bus is bi-directional.

66.66.66.66.WhyWhyWhyWhy addressaddressaddressaddress busbusbusbus isisisis unidirectional?unidirectional?unidirectional?unidirectional?The address is an identification number used by the microprocessor to identify oraccess a memory location or I / O device. It is an output signal from the processor.Hence the address bus is unidirectional.

67.67.67.67.WhatWhatWhatWhat isisisis thethethethe functionfunctionfunctionfunction ofofofof microprocessormicroprocessormicroprocessormicroprocessor inininin aaaa system?system?system?system?The microprocessor is the master in the system, which controls all the activity of thesystem. It issues address and control signals and fetches the instruction and data frommemory. Then it executes the instruction to take appropriate action.

68.68.68.68.WhatWhatWhatWhat areareareare thethethethe modesmodesmodesmodes inininin whichwhichwhichwhich 8086808680868086 cancancancan operate?operate?operate?operate?The 8086 can operate in two modes and they are minimum (or uni-processor) modeand maximum ( or multiprocessor) mode.

69.69.69.69.WhatWhatWhatWhat isisisis thethethethe datadatadatadata andandandand addressaddressaddressaddress sizesizesizesize inininin 8086?8086?8086?8086?The 8086 can operate on either 8-bit or 16-bit data. The 8086 uses 20 bit address toaccess memory and 16-bit address to access 1/0 devices.

ExplainExplainExplainExplain thethethethe functionfunctionfunctionfunction ofofofof M/IOM/IOM/IOM/IO inininin 8086.8086.8086.8086.

The signal M/IO is used to differentiate memory address and 1/0 address When theprocessor is accessing memory locations MI 10 is asserted high and when it isaccessing 1/0 mapped devices it is asserted low.

Page 38: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

38

WriteWriteWriteWrite thethethethe flagsflagsflagsflags ofofofof 8086.8086.8086.8086.The 8086 has nine flags and they are1. Carry Flag (CF) 6. Overflow Flag (OF)2. Parity Flag (PF) 7. Trace Flag (TF)3. Auxiliary carry Flag (AF) 8. Interrupt Flag (IF)4. Zero Flag (ZF) 9. Direction Flag (DF)5. Sign Flag (SF)

16.16.16.16.WhatWhatWhatWhat areareareare thethethethe interruptsinterruptsinterruptsinterrupts ofofofof 8086?8086?8086?8086?The interrupts of 8085 are INTR and NMI. The INTR is general maskable interruptand NMI is non-maskable interrupt.

17.17.17.17. HowHowHowHow clockclockclockclock signalsignalsignalsignal isisisis generatedgeneratedgeneratedgenerated inininin 8086?8086?8086?8086? WhatWhatWhatWhat isisisis thethethethe maximummaximummaximummaximum internalinternalinternalinternal clockclockclockclockfrequencyfrequencyfrequencyfrequency ofofofof 8086?8086?8086?8086?The 8086 does not have on-chip clock generation circuit. Hence the clock generatorchip, 8284 is connected to the CLK pin of8086. The clock signal supplied by 8284 isdivided by three for internal use. The maximum internal clock frequency of8086 is5MHz.

18.18.18.18.WriteWriteWriteWrite thethethethe specialspecialspecialspecial functionsfunctionsfunctionsfunctions carriedcarriedcarriedcarried bybybyby thethethethe generalgeneralgeneralgeneral purposepurposepurposepurpose registersregistersregistersregisters ofofofof 8086.8086.8086.8086.The special functions carried by the registers of 8086 are the following.Register Special function1. AX 16-bit Accumulator2. AL 8-bit Accumulator3. BX Base Register4. CX Count Register5. DX .Data Register

19.19.19.19.WhatWhatWhatWhat isisisis pipelinedpipelinedpipelinedpipelined architecture?architecture?architecture?architecture?In pipelined architecture the processor will have number of functional units and theexecution time of functional units are overlapped. Each functional unit worksindependently most of the time.

20.20.20.20.WhatWhatWhatWhat areareareare thethethethe functionalfunctionalfunctionalfunctional unitsunitsunitsunits availableavailableavailableavailable inininin 8086808680868086 architecture?architecture?architecture?architecture?The bus interface unit and execution unit are the two functional units available in8086 architecture.

21.21.21.21. ListListListList thethethethe segmentsegmentsegmentsegment registersregistersregistersregisters ofofofof 8086.8086.8086.8086.The segment registers of 8086 are Code segment, Data segment, Stack segment andExtra segment registers.

22.22.22.22. DefineDefineDefineDefine machinemachinemachinemachine cycle.cycle.cycle.cycle.Machine cycle is defined as the time required to complete one operation of accessingmemory, I/O, or acknowledging an external request. This cycle may consist of three to

Page 39: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

39

six T-states.

23.23.23.23. DefineDefineDefineDefine T-State.T-State.T-State.T-State.T-State is defined as one subdivision of the operation performed in one clock period.These subdivisions are internal states synchronized with the system clock, and eachT-State is precisely equal to one clock period.

24.24.24.24. ListListListList thethethethe componentscomponentscomponentscomponents ofofofof microprocessormicroprocessormicroprocessormicroprocessor (single(single(single(single boardboardboardboard microcomputer)microcomputer)microcomputer)microcomputer) basedbasedbasedbasedsystemsystemsystemsystemThe microprocessor based system consist of microprocessor as CPU, semiconductormemories like EPROM and RAM, input device, output device and interfacingdevices.

25.25.25.25.WhyWhyWhyWhy interfacinginterfacinginterfacinginterfacing isisisis neededneededneededneeded forforforfor 1/01/01/01/0 devices?devices?devices?devices?Generally I/O devices are slow devices. Therefore the speed of I/O devices does notmatch with the speed of microprocessor. And so an interface is provided betweensystem bus and I/O devices.

26.26.26.26.WhatWhatWhatWhat isisisis thethethethe differencedifferencedifferencedifference betweenbetweenbetweenbetween CPUCPUCPUCPU busbusbusbus andandandand systemsystemsystemsystem bus?bus?bus?bus?The CPU bus has multiplexed lines but the system bus has separate lines for eachsignal. (The multiplexed CPU lines are de-multiplexed by the CPU interface circuit toform system bus).

27..What27..What27..What27..What doesdoesdoesdoes memory-mappingmemory-mappingmemory-mappingmemory-mapping mean?mean?mean?mean?The memory mapping is the process of interfacing memories to microprocessor andallocating addresses to each memory locations.

28..What28..What28..What28..What isisisis interruptinterruptinterruptinterrupt 1/0?1/0?1/0?1/0?If the 1/0 device initiate the data transfer through interrupt then the 1/0 is calledinterrupt driven 1/0.

29.29.29.29.WhyWhyWhyWhy EPROMEPROMEPROMEPROM isisisis mappedmappedmappedmapped atatatat thethethethe beginningbeginningbeginningbeginning ofofofof memorymemorymemorymemory spacespacespacespace inininin 8085808580858085 system?system?system?system?In 8085 microprocessor, after a reset, the program counter will have OOOOH address.If the monitor program is stored from this address then after a reset, it will beexecuted automatically. The monitor program is a permanent program and stored inEPROM memory. If EPROM memory is mapped at the beginning of memory space,i.e., at OOOOH, then the monitor program will be executed automatically after areset.

31.What31.What31.What31.What isisisis DMA?DMA?DMA?DMA?The direct data transfer between I/O device and memory is called DMA.

Page 40: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

40

32.32.32.32.WhatWhatWhatWhat isisisis thethethethe needneedneedneed forforforfor Port?Port?Port?Port?The I/O devices are generally slow devices and their timing characteristics do notmatch with processor timings. Hence the I/O devices are connected to system busthrough the ports.

33.What33.What33.What33.What isisisis aaaa port?port?port?port?The port is a buffered I/O, which is used to hold the data transmitted from themicroprocessor to I/O device or vice-versa.

34.Give34.Give34.Give34.Give somesomesomesome examplesexamplesexamplesexamples ofofofof portportportport devicesdevicesdevicesdevices usedusedusedused inininin 8085808580858085 microprocessormicroprocessormicroprocessormicroprocessor basedbasedbasedbasedsystem?system?system?system?The various INTEL I/O port devices used in 8085 microprocessor based system are8212, 8155, 8156, 8255, 8355 and 8755.

35.35.35.35.WriteWriteWriteWrite aaaa shortshortshortshort notenotenotenote onononon INTELINTELINTELINTEL8255?8255?8255?8255?The INTEL 8255 is a I/O port device consisting of 3 numbers of 8 -bit parallel I/Oports. The ports can be programmed to function either as a input port or as a outputport in different operating modes. It requires 4 internal addresses and has one logicLOW chip select pin.

36.What36.What36.What36.What isisisis thethethethe drawbackdrawbackdrawbackdrawback inininin memorymemorymemorymemory mappedmappedmappedmapped I/0?I/0?I/0?I/0?When I/O devices are memory mapped, some of the addresses are allotted to I/Odevices and so the full address space cannot be used for addressing memory (i.e.,physical memory address space will be reduced). Hence memory mapping is usefulonly for small systems, where the memory requirement is less.

37.37.37.37. HowHowHowHow DMADMADMADMAisisisis initiated?initiated?initiated?initiated?When the I/O device needs a DMA transfer, it will send a DMA request signal toDMA controller. The DMA controller in turn sends a HOLD request to the processor.When the processor receives a HOLD request, it will drive its tri-stated pins to highimpedance state at the end of current instruction execution and send an acknowledgesignal to DMA controller. Now the DMA controller will perform DMA transfer.

38.38.38.38.WhatWhatWhatWhat isisisis processorprocessorprocessorprocessor cyclecyclecyclecycle (Machine(Machine(Machine(Machine cycle)?cycle)?cycle)?cycle)?The processor cycle or machine cycle is the basic operation performed by theprocessor. To execute an instruction, the processor will run one or more machinecycles in a particular order.

39.39.39.39.WhatWhatWhatWhat isisisis InstructionInstructionInstructionInstruction cycle?cycle?cycle?cycle?The sequence of operations that a processor has to carry out while executing theinstruction is called Instruction cycle. Each instruction cycle of a processor indiumconsists of a number of machine cycles.

Page 41: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

41

40.40.40.40.WhatWhatWhatWhat isisisis fetchfetchfetchfetch andandandand executeexecuteexecuteexecute cycle?cycle?cycle?cycle?In general, the instruction cycle of an instruction can be divided into fetch and executecycles. The fetch cycle is executed to fetch the opcode from memory. The executecycle is executed to decode the instruction and to perform the work instructed by theinstruction.

41.What41.What41.What41.What isisisis BlockBlockBlockBlock andandandand DemandDemandDemandDemand transfertransfertransfertransfer modemodemodemode DMA?DMA?DMA?DMA?In Block transfer mode, the DMA controller will transfer a block of data and relievethe bus for processor. After sometime another block of data is transferred by DMAand so on. In Demand transfer mode the DMA controller will complete the entire .datatransfer at a stretch and then relieve the bus to processor.

42.42.42.42.WhatWhatWhatWhat isisisis thethethethe needneedneedneed forforforfor timingtimingtimingtiming diagram?diagram?diagram?diagram?The timing diagram provides information regarding the status of various signals,when a machine cycle is executed. The knowledge of timing diagram is essential forsystem designer to select matched peripheral devices like memories, latches, ports,etc., to form a microprocessor system.

43.43.43.43. HowHowHowHow manymanymanymany machinemachinemachinemachine cyclescyclescyclescycles constituteconstituteconstituteconstitute oneoneoneone instructioninstructioninstructioninstruction cyclecyclecyclecycle inininin 8085?8085?8085?8085?Each instruction of the 8085 processor consists of one to five machine cycles.

44.44.44.44. DefineDefineDefineDefine opcodeopcodeopcodeopcode andandandand operand.operand.operand.operand.Opcode (Operation code) is the part of an instruction / directive that identifies aspecific operation.Operand is a part of an instruction / directive that represents a value on which theinstruction acts.

45.45.45.45.WhatWhatWhatWhat isisisis opcodeopcodeopcodeopcode fetchfetchfetchfetch cycle?cycle?cycle?cycle?The opcode fetch cycle is a machine cycle executed to fetch the opcode of aninstruction stored in memory. Every instruction starts with opcode fetch machinecycle.

46.46.46.46. WhatWhatWhatWhat operationoperationoperationoperation isisisis performedperformedperformedperformed duringduringduringduring firstfirstfirstfirst TTTT -state-state-state-state ofofofof everyeveryeveryevery machinemachinemachinemachine cyclecyclecyclecycle inininin8085808580858085 ????In 8085, during the first T -state of every machine cycle the low byte address islatched into an external latch using ALE signal.

47.47.47.47.WhyWhyWhyWhy statusstatusstatusstatus signalssignalssignalssignals areareareare providedprovidedprovidedprovided inininin microprocessor?microprocessor?microprocessor?microprocessor?The status signals can be used by the system designer to track the internal operationsof the processor. Also, it can be used for memory expansion (by providing separatememory banks for program & data and selecting the bank using status signals).

Page 42: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

42

48.48.48.48. HowHowHowHow thethethethe 8085808580858085 processorprocessorprocessorprocessor differentiatesdifferentiatesdifferentiatesdifferentiates aaaa memorymemorymemorymemory accessaccessaccessaccess (read/write)(read/write)(read/write)(read/write) andandandand 1/01/01/01/0accessaccessaccessaccess (read/write)?(read/write)?(read/write)?(read/write)?The memory access and 1/0 access is differentiated using 10 I M signal. The 8085processor asserts 10 I M low for memory read/write operation and 10 I M is assertedhigh for 1/0 read/write operation.

49.49.49.49.WhenWhenWhenWhen thethethethe 8085808580858085 processorprocessorprocessorprocessor checkscheckscheckschecks forforforfor anananan interrupt?interrupt?interrupt?interrupt?In the second T -state of the last machine cycle of every instruction, the 8085processor checks whether an interrupt request is made or not.

50.50.50.50.WhatWhatWhatWhat isisisis interruptinterruptinterruptinterrupt acknowledgeacknowledgeacknowledgeacknowledge cycle?cycle?cycle?cycle?The interrupt acknowledge cycle is a machine cycle executed by 8085 processor toget the address of the interrupt service routine in-order to service the interrupt device.

51.51.51.51. HowHowHowHow thethethethe interruptsinterruptsinterruptsinterrupts areareareare affectedaffectedaffectedaffected bybybyby systemsystemsystemsystem reset?reset?reset?reset?Whenever the processor or system is resetted , all the interrupts except TRAP aredisabled. fu order to enable the interrupts, El instruction has to be executed after areset.

52.52.52.52.WhatWhatWhatWhat isisisis SoftwareSoftwareSoftwareSoftware interrupts?interrupts?interrupts?interrupts?The Software interrupts are program instructions. These instructions are inserted atdesired locations in a program. While running a program, if software interruptinstruction is encountered then the processor executes an interrupt service routine.

53.53.53.53.WhatWhatWhatWhat isisisis HardwareHardwareHardwareHardware interrupt?interrupt?interrupt?interrupt?If an interrupt is initiated in a processor by an appropriate signal at the interrupt pin,then the interrupt is called Hardware interrupt.

55554.4.4.4.WhereWhereWhereWhere isisisis thethethethe READYREADYREADYREADY signalsignalsignalsignal used?used?used?used?READY is an input signal to the processor, used by the memory or I/O devices to getextra time for data transfer or to introduce wait states in the bus cycles.

55555.5.5.5.WhatWhatWhatWhat isisisis HOLDHOLDHOLDHOLD andandandand HLDAHLDAHLDAHLDAandandandand howhowhowhow itititit isisisis used?used?used?used?Hold and hold acknowledge signals are used for the Direct Memory Access (DMA)type of data transfer. The DMA controller place a high on HOLD pin in order to takecontrol of the system bus. The HOLD request is acknowledged by the 8085 by drivingall its tristated pins to high impedance state and asserting HLDA signal high.

55556.What6.What6.What6.What isisisis Polling?Polling?Polling?Polling?Polling is a scheme or an algorithm to identify the devices interrupting the processor.Polling is employed when multiple devices interrupt the processor through oneinterrupt pin of the processor.

Page 43: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

43

55557.7.7.7.WhatWhatWhatWhat areareareare thethethethe differentdifferentdifferentdifferent typestypestypestypes ofofofof Polling?Polling?Polling?Polling?The polling can be classified into software and hardware polling. In software pollingthe entire polling process is govern by a program.1n hardware polling, the hardwaretakes care of checking the status of interrupting devices and allowing one by one tothe processor.

55558.What8.What8.What8.What isisisis thethethethe needneedneedneed forforforfor interruptinterruptinterruptinterrupt controller?controller?controller?controller?The interrupt controller is employed to expand the interrupt inputs. It can handle theinterrupt request from various devices and allow one by one to the processor.

55559.9.9.9. ListListListList somesomesomesome ofofofof thethethethe featuresfeaturesfeaturesfeatures ofofofof INTELINTELINTELINTEL 8259825982598259 (Programmable(Programmable(Programmable(Programmable InterruptInterruptInterruptInterruptController)Controller)Controller)Controller)1. It manage eight interrupt request2. The interrupt vector addresses are programmable.3. The priorities of interrupts are programmable.4. The interrupt can be masked or unmasked individually.

66660.0.0.0.WhatWhatWhatWhat isisisis aaaa programmableprogrammableprogrammableprogrammable peripheralperipheralperipheralperipheral devicedevicedevicedevice ????If the functions performed by a peripheral device can be altered or changed by aprogram instruction then the peripheral device is called programmable device.Usually the programmable devices will have control registers. The device can beprogrammed by sending control word in the prescribed format to the control register.

66661.1.1.1.WhatWhatWhatWhat isisisis synchronoussynchronoussynchronoussynchronous datadatadatadata transfertransfertransfertransfer scheme?scheme?scheme?scheme?For synchronous data transfer scheme, the processor does not check the readiness ofthe device after a command have been issued for read/write operation. for this schemethe processor will request the device to get ready and then read/W1.it to the deviceimmediately after the request. In some synchronous schemes a small delay is allowedafter the request.

66662.2.2.2.WhatWhatWhatWhat isisisis asynchronousasynchronousasynchronousasynchronous datadatadatadata transfertransfertransfertransfer scheme?scheme?scheme?scheme?In asynchronous data transfer scheme, first the processor sends a request to the devicefor read/write operation. Then the processor keeps on polling the status of the device.Once the device is ready, the processor execute a data transfer instruction to completethe process.

66663.3.3.3.WhatWhatWhatWhat areareareare thethethethe operatingoperatingoperatingoperating modesmodesmodesmodes ofofofof 8212?8212?8212?8212?The 8212 can be hardwired to work either as a latch or tri-state buffer. If mode (MD)pin is tied HIGH then it will work as a latch and so it can be used as output port. Ifmode (MD) pin is tied LOW then it work as tri- state buffer and so it can be used asinput port.

Page 44: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

44

66664.4.4.4. ExplainExplainExplainExplain thethethethe workingworkingworkingworking ofofofof aaaa handshakehandshakehandshakehandshake outputoutputoutputoutput portportportportIn handshake output operation, the processor will load a data to port. When the portreceives the data, it will inform the output device to collect the data. Once the outputdevice accepts the data, the port will inform the processor that it is empty. Now theprocessor can load another data to port and the above process is repeated.

66665.What5.What5.What5.What areareareare thethethethe internalinternalinternalinternal devicesdevicesdevicesdevices ofofofof 8255825582558255 ????The internal devices of 8255 are port-A, port-B and port-C. The ports can beprogrammed for either input or output function in different operating modes.

66666.6.6.6.WhatWhatWhatWhat isisisis baudbaudbaudbaud rate?rate?rate?rate?The baud rate is the rate at which the serial data are transmitted. Baud rate is definedas l /(The time for a bit cell). In some systems one bit cell has one data bit, then thebaud rate and bits/sec are same.

66667.7.7.7.WhatWhatWhatWhat isisisis USART?USART?USART?USART?The device which can be programmed to perform Synchronous or Asynchronousserial communication is called USART (Universal Synchronous AsynchronousReceiver Transmitter). The INTEL 8251A is an example of USART.

66668.8.8.8.WhatWhatWhatWhat areareareare thethethethe functionsfunctionsfunctionsfunctions performedperformedperformedperformed bybybyby INTELINTELINTELINTEL 8251A?8251A?8251A?8251A?The INTEL 825lA is used for converting parallel data to serial or vice versa. The datatransmission or reception can be either asynchronously or synchronously. The 8251Acan be used to interface MODEM and establish serial communication throughMODEM over telephone lines.

66669.9.9.9.WhatWhatWhatWhat isisisis anananan Interrupt?Interrupt?Interrupt?Interrupt?Interrupt is a signal send by an external device to the processor so as to request theprocessor to perform a particular task or work.

77770.0.0.0.WhatWhatWhatWhat areareareare thethethethe controlcontrolcontrolcontrol wordswordswordswords ofofofof 8251A8251A8251A8251A andandandand whatwhatwhatwhat areareareare itsitsitsits functionsfunctionsfunctionsfunctions ????The control words of 8251A are Mode word and Command word. The mode wordinforms 8251 about the baud rate, character length, parity and stop bits. The commandword can be send to enable the data transmission and reception.

77771.1.1.1. WhatWhatWhatWhat areareareare thethethethe informationinformationinformationinformation thatthatthatthat cancancancan bebebebe obtainedobtainedobtainedobtained fromfromfromfrom thethethethe statusstatusstatusstatus wordwordwordword ofofofof8251825182518251 ????The status word can be read by the CPU to check the readiness of the transmitter orreceiver and to check the character synchronization in synchronous reception. It alsoprovides information regarding various errors in the data received. The various errorconditions that can be checked from the status word are parity error, overrun error andframing error.

Page 45: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

45

77772.2.2.2. GiveGiveGiveGive somesomesomesome examplesexamplesexamplesexamples ofofofof inputinputinputinput devicesdevicesdevicesdevices totototo microprocessor-basedmicroprocessor-basedmicroprocessor-basedmicroprocessor-based system.system.system.system.The input devices used in the microprocessor-based system are Keyboards, DIPswitches, ADC, Floppy disc, etc.

77773.3.3.3.WhatWhatWhatWhat areareareare thethethethe taskstaskstaskstasks involvedinvolvedinvolvedinvolved inininin keyboardkeyboardkeyboardkeyboard interface?interface?interface?interface?The task involved in keyboard interfacing are sensing a key actuation, Debouncingthe key and Generating key codes (Decoding the key). These task are performedsoftware if the keyboard is interfaced through ports and they are performed byhardware if the keyboard is interfaced through 8279.

77774.4.4.4. HowHowHowHow aaaa keyboardkeyboardkeyboardkeyboard matrixmatrixmatrixmatrix isisisis formedformedformedformed inininin keyboardkeyboardkeyboardkeyboard interfaceinterfaceinterfaceinterface usingusingusingusing 8279?8279?8279?8279?The return lines, RL0 to RL7 of 8279 are used to form the columns of keyboardmatrix. In decoded scan the scan lines SL0 to SL3 of 8279 are used to form the rowsof keyboard matrix. In encoded scan mode, the output lines of external decoder areused as rows of keyboard matrix.

77775.5.5.5.WhatWhatWhatWhat isisisis scanningscanningscanningscanning inininin keyboardkeyboardkeyboardkeyboard andandandand whatwhatwhatwhat isisisis scanscanscanscan time?time?time?time?The process of sending a zero to each row of a keyboard matrix and reading thecolumns for key actuation is called scanning. The scan time is the time taken by theprocessor to scan all the rows one by one starting from first row and coming back tothe first row again.

77776.6.6.6.WhatWhatWhatWhat isisisis scanningscanningscanningscanning inininin displaydisplaydisplaydisplay andandandand whatwhatwhatwhat isisisis thethethethe scanscanscanscan time?time?time?time?In display devices, the process of sending display codes to 7 -segment LEDs todisplay the LEDs one by one is called scanning ( or multiplexed display). The scantime is the time taken to display all the 7-segment LEDs one by one, starting fromfirst LED and coming back to the first LED again.

77777.7.7.7.WhatWhatWhatWhat areareareare thethethethe internalinternalinternalinternal devicesdevicesdevicesdevices ofofofof aaaa typicaltypicaltypicaltypical DAC?DAC?DAC?DAC?The internal devices of a DAC are R/2R resistive network, an internal latch andcurrent to voltage converting amplifier.

77778.8.8.8.WhatWhatWhatWhat isisisis settlingsettlingsettlingsettling orororor conversionconversionconversionconversion timetimetimetime inininin DAC?DAC?DAC?DAC?The time taken by the DAC to convert a given digital data to corresponding analogsignal is called conversion time.

77779.9.9.9.WhatWhatWhatWhat areareareare thethethethe differentdifferentdifferentdifferent typestypestypestypes ofofofof ADC?ADC?ADC?ADC?The different types of ADC are successive approximation ADC, counter type ADCflash type ADC, integrator converters and voltage- to-frequency converters.

88880.0.0.0. DefineDefineDefineDefine stackstackstackstackStack is a sequence of RAM memory locations defined by the programmer.

Page 46: S.NO. EXPERIMENTS PAGE NO - Innovative Thinking lab manual-DTU.pdf · S.NO. EXPERIMENTS PAGE NO . 1. Architecture or Functional Block Diagram of 8086 2 2. ... Basic Commands of MASM

46

88881.1.1.1.WhatWhatWhatWhat isisisis programprogramprogramprogram counter?counter?counter?counter? HowHowHowHow isisisis itititit usefulusefulusefuluseful inininin programprogramprogramprogram execution?execution?execution?execution?The program counter keeps track of program execution. To execute a program thestarting address of the program is loaded in program counter. The PC sends out anaddress to fetch a byte of instruction from memory and increments its contentautomatically.

88882.2.2.2. HowHowHowHow thethethethe microprocessormicroprocessormicroprocessormicroprocessor isisisis synchronizedsynchronizedsynchronizedsynchronized withwithwithwith peripherals?peripherals?peripherals?peripherals?The timing and control unit synchronizes all the microprocessor operations with clockand generates control signals necessary for communication between themicroprocessor and peripherals.