Sie sind auf Seite 1von 21

MICROPROCESSOR SYSTEM-II (8086) PRACTICAL FILE

SUBMITTED BY: HIMANSHU CHOWDHARY DEPARTMENT: ELECTRONICS AND COMMUNICATION UNIVERSITY ID: 15713302809 COLLEGE/UNIVERSITY: HMRITM (G.G.S.I.P.U)

SEMESTER: SEVENTH

INDEX
Serial number
1 2

Topic
Introduction to 8086 kit and its commands
To add two binary numbers each of string eight bytes.

Date

Signature

TO FIND MAXIMUM NUMBER IN A GIVEN STRING AND STORE IT AT LOCATION 0510H

FIND MAXIMUM NUMBER IN A GIVEN STRING AND STORE IT AT LOCATION 0510H

TO SORT STRING OF BYTES IN DESCENDING ORDER

TO CALCULATE NUMBER OF BYTES IN THE STRING

7 8

TO MULTIPLY ASCII STRING OF EIGHT NUMBERS BY A SINGLE ASCII DIGIT TO CONVERT STRING OF DATA TO ITS COMPLEMENTFROM 1S AND 2S FORM AND STORE IT

TO CALCULATE THE NUMBER OF BYTES IN A STRING WHICH IS TERMINATED BY AN IDENTIFIER IN AL

10

TO DIVIDE A STRING OF UNPACKED ASCII DIGIT

LAB 1
Aim: Introduction to 8086 kit and its commands 8086 architecture:

Hardware description: 1. Cpu: 8086 is a 16 bit third generation microprocessor and is suitable for exceptionally wide spectrum of microprocessor application. The flexibility of one of the most outstanding characteristics 8086 has got 16 data lines and 20 address lines. This is done by using 74LS373 in this kit, 8086 is used in max mode. Then INTR, TEST and hold inputs of 8086 are pulled down and brought out at pcb . FRC connector the maskable interrupt is available to peripheral circuits. 2. Co-processor-8087: the 8087 coprocessor looks have been designed on 8086 and 8088 so that these types of processor can be accommodates in future.

3. I/O processor (8089): the 8086 and 8088 are designed to used with 8089 in high performance input output applications. The 8089 is conceptually resembles a microprocessor with two direct memory access channels and an instruction set specifically Tailored for i/o applications. 4. Clock generations: The clock generator circuit is an intels 8284 clock generator /driver. The circuit accepts a crystal i/p which operates at a fundamental frequency of 14745 hz. The clock generator/driver divides the frequency by three and produce 4.9 MHZ clk signal required by cpu. 5. Bus controller: the 8288 is the bus controller which decodes the status signal o/p by 8089 or a maximum mode 8086 or 8088 when these signal indicate that the processor is to run a clock cycle, the 8288 issues a bus command that identifies the bus cycle as memory read, write, i/o read or write etc. 6. Memory: M 86-02 provides 16k bytes of EPROM loaded with monitor and 16k bytes of CMOS RAM. EPROM 64bkbytes of EPROM using 27128, 128 bytes of EPROM using 27256, 256 bytes RAM -> 28kbytes of RAM using 62256. 28 pin socket and for EPROM area named as even rom and odd rom and 2 28 pin socket for RAM area named as even and odd RAM 7. 8255: The Intel 8255 (or i8255) Programmable Peripheral interface chip is a peripheral chip
originally developed for the Intel 8085 microprocessor, and as such is a member of a large array of such chips, known as the MCS-85 Family. This chip was later also used with the Intel 8086 and its descendants. It is made in DIP 40 and PLCC 44 pins encapsulated versions.

