8085 calicut university lab manual

34
5/21/2018 8085calicutuniversitylabmanual-slidepdf.com http://slidepdf.com/reader/full/8085-calicut-university-lab-manual 1/34 Laboratory Manual AE&I Engineering Department, Govt. Engg. College Kozhikode Page 1 SECTI ON I ASSEMBLY LANGUAGE PROGRAMMING BASED ON 8085 KIT

description

prepared by government engineering college calicut

Transcript of 8085 calicut university lab manual

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 1

    SECTION I

    ASSEMBLY LANGUAGE PROGRAMMING

    BASED ON 8085 KIT

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 2

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 3

    EXPERIMENT NO.1

    FAMILIARIZATION OF 8085 TRAINER KIT

    AIM:

    To familiarize 8085 microprocessor trainer kit

    KEY BOARD DESCRIPTION:

    The m85-0x LCD kit has 101 ASCII keys and 20*2 Liquid Crystal Display to communicate

    with the outside world. As m85-0x LCD is switched on a message 8085 LCD TRAINER

    KIT m85 -0x is displayed on the LCD screen and all keys are in command mode.

    LIST OF ASCII KEYBOARD COMMANDS:

    L - List a memory block

    M Examine/modify memory

    E Enter a memory block

    R Examine/modify register

    S Single step

    G Go

    B Block move

    I Insert

    D Delete

    N Insert data

    O Delete data

    F Fill

    H Relocate

    J Memory compare

    K - String

    COMMAND DESCRIPTION:

    RESET:

    This key initializes m 85- 0x LCD kit and displays 8085 LCD TRAINER KIT m 85-0x on

    the LCD display, indicates that the system is expecting a valid command.

    8085 LCD TRAINER KIT

    M85-0x

    Note: m85-0x means m85-04 or m85-07

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 4

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 5

    LIST A MEMORY BLOCK (L):

    This command is used to examine the contents of a block of memory on pressing this key L

    is displayed on the upper left end of LCD display. One can now enter the desired address for

    examining the contents. Enter the starting address ending address and press I key which is

    shown in below example. This displays the contents of memory area in the LCD screen in 20

    columns upper half and 20 columns lower half. If we want to see the further press . To

    exit from the command mode press key

    Format:

    L (starting address), (ending address)

    EXAMINE/MODIFY MEMORY (M)

    This command is used to examine the contents of any memory location and modify the

    contents of a RAM area on pressing this key m- is displayed on the upper left of the LCD

    display. One can now enter the desired address of any location. For changing the contents,

    enter the address and press , it shows the present content of the address is displayed

    followed by a-to modify the contents of the location displayed. Type the new data and press

    press 1 key to exit from command mode.

    Format:

    M [Starting address],

    EXAMINE/MODIFY REGISTER (R):

    This command is used to examine or modify any internal register of the CPU. One wants to

    examine the contents of all registers press R display R on the upper left end of the LCD

    display. One can start from A register, another examine all the registers by pressing .

    Where-as it some specific register is to examine then the key for that register can be entered

    directly. The contents of any register can be changed. To exit from this command mode 1

    key

    Format:

    R (Register identifier)

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 6

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 7

    The Register identifier values for various CPU registers are given below.

    REGISTER IDENTIFIER REGISTER

    A Register A

    B Register B

    C Register C

    D Register D

    E Register E

    F Flag byte

    I Interrupt mask

    H Register H

    L Register L

    S Stack point MSB and LSB

    P Program Counter MSB&LSB

    GO COMMAND (G):

    This command is used to execute the program in full clock speed. On pressing this key the

    program counter contents are displayed. Enter the address of the program and press 1 key.

    The CPU will start executing the operation.

    Format:

    G (Starting address)

    Pressing the G key will display the PC content and the first byte of the instruction. To modify

    it enter the desired address and then press key. CPU start executing the program.

    ASSEMBLER AND DISASSEMBLER:

    In m 85-0x LCD kit there is an on board facility of assembler or disassemble on pressing 1

    key. M 85 -0x LCD kit comes in assembler or disassembler mode.

    A ASSEMBLER MODE

    C DISASSEMBLER MODE

    ASSEMBLER MODE

    On pressing the key A m 85 -0x LCD kit comes in to the assembler mode. As soon as the A

    key is pressed kit asks RAM address. This will be the starting address of the program to be

    entered. After entering the starting address press key. It displays the entered starting

    address in the upper line of the LCD screen. Now it waits for mnemonics to entry.

    One can enter all the valid mnemonics of 8085 and the pseudo commands. If the entered

    alphabets do not form a valid mnemonic of a pseudo command, the carriage goes to some

    line prints the address of previous line. Hence the entry of wrong mnemonics is indicated by

    giving the same line to the users.

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 8

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 9

    Entry of a space completes are field of entry and processing of that field, we mean is done

    immediately by the command. By field we mean, mnemonics as one field operands or

    operand labels as another field. On pressing A key m 85-0x LCD kit waits for the RAM

    address.

    Format:

    RAM ADR: STARTING ADDRESS

    ADDRESS: MNEMONICS

    SINGLE BYTE INSTRUCTION:

    NNNN mnemonics registered 1 or RST. NO [if needed] . If the mnemonics entered is a

    single operand the command wait for operand entry. No message is given by the common in

    this field. The users enters the required operand which is normally a register name of the two

    register when single register or RST number operand is loaded.

    DISASSEMBLER:

    C command dis assemble the program as specified by the starting address and end address.

    In this case one wants to proceed further press key. Otherwise key will exit from

    the disassembly mode on pressing C key m85-ox LCD kit comes into the disassembly

    mode.

    FORMAT:

    PROG ADR [starting address] @ [ending address]

    LIST ADR

    RESULT:

    Familiarized the 8085 microprocessor trainer kit

    *****

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 10

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 11

    EXPERIMENT NO.2

    ARITHMETIC OPERATION-I

    AIM:

    a) Write assembly language program for addition of two 8-bit numbers

    b) Write assembly language program for subtraction of two 8-bit numbers

    EQUIPMENTS REQUIRED:

    8085 Trainer Kit, Keyboard, Power Chord

    ALGORITHM:

    a) 8-bit addition

    Step 1: Read the first 8-bit number from memory location address 2500H to register A

    Step 2: Read the second 8-bit number from memory location address 2501H to register B

    Step 3: Add the two numbers

    Step 4: Write the result to memory location address 2502H

    Step 5: If carry exists, write the 01H value to memory location address 2503H

    b) 8-bit subtraction

    Step 1: Read the first 8-bit number from memory location address 2600H to register A

    Step 2: Read the second 8-bit number from memory location address 2601H to register B

    Step 3: Subtract the two numbers

    Step 4: Write the result to memory location address 2602H

    Step 5: If borrow exists, write the 01H value to memory location address 2603H

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 12

    OBSERVATION:

    a) 8-bit addition

    1. First 8-bit number: FF@2500

    Second 8-bit number:FE@2501

    Expected result: FD@2502, 01@2503

    Observed result:

    2. First 8-bit number:

    Second 8-bit number:

    Expected result:

    Observed result:

    3. First 8-bit number:

    Second 8-bit number:

    Expected result:

    Observed result:

    b) 8-bit subtraction

    1. First 8-bit number: FF@2600

    Second 8-bit number:FE@2601

    Expected result: 01@2602, 00@2603

    Observed result:

    2. First 8-bit number:

    Second 8-bit number:

    Expected result:

    Observed result:

    3. First 8-bit number:

    Second 8-bit number:

    Expected result:

    Observed result:

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 13

    PROGRAM:

    a) 8-bit addition

    Memory

    address

    Hex code Label Mnemonics Comments

    2000 3A 01 25 LDA 2501 Read the second 8-bit number

    2003 MOV B,A Save the second number in B

    register

    2004 LDA 2500 Read the first 8-bit number

    2007 ADD B Perform the addition

    2008 STA 2502 Save the result

    200B JC AHEAD Carry exist? If yes, go to AHEAD

    200E MVI A,00 Else represent 0 value for carry

    2010 STA 2503 Save no carry condition

    2013 RST 5 Stop execution

    2014 AHEAD MVI A,01 Represent carry using value 01

    2016 STA 2503 Save the carry

    2019 RST 5 Stop execution

    b) 8-bit subtraction

    AIM:

    Memory

    address

    Hex code Label Mnemonics Comments

    2100 3A 01 26 LDA 2601 Read the second 8-bit number

    2103 MOV B,A Save the second number in B

    register

    2104 LDA 2600 Read the first 8-bit number

    2107 SUB B Perform the subtraction

    2108 STA 2602 Save the result

    210B JC AHEAD Borrow exist? If yes, go to AHEAD

    210E MVI A,00 Else represent 0 value for borrow

    2110 STA 2603 Save no borrow condition

    2113 RST 5 Stop execution

    2114 AHEAD MVI A,01H Represent borrow using value 01

    2116 STA 2603 Save the carry

    2119 RST 5 Stop execution

    RESULT:

    Following programs assembled, executed using 8085 trainer kit and outputs were verified

    a) Addition of two 8-bit numbers

    b) Subtraction of two 8-bit numbers

    *****

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 14

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 15

    EXPERIMENT NO.3

    ARITHMETIC OPERATION-II

    AIM:

    a) Write assembly language program for addition of two 16-bit numbers

    b) Write assembly language program for subtraction of two 16-bit numbers

    c) Write a assembly language program for decimal addition using DAA instruction

    EQUIPMENTS REQUIRED:

    8085 Trainer Kit, Keyboard, Power Chord

    ALGORITHM:

    a) 16-bit addition

    Step 1: Load first 16-bit number in HL register pair

    Step 2: Load second 16-bit number in DE register pair

    Step 3: Add the lower bytes and store in L register

    Step 4: Add the higher byte with previous carry and store in H register

    Step 5: Store the 16-bit result in memory location 3000H

    b) 16-bit subtraction

    Step 1: Load first 16-bit number in HL register pair

    Step 2: Load second 16-bit number in DE register pair

    Step 3: subtract the lower bytes and store in L register

    Step 4: Subtract the higher byte with previous borrow and store in H register

    Step 5: Store the 16-bit result in memory location 3800H

    c) Decimal addition

    Step 1: Initialize counter with number of bytes to be added stored in memory 3500H

    Step 2: Add two bytes starting from memory 3501 through accumulator

    Step 3: Update the carry register if carry generated in step 2

    Step 4: Decrement the counter and if not zero go to step 2

    Step 5: Store the final sum result in memory 3600H and final carry in memory 3601H

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 16

    OBSERVATION:

    a) 16-bit addition

    1. First 16-bit data: 2050

    Second 16-bit data: 2030

    Expected result: 4080@2100

    Observed result:

    2. First 16-bit data:

    Second 16-bit data:

    Expected result:

    Observed result:

    b) 16-bit subtraction

    1. First 16-bit data: 2030

    Second 16-bit data: 2050

    Expected result: 0020@3800

    Observed result:

    2. First 16-bit data:

    Second 16-bit data:

    Expected result:

    Observed result:

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 17

    PROGRAM:

    a) 16-bit addition

    Memory

    address

    Hex code Label Mnemonics Comments

    2000 21 50 20 LXI H 2050 Load 2050 in HL pair

    2003 LXI D 2030 Load 2030 in DE pair

    2006 MOV A,E Move lower value from E to A

    2007 ADD L Add values in L to A

    2008 MOV L,A Move values from A to L

    2009 MOV A,D Move values from D to A

    200A ADC H Add value in H with A along with

    carry

    200B MOV H,A Move value in A to H

    200C SHLD 2100 Store value in HL pair to location

    2100H

    200F RST 5 Stop execution

    b) 16-bit subtraction

    AIM:

    Memory

    address

    Hex code Label Mnemonics Comments

    3002 21 30 20 LXI H 2030 Load 2030H in the HL pair

    3005 LXI D 2050 Load 2050H in the DE pair

    3008 MOV A,E Move value from E to A

    3009 SUB L Subtract value in L from A

    300A MOV L,A Move value from A to L

    300B MOV A,D Move value from D to A

    300C SBB H Subtract with borrow from A

    300D MOV H,A Move value from A to H

    300E SHLD 3800 Store result in HL pair to location

    3800H

    3011 RST 5 Stop execution

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 18

    c) Decimal addition

    1. No of bytes to be added: 03@3500

    First 8-bit data in 3501: 50

    Second 8-bit data in 3502: 60

    Third 8-bit data in 3503: 70

    Expected result: 80@3600, 01@3601

    Observed result:

    2. No of bytes to be added: 05@3500

    First 8-bit data in 3501:

    Second 8-bit data in 3502:

    Third 8-bit data in 3503:

    Fourth 8-bit data in 3504:

    Fifth 8-bit data in 3505:

    Expected result:

    Observed result:

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 19

    c) Decimal addition using DAA instruction

    Memory

    address

    Hex code Label Mnemonics Comments

    2300 AF XRA A Clear accumulator

    2301 MOV D,A Clear register D

    2302 LXI H 3500 Load 3500H in HL pair

    2305 MOV C,M Copy the contents from M to C

    2306 LOOP INX H Increment HL

    2307 ADD M Add A and M

    2308 DAA Decimal adjust accumulator

    2309 JNC AHEAD Jump to AHEAD if no carry

    230C INR D Increment D

    230D AHEAD DCR C Decrement counter

    230E JNZ LOOP Jump to LOOP if non zero

    2311 STA 3600 Store 3600 with content of A

    2314 MOV A,D Copy from D to A

    2315 STA 3601 Store 3601 with content of A

    2318 RST 5 Stop execution

    RESULT:

    Following programs assembled, executed using 8085 trainer kit and outputs were verified

    a) Addition of two 16-bit numbers

    b) Subtraction of two 16-bit numbers

    c) Decimal addition using DAA instruction

    *****

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 20

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 21

    EXPERIMENT NO.4

    ARITHMETIC OPERATION-III

    AIM:

    a) Write Assembly Language Program to perform 16x8 multiplication

    b) Write Assembly Language Program to perform 16x8 division

    c) Write Assembly Language Program to find the square of a 8-bit number

    EQUIPMENTS REQUIRED:

    8085 Trainer Kit, Keyboard, Power Chord

    ALGORITHM:

    a) 16x8 Multiplication

    Step 1: Read 16 bit multiplicand from memory location

    Step 2: Read 8 bit multiplier from memory location

    Step 3: Initialize count register with multiplier value

    Step 4: Add multiplicand value multiplier times to get the result

    Step 5: Carry is accumulated if exists on each addition

    Step 6: Store the final result in memory location

    b) 16x8 Division

    Step 1: Read 16 bit dividend from memory location

    Step 2: Read 8 bit divisor from memory location

    Step 3: Initialize a borrow register

    Step 4: Initialize a register pair to hold the quotient

    Step 5: Subtract divisor from dividend

    Step 6: Check for borrow, if no borrow go to step 5 else proceed to step 7

    Step 7: Quotient accumulated in register pair stored in memory location

    c) Square of a 8-bit number

    Step 1: Read 8 bit number to be squared

    Step 2: Store the number temporarily in a register

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 22

    OBSERVATION:

    a) 16X8 multiplication

    1. 16-bit multiplicand: FF@2100

    01@2101

    8-bit multiplier: 22@2102

    Expected result: DE@2103 43@2104 00@2105

    Observed result:

    2. 16-bit multiplicand:

    8-bit multiplier:

    Expected result:

    Observed result:

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 23

    Step 3: Read the same number as a counter in another register

    Step 4: Add the same number counter times and the result is stored in the accumulator

    Temporarily

    Step 5: Carry is checked to store in another register

    Step 6: 8 bit result is stored in one memory location

    Step 7: 8 bit carry result is stored in another memory location

    PROGRAM:

    a) 16X8 Multiplication

    Memory

    address

    Hex code Label Mnemonics Comments

    2000 24 00 21 LHLD 2100 Read the 16 bit multiplicand in HL register

    pair from memory location 2100H

    XCHG Save the 16 bit number in DE register

    LDA 2102 Copy multiplier into accumulator from

    2102 memory location

    MOV C,A Initialise the counter

    LXI H 0000 Load HL with zero result initially

    BACK DAD D Add content in HL with DE pair and store

    the result in HL pair

    JNC SKIP Jump to SKIP if there is no carry

    INR B Increment register B for carry

    SKIP DCR C Decrement counter

    JNZ BACK Jump to BACK if counter value is non zero

    SHLD 2103 Store 16 bit result in HL pair to memory

    location 2103

    MOV A,B Move value from B to A carry value

    STA 2104 Store carry in accumulator to memory

    location 2104

    RST 5 Stop execution

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 24

    OBSERVATION:

    b) 16X8 division

    1. 16-bit dividend: FF@3100

    : FF@3101

    8-bit divisor: FF@3102

    Expected result: 01@3103 01@3104

    Observed result:

    2. 16-bit dividend:

    8-bit divisor:

    Expected result:

    Observed result:

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 25

    b) 16X8 division

    Memory

    address

    Hex code Label Mnemonics Comments

    3000 2A 00 31 LHLD 3100 Read dividend in HL from memory

    location 3100

    LDA 3102 Read 8 bit divisor from memory

    location 3102 to A

    MOV C,A Copy value to C

    MVI B 00 Initialize Register B to store borrow

    MVI E FF Initialize DE pair for quotient

    MVI D FF

    BACK INX D Increment DE register pair

    MOV A,L Copy LSB of dividend from L to A

    SUB C Subtract value in C from A

    MOV L,A Move result from A to L

    MOV A,H Copy MSB of dividend to

    accumulator

    SBB B Borrow from LSB and subtract

    from MSB

    MOV H,A Copy result from A to H

    JNC BACK If no borrow jump to BACK

    MOV A,E Copy the value from E to A

    STA 3103 LSB of quotient is stored in

    memory location 3103

    MOV A,D Copy result from D to A

    STA 3104 MSB of quotient is stored in

    memory location 3104

    RST 5 Stop execution

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 26

    OBSERVATION:

    c) Square of a 8-bit number

    1. 8-bit number to be squared: 05@2500

    Expected result: 19@2501 00@2502

    Observed result:

    2. 8-bit number to be squared:

    Expected result:

    Observed result:

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 27

    c) Square of a 8-bit number

    Address Hex code Label Mnemonics Comments

    2300 LXI H 2500 Load HL register pair

    MOV A,M Copy the register in A

    MOV B,A Copy result from A to B

    MOV C,B Set C as a counter

    MVI A 00 A is loaded with D

    MVI D 00 D is initialised to store carry

    BACK ADD B Add content in B with A

    JNC SKIP Jump to SKIP if no carry

    INR D Increment D

    SKIP DCR C Decrement counter C

    JNZ BACK If non zero jump to BACK

    STA 3000 Store LSB

    MOV A,D Move MSB from D to A

    STA 3501 Store MSB in 3501H

    RST 5 Stop execution

    RESULT:

    Following programs assembled, executed using 8085 trainer kit and outputs were verified

    a) 16X8 multiplication

    b) 16X8 division

    c) Square of a 8-bit number

    *****

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 28

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 29

    EXPERIMENT NO.5

    LOGICAL OPERATIONS

    AIM:

    a) Write Assembly Language Program to study rotation, logical operators and complement

    operations

    b) Write Assembly Language Program to find the largest of an array

    EQUIPMENTS REQUIRED:

    8085 Trainer Kit, Keyboard, Power Chord

    ALGORITHM:

    a) Program to study rotation, logical and complement operations

    Step 1: The two 8bit values are stored in memory location

    Step 2: Find the 1s complement and 2s complement of the first byte and store the result

    Step 3: Use rotate instructions for left and right rotation through carry flag

    Step 4: Load the second byte and perform logical AND, OR and XOR operations

    Step 5: Store the results in consecutive memory locations

    b) Program to find largest of an array

    Step 1: Initialize a count register for the number of data to be compared

    Step 2: Initialize a register pair as address pointer to the data array

    Step 3: Increment the address pointer

    Step 4: compare the contents of memory location with accumulator

    Step 5: Keep the largest number in accumulator on each comparison

    Step 6: Decrement the count register and go to step 3 if not zero

    Step 7: Else store the final largest number in accumulator in memory location

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 30

    OBSERVATION:

    a) Rotation, logical and complement operations

    1s complement operation

    1 Input data: 21@3000 2 Input data: 36@3000

    Expected output: DE@3500 Expected output: C9@3500

    Observed output: Observed output:

    2s complement operation

    1 Input data: 21@3000 2 Input data: 36@3000

    Expected output: DF@3501 Expected output: CA@3501

    Observed output: Observed output:

    Rotate left operation

    1 Input data: 21@3000 2 Input data: 36@3000

    Expected output: 42@3502 Expected output: 6C@3502

    Observed output: Observed output:

    Rotate right operation

    1 Input data: 21@3000 2 Input data: 36@3000

    Expected output: 90@3503 Expected output: 1B@3503

    Observed output: Observed output:

    AND operation

    1 Input data: 21@3000 2 Input data: 36@3000

    Input data: 22@3001 Input data: 12@3001

    Expected output: 20@3504 Expected output: 12@3504

    Observed output: Observed output:

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 31

    PROGRAM:

    a) Program to study rotation, logical and complement operations

    Memory

    address

    Hex code Label Mnemonics Comments

    2000 LXI H 3000 Initialize address pointer

    MOV A,M Load the first byte

    MOV B,A Temporarily store the data

    CMA 1s complement

    STA 3500 Store the result

    ADI 01 To find 2s complement

    STA 3501 The 2s complement is stored

    MOV A,B Restore the data

    RLC Rotate content in A to left

    STA 3502 The result in A is stored

    MOV A,B Copy first operand to A

    RRC Rotate accumulator right

    STA 3503 Store the result

    INX H Increment HL pair.

    MOV C,M Copy the second byte

    MOV A,B Copy 1st operand to A

    ANA C Logical AND operation

    STA 3504 Result is stored in memory

    MOV A,B 1st operand is restored

    ORA C Logical OR operation

    STA 3505 The result is stored

    MOV A,B 1st

    operand is copied back

    XRA C Logical XOR operation

    STA3506 Store the result

    RST 5 Stop execution

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 32

    OBSERVATION:

    OR operation

    1 Input data: 21@3000 2 Input data: 36@3000

    Input data: 22@3001 Input data: 12@3001

    Expected output: 23@3505 Expected output: 36@3505

    Observed output: Observed output:

    XOR operation

    1 Input data: 21@3000 2 Input data: 36@3000

    Input data: 22@3001 Input data: 12@3001

    Expected output: 03@3506 Expected output: 24@3506

    Observed output: Observed output:

    b) Largest of an array

    1 No. of data: 04@2500

    I/P data (1): 82@2501

    I/P data (2): 19@2502

    I/P data (3): 20@2503

    I/P data (4): 06@2504

    Expected output: 82@3500

    Observed output:

    2 No. of data: 05@2500

    I/P data (1): 10@2501

    I/P data (2): 30@2502

    I/P data (3): 60@2503

    I/P data (4): 70@2504

    I/P data (4): 80@2505

    Expected output: 80@3500

    Observed output:

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 33

    b) Program to find the largest of an array

    Memory

    address

    Hex code Label Mnemonics Comments

    2600 LXI H 2500 Initialize the HL pair

    MOV C,M Load number of operands

    XRA A Clear accumulator

    BACK INX H Point to first number

    CMP M Compare the first number with

    accumulator

    JNC SKIP Jump to SKIP if no carry

    MOV A,M Transfer the large number to A

    SKIP DCR C Decrement the count register

    JNZ BACK Check if zero flag set

    STA 3500 Store the largest number

    RST 5 Stop execution

    RESULT:

    Following programs assembled, executed using 8085 trainer kit and outputs were verified

    a) Study rotation, logical and complement operations

    b) Find the largest of an array

    *****

  • Laboratory Manual

    AE&I Engineering Department, Govt. Engg. College Kozhikode Page 34