8. 8257: The Intel* 8257 is 4-channel direct memory access (DMA) controller. It is specifically designed to simplify the transfer of data at high speeds for the Intel microcomputer systems. Its primary function is to generate, upon peripheral request, sequential memory address which will allow the peripheral to read or write data directly to or from memory. Acquisition of the system bus in accomplished via the CPU's hold function. The 8257 has priority logic that resolves the peripherals requests and issues composite hold request to the CPU. It maintains the OMA cycle count for each channel and outputs control signal Jo notify the peripheral that the programmed number of OMA cycles is complete. Other output control signals simplify sectored data transfers. The 8257 represents significant savings in component count for DMA-based microcomputer systems and greatly simplifies the transfer of data athigh speed between peripherals and memories. 9. 8259: The Intel 8259 is a Programmable Interrupt Controller (PIC) designed for the Intel
8085 and Intel 8086 microprocessors. The initial part was 8259, a later A suffix version was upward compatible and usable with the 8086 or 8088 processor. The 8259 combines multiple interrupt input sources into a singleinterrupt output to the host microprocessor, extending the interrupt levels available in a system beyond the one or two levels found on the processor chip. The 8259A was the interrupt controller for the ISA bus in the original IBM PC and IBM AT. 10. Battery backup: the M86-02 provides a battery backup for use on real time ongoing onboard RAM area using 3.6 v rechargeable battery. 11. Display: it contains two lines and each line contain 20 words. This is a cursor lcd display modulator.

Commands: 1. A- assemble: this command is used to input assemble language to machine language in memory once under this command, first set the addres which is similar to command D Followed by an enter however maximum of 35 words followed for input. 2. D- display or modify the rams hexadecimal Adu are important commands in compliling the effective address or both effective address and segement base.can be used during input when the cursor is placed at the beginning key will immediately show F000 as the segement base and effective address. 3. F fill into data ram By setting the starting ending address and details an enter key will allow to enter the data to the ram once data entered, the command can proceed. Proceed to data for execution. the go command which causes machine language statement to proceed or executed. This command executes the loaded program and allow the user to specify the address at which program execution will stop. 4. I: interrupt : Three interrupt can bre set in for the program execution, the cpu will continiouslly make a single step subprogram for checking ip values when ip register has the some value at the interrupt addresses. It will enter the interrupt subprograms.enter command I.will interrupt the program. 5. M- Moving data: The command move is used to move data into memoryfrom a specified address to another address by input the starting address. A return key then used to execute the changes. 6. P-Print: This command allows the printer to print the output connect to the printer with input / output system of 8255 before turning the printer. 7. T- trace program: This command is used for program execution trace will enter the interrupt subprogram every time the program executes.N has a decimal range from 1-99with 10 as rounding of number. 8. U-Unassemble: The unassembled command decodes the value of the group memory location mnemonic and display on the displayed once entered this command input the proper design address.

LAB 2
Aim: To add two binary numbers each of string eight bytes. address 0400 0401 0404 mnemonics CLC Mov CX,8004 Mov SI,0500 Comments Clear carry flag Load counter register Load si register with starting address of first binary number Load destination index register with destination address. Load data bytes in al Address the contents(ms bytes of 0508,0509with contents of 0500+0501) INCREAMENT SI INCREMENT DI DECREMENT THE COUNETER IF NOT ZERO THEN CONTINUE ADDITION HALT PROGRAM

0407

Mov DI, 0508

040A 040C

Mov AX, [si] Add [DI], ax

1408 140F 0410 0411 0412 0413 0415

INC SI INC SI INC DI INC DI DEC CX INZ 040A HLT

RESULT:
Before execution: STRING 1 0500 H : 01 0501 H : 02 0502 H : 03 0503 H : 04 0504 H : 05 0505 H : 06 0506 H : 07 0507 H : 08 STRING 2 0508 H : 0A 0509 H : 0B 050A H : 0C 050B H : 0D 050C H : 0E 050D H : 0F 050E H : 10 050F H : 11

AFTER EXECUTION: 0508 H : 0B 0509 H : 0D 050A H : 0F 050B H : 12 050C H : 14 050D H : 06 050E H : 18 050F H : 1A

LAB 3
AIM: TO FIND MAXIMUM NUMBER IN A GIVEN STRING AND STORE IT AT LOCATION 0510H ADDRESS 0400 MNEMONICS MOV SI , 0500 COMMENTS LOAD ADDRESS REGISTER WITH STARTING ADDRESS OF STRING INITIALIZE COUNTER REGISTER INITIALIZE 8 BIT ACCUMALATOR THE FIRST DATA BYTES OF STRING WITH 00 IF BOTH BYTES MATCH THAN BRANCH TO (1) ELSE MOVE THE CONTENT OF 0500H INTO 8 BIT ACCUMULATOR POINT AT NEXT ADDRESS OF STRING DECREMENT THE COUNTER VALUE JUMP IF NOT ZERO MAX NUMBER IS AT 0510 ADDRESS HALT

0403 0406 0408 040A 040C

MOV CX, 0010 MOV AH, 00 CMP AH,[SI] IAE ,040E MOV AH,[SI]

040E 040F 0410 0412 0414

INC SI DEC CX JNZ 0408 MOV [SI], AH HLT

RESULT: BEFORE EXECUTION: 0500 H : 01 0501 H : 02 0502 H : 03 0503 H : 04 0504 H : 05 0505 H : 06 0506 H : 15 0507 H : 07 0508 H : 12 0509 H : 08 050A H : 09 050B H : 0A 050C H : 0B 050D H : 0E 050E H : 1C

050F H : 1D AFTER EXECUTION : 0510 H: 15

LAB 4
AIM: TO SORT STRING OF BYTES IN ASCENDING ORDER ADDRESS 0400 0403 0405 0406 MNEMONICS MOV SI,0500 MOV BX, [SI] DEC BX MOV CX , [SI] COMMENTS INITIALISE MEMORY LOCTION WITH O5OOH BX HAS NUMBER OF BYTES LOCATION 0500 AND 0501 H DECREMENT BY ONE ALSO CX HAS NUMBER BYTES IN LOCTION 0500 AND 0501 H DECREMENT BY ONE INITIALISE STARTING ADDRESS MOVE THE FIRST DATA BYTE INTO AL POINT AT NEXT BYTE OF STRING COMPARE THE TWO BYTES OF STRING IF TWO BYTES ARE EQUAL AND FIRST BYTE IS ABOVE SECOND BYTE THEN BRANCH TO (1) ELSE IF SECOND BYTE IS LESS THAN FRIST BYTE SWAP THE SECOND BYTE POINT AT THE NEXT LOCATION OF STRING LOOP OF STRING IS NOT ZERO AT THIS JUNCTURE FIRST SORTING IS OVER SUCH THAT FIRST NUMBER IS LOGICALLY COMPARED WITH REST OF THE NUMBERS

0408 0409 040C 040E 040F 0411

DEC CX MOV SI, 0502 MOV AL, [SI] INC SI CMP AL,[ SI] JAE 419

0413 0415

XCHNG AL, [SI] DEC SI

0416 0418 0419 041B

MOV [SI], AL INC SI DEC CX JNZ 040C

041C 041F 0420 0422 RESULT: BEFORE EXECUTION: 0500 H : 05

DEC BX MOV SI,0500 JNZ 0406 HLT

JUMP IF NOT ZERO HALT

0501 H : 00 0502 H : 20 0503 H : 25 0504 H : 28 0505 H : 15 0506 H : 07 AFTER EXECUTION: 0500 H : 00 0501 H : 05 0502 H : 07 0503 H : 15 0504 H : 20 0505 H : 25 0506 H : 28

LAB 5
AIM: TO SORT STRING OF BYTES IN DESCENDING ORDER ADDRESS 0400 0403 0405 0406 MNEMONICS MOV SI,0500 MOV BX, [SI] DEC BX MOV CX , [SI] COMMENTS INITIALISE MEMORY LOCTION WITH O5OOH BX HAS NUMBER OF BYTES LOCATION 0500 AND 0501 H DECREMENT BY ONE ALSO CX HAS NUMBER BYTES IN LOCTION 0500 AND 0501 H DECREMENT BY ONE INITIALISE STARTING ADDRESS MOVE THE FIRST DATA BYTE INTO AL POINT AT NEXT BYTE OF STRING COMPARE THE TWO BYTES OF STRING IF TWO BYTES ARE EQUAL AND FIRST BYTE IS ABOVE SECOND BYTE THEN BRANCH TO (1) ELSE IF SECOND BYTE IS LESS THAN FRIST BYTE SWAP THE SECOND BYTE POINT AT THE NEXT LOCATION OF STRING LOOP OF STRING IS NOT ZERO AT THIS JUNCTURE FIRST SORTING IS OVER SUCH THAT FIRST NUMBER IS LOGICALLY COMPARED WITH REST OF THE NUMBERS

0408 0409 040C 040E 040F 0411

DEC CX MOV SI, 0502 MOV AL, [SI] INC SI CMP AL,[ SI] JAE 419

0413 0415

XCHNG AL, [SI] DEC SI

0416 0418 0419 041B

MOV [SI], AL INC SI DEC CX JNZ 040C

041C 041F 0420 0422 RESULT: BEFORE EXECUTION: 0500 H : 05

DEC BX MOV SI,0500 JNZ 0406 HLT

JUMP IF NOT ZERO HALT

0501 H : 00 0502 H : 20 0503 H : 25 0504 H : 28 0505 H : 15 0506 H : 07 AFTER EXECUTION: 0500 H : 00 0501 H : 05 0502 H : 07 0503 H : 15 0504 H : 20 0505 H : 25 0506 H : 28

LAB 6
AIM: TO CALCULATE NUMBER OF BYTES IN THE STRING ADDRESS 0400 MNEMONICS MOV SI, 0500 COMMENTS LOAD SI REGISTER WITH STARTING ADDRESS WHERE RESULT IS TO BE STORED INITIALIZE COUNTER REGISTER LOAD DI REGISTER WITH STATING ADDRESS OF STRINGSTORE THE IDENTIFIER IN AL DATA BYTES ACCESSED BY DI REGISTER COMPARED WITH I DENTIFIER WITHOUT ALTERING EITHER OF THE CONTENTS THIS COMPARING CONTINUOS WITH THE INCREMENTING OF DI CONTENTS ONES COMLEMENT CX MOV TO LACION SI HALT

0403 0406

MOV CX, FFFF MOV DI, 0502

0409

MOV AL , 03

040B

REPNE SCASB

040D 040F 0411

NOT CX MOV [SI], CX HLT

RESULT: LET AT 0509 H =03 AND AT 0502 H =04 AFTER EXECUTION OF THE PROGRAM CX=0008 AND AT 0500 H= 08 AND AT 0501 H= 00

LAB 7
AIM: TO MULTIPLY ASCII STRING OF EIGHT NUMBERS BY A SINGLE ASCII DIGIT ADDRESS 0400 MNEMONICS MOV SI, 0500 COMMENTS LOAD SI REISTER WITH STARTING ADDRESS OF STRING LOAD DI REGISTER WITH STARTING ADDRESS OD RESULT LOCATION LOAD DL WITH THE MULTIPLIER ASCII DIGIT LOAD COUNTER REGISTER WITH THE NUMBER OF BYTES IN STRING

0403

MOV DI, 0508

0406 0408

MOV DL, 34 MOV CX, 0008

040B 040D 040F 0412 0414 0415 0417 0419 041B 041D

MOV AL, 00 MOV DI,AL AN DL , 0F MOV AL, [SI] INC SI AND AL , 0F MVL 01 AAM ADD AL,DI AAA

MS NIBBLE OF MULTIPLIER IS ZEROED FIRST ASCII NUMBER OS STRING IS AL POINT AT NEXT LOCATION IN STRING MS NIBBLE OF MULTIPLIES NO GAP AND ALSO ZEROED PERFORM THE FUNCTION AX=AL *DL PERFORM THE FUNCTION AH=AL/0A, AL REMAINDER THE CONTENT OF AL ADDED WITH 00 WHICH IS FIRST DESTINATION LOCATION POINT THE NEXT DESTINATION LOCATION CONTENTENTS OF AH IS MOVED TO NEXT LEAST LOCATION DECREMENT THE COUNTER REGISTER IF NOT ZERO CONTINUE MLTIPLY HALT

041E 0420 0421

MOV [DI], AL INC DI MOV [DI], AH

0422 0424 0426

DEC CX JNZ 2412 HLT

RESULT: BEFORE EXECUTION: 0500 H : 31 0501 H : 32 0502 H : 33 0503 H : 34 0504 H : 35 0505 H : 36 0506 H : 31 0507 H : 32 AFTER EXECUTION: 0508 H : 04 0509 H : 08 050A H : 02 050B H : 07 050C H : 01 050D H : 06 050E H : 06 050F H : 08

LAB 8
AIM: TO CONVERT STRING OF DATA TO ITS COMPLEMENTFROM 1S AND 2S FORM AND STORE IT. ADDRESS MNEMONICS COMMENTS 0400 MOV SI, 0500 INITIATING THE SI 0403 MOV BX,0600 MOVING INITIAL ADDRESS WHERE ONES COMPLEMENT WOULD BE STORED 0406 MOV DX ,0700 MOVING INITIAL ADDRESS WHERE TWOS COMPLEMENT WOULD BE STORED 0409 MOV CX,0003 SETTING COUNTER 040B MOV DI,BX TRANSFERRING ADDRESS 040C LODSB LOADING ACCUMULATOR 040D NEG AL TWOS COMPLEMENT COMMAND 040E STOSB STORING VALUE OF ACCUMULATOR 040F MOV DI,DX MOVING ADDRESS TO DI 0410 LODSB LOADING ACCUMULATOR 0411 NOT AL COMPLEMENTING AL VALUE 0412 STOSB STORING ACCUMALATOR AND INCREMENTING THE LOCATION OF DI 0413 DEC CX DECREMENTING COUNTER 0414 JNZ 0409 JUMP TO 0409 IF COUNTER IS NOT ZERO 0415 HLT HALT PROGRAM

RESULT: BEFORE EXECUTION: 0500 H = 00 0501 H=01 0502 H=03 AFTER EXECUTION: ONES COMPLEMENT: 0600 H=FF

0601 H=FE 0602 H=FC TWOS COMPLEMENT: 0700 H=00 0701 H=FF 0702 H=FD

LAB 9
AIM: TO CALCULATE THE NUMBER OF BYTES IN A STRING WHICH IS TERMINATED BY AN IDENTIFIER IN AL

ADDRESS 0400

MNEMONICS MOV SI, 0500

0403 0406

MOV CX, FFFF MOV DI, 0502

0409

MOV AL , 03

040B

REPNE SCASB

040D 040F 0411

NOT CX MOV [SI], CX HLT

COMMENTS LOAD SI REGISTER WITH STARTING ADDRESS WHERE RESULT IS TO BE STORED INITIALIZE COUNTER REGISTER LOAD DI REGISTER WITH STATING ADDRESS OF STRINGSTORE THE IDENTIFIER IN AL DATA BYTES ACCESSED BY DI REGISTER COMPARED WITH I DENTIFIER WITHOUT ALTERING EITHER OF THE CONTENTS THIS COMPARING CONTINUOS WITH THE INCREMENTING OF DI CONTENTS ONES COMLEMENT CX MOV TO LACION SI HALT

RESULT: LET AT 0509 H =03 AND AT 0502 H =04 AFTER EXECUTION OF THE PROGRAM CX=0008 AND AT 0500 H= 08 AND AT 0501 H= 00

LAB 10
AIM: TO DIVIDE A STRING OF UNPACKED ASCII DIGIT

ADDRESS 0400 0402 0405 0408 040B 040E 0410 0411 0413 0415 0417

MNEMONICS MOV DL , 36 MOV SI, 0500 MOV DI, 0508 MOV CX, 0008 AND DL, 0F XOR AH ,AH LODSB AND AL,0F AAD DIV DL STOSB

0418 041B 041C

DECX JNZ 0419 HLT

COMMENTS DL HAVING THE DIVISIO, EIGHT BIT LOAD SI WITH STARTING ADDRESS OF ASCII STRING LOADING DI WITH STARTING ADDRESS OF RESULT INITIALIZING THE COUNTER REGISTER MS NIBBLE OF DL CONTENT IS ZEROED INITIALIZE THE EIGHT BIT ACC=(00) LOAD AL WITH ADDRESS MS NIBBLE OF AL CONTENT IS ALSO ZEROED PERFORM THE FUNCTION AL=(AH*OA)+AL, AH=00 DIVIDINGPERFORM THE FUNCTION AD/DL THE CONTENTS OF AL ARE STORED AT POSITION SPECIFIED BY DI DECREMENTING CONTINUE DIVIDING IF NOT ZERO HALT

RESULT:

BEFORE EXECUTION: 0500 H : 31 0501 H : 32 0502 H : 33 0503 H : 34 0504 H : 35

0505 H : 36 0506 H : 31 0507 H : 32 AFTER EXECUTION: 0508 H : 12 0509 H : 00 050A H : 02 050B H : 00 050C H : 05 050D H : 07 050E H : 06 050F H : 00

Das könnte Ihnen auch gefallen