microporcessor 8085 lab manual

Upload: ajay-patil

Post on 28-Feb-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    1/53

    MALP-

    SUBJECT: MICROPROCESSOR &

    ASSEMBLY LANGUAGE PROGRAMMING

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    2/53

    MALP-

    INDEX

    MICROPROCESSOR & INTRAFACING

    SR.NO. AIM DATE SIGNATURE

    1 TO STUDY THE ARCHITECTURE OF 8085

    2 TO STUDY THE TIMING DIAGRAM OF 8085

    3 TO STUDY THE DEMULTIPLEXING OF

    CONTROL SIGNALS

    4 TO STUDY THE INSTRUCTIONS OF 8085

    5 PERFORM A PROGRAM TO ADD TWO 8

    !IT NUM!ERS USING 8085 SIMULATOR

    " PERFORM A PROGRAM TO SU!TRACT

    TWO 8 !IT NUM!ERS USING 8085

    SIMULATOR# PERFORM A PROGRAM TO ADD TWO 1"

    !IT NUM!ERS USING 8085 SIMULATOR

    8 PERFORM A PROGRAM TO MULTIPLY

    TWO 8 !IT NUM!ERS USING SUCCESSI$E

    ADDITION METHOD USING 8085

    SIMULATOR

    % PERFORM A PROGRAM TO MULTIPLY

    TWO !IT NUM!ERS USING SHIFT AND ADD

    METHOD USING 8085 SIMULATOR

    10 PERFORM A PROGRAM TO DI$IDE 1" !ITNUM!ER !Y AN 8 !IT NUM!ER USING 8085

    SIMULATOR

    11 PERFORM A PROGRAM TO ADD TWO 1"

    !IT !CD NUM!ERS USING 8085

    SIMULATOR

    12 PERFORM A PROGRAM TO TRANSFER A

    !LOC OF N !YTES FROM SOURCE TO

    DESTINATION USING 8085 SIMULATOR

    13 PERFORM A PROGRAM TO PROGRAM TO

    FIND MAXIMUM NUM!ER IN THE ARRAY

    USING 8085 SIMULATOR

    14 PERFORM A PROGRAM TO PROGRAM TO

    FIND MINIMUM ' SMALLEST NUM!ER IN

    ARRAY USING 8085 SIMULATOR

    15 PROGRAM TO SORT THE NUM!ERS IN

    ASCEDING ORDER

    1" PROGRAM TO SORT THE NUM!ERS IN

    DESCEDING ORDER.

    1# INTRODUCTION TO 8085

    MICROPROCESSOR TRAINER IT $MC-

    8501

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    3/53

    MALP-

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    4/53

    MALP-

    PRACTICAL-1

    AIM ( T) *+, /),+ 8085 ))6**) A7+6+,6.

    C)+)9 U+

    Generates signals within up to carry out the instruction, which has been decoded. In reality

    causes certain connections between blocks of the up to be opened or closed, so that data goes

    where it is required, and so that ALU operations occur.

    A+76+ L): U+

    The ALU performs the actual numerical and logic operation such as add!, subtract!,

    A"#!, $%!, etc. ALU uses data from memory and from Accumulator to perform arithmetic

    operations. Always stores result of operation in Accumulator.

    R6:*+6*

    The &'&()&'&'A*programming model includes si+ registers, one accumulator, and one flagregister, as shown in igure. In addition, it has two -*bit registers/ the stack pointer and the

    program counter. They are described briefly as follows.

    The &'&()&'&'A has si+ general*purpose registers to store &*bit data0 these are identified as

    1,2,#,3,4, and L as shown in the figure. They can be combined as register pairs * 12, #3, and

    4L * to perform some -*bit operations. The programmer can use these registers to store or

    copy data into the registers by using data copy instructions.

    A,,9/+)

    The accumulator is an &*bit register that is a part of arithmetic)logic unit 5ALU6. Thisregister is used to store &*bit data and to perform arithmetic and logical operations. The result of

    an operation is stored in the accumulator The accumulator is also identified as register A

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    5/53

    MALP-

    F9/:*

    The ALU includes fi7e flip*flops, which are set or reset after an operation according to data

    conditions of the result in the accumulator and other registers. They are called 8ero 586, 2arry

    5296, :ign 5:6, ;arity 5;6, and Au+iliary 2arry 5A26 flags0 they are listed in the Table and theirbit positions in the flag register are shown in the igure below. The most commonly used flags

    are 8ero, 2arry, and :ign. The microprocessor uses these flags to test data conditions.

    or e+ample, after an addition of two numbers, if the sum in the accumulator id larger than

    eight bits, the flip*flop uses to indicate a carry ** called the 2arry flag 5296 ** is set to one.

    acent to the accumulator.

    4owe7er, it is not used as a register0 fi7e bit positions out of eight are used to store the outputs

    of the fi7e flip*flops. The flags are stored in the &*bit register so that the programmer can

    e+amine these flags 5data conditions6 by accessing the register through an instruction. These

    flags ha7e critical importance in the decision*making process of the micro* processor. The

    conditions 5set or reset6 of the flags are tested through the software instructions. or e+ample,

    the instruction ?2 5?ump on 2arry6 is implemented to change the sequence of a program when

    29 flag is set. The thorough understanding of flag is essential in writing assembly language

    programs.

    P):/ C),+6 ;PCunction with interrupts and inserted

    using e+ternal hardware. 4owe7er these can be used as

    software instructions in a program to transfer program

    e+ecution to one of the eight locations. The addresses are/

    Instruction %estart Address

    %:T ' ''''4

    %:T - '''&4

    %:T E ''-'4

    %:T D ''-&4

    %:T F ''E'4

    %:T ( ''E&4

    %:T ''D'4

    %:T B ''D&4

    The &'&( has four additional interrupts and these interrupts generate %:T instructions internally and

    thus do not require any e+ternal hardware. These instructions and their %estart addresses are/

    LOGICAL INSTRUCTIONS

    $pcode $perand #escription

    2ompare register or memory with accumulator

    2@; % The contents of the operand 5register or memory6 are

    @ compared with the contents of the accumulator. 1oth

    contents are preser7ed . The result of the comparison is

    Interrupt %estart Address

    T%A; ''EF4

    %:T (.( ''E24

    %:T .( ''DF4

    %:T B.( ''D24

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    23/53

    if 5A6 N 5reg)mem6/ carry and =ero flags are reset

    3+ample/ 2@; 1 or 2@; @

    2ompare immediate with accumulator

    2;I &*bit data The second byte 5&*bit data6 is compared with the contents of the accumulator. The

    7alues being compared remain unchanged. The result of thecomparison is shown by setting the flags of the ;:< as

    follows/

    if 5A6 M data/ carry flag is set

    if 5A6 K data/ =ero flag is set

    if 5A6 N data/ carry and =ero flags are reset3+ample/ 2;I &4

    Logical A"# register or memory with accumulator

    A"A % The contents of the accumulator are logically A"#ed with

    @ the contents of the operand 5register or memory6, and the

    result is placed in the accumulator. If the operand is a

    memory location, its address is specified by the contents of

    4L registers. :, 8, ; are modified to reflect the result of the

    operation. 29 is reset. A2 is set.

    3+ample/ A"A 1 or A"A @

    Logical A"# immediate with accumulator

    A"I &*bit data The contents of the accumulator are logically A"#ed with the &*bit data 5operand6

    and the result is placed in the accumulator. :, 8, ; are

    modified to reflect the result of the operation. 29 is reset. A2

    is set.

    3+ample/ A"I &4

    3+clusi7e $% register or memory with accumulator

    %A % The contents of the accumulator are 3+clusi7e $%ed with

    @ the contents of the operand 5register or memory6, and the

    result is placed in the accumulator. If the operand is a

    memory location, its address is specified by the contents of

    4L registers. :, 8, ; are modified to reflect the result of the

    operation. 29 and A2 are reset.

    3+ample/ %A 1 or %A @

    3+clusi7e $% immediate with accumulator

    %I &*bit data The contents of the accumulator are 3+clusi7e $%ed with the

    &*bit data 5operand6 and the result is placed in theaccumulator. :, 8, ; are modified to reflect the result of the

    operation. 29 and A2 are reset.

    3+ample/ %I &4

    Logical $% register or memory with accumulator

    $%A % The contents of the accumulator are logically $%ed with

    @ the contents of the operand 5register or memory6, and the

    result is placed in the accumulator. If the operand is a

    memory location, its address is specified by the contents of

    %otate accumulator left%L2 none 3ach binary bit of the accumulator is rotated left by one

    position. 1it #B is placed in the position of #' as well as in

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    24/53

    %otate accumulator right

    %%2 none 3ach binary bit of the accumulator is rotated right by one

    position. 1it #' is placed in the position of #B as well as in

    the 2arry flag. 29 is modified according to bit #'. :, 8, ;,

    A2 are not affected.3+ample/ %%2

    4L registers. :, 8, ; are modified to reflect the result of the

    operation. 29 and A2 are reset.

    3+ample/ $%A 1 or $%A @

    Logical $% immediate with accumulator

    $%I &*bit data The contents of the accumulator are logically $%ed with the &*bit data 5operand6 and

    the result is placed in the accumulator. :, 8, ; are modified to

    reflect the result of the operation. 29 and A2 are reset.

    3+ample/ $%I &4

    %otate accumulator left through carry

    %AL 3ach binary bit of the accumulator is rotated left by one

    position through the 2arry flag. 1it #B is placed in the 2arry

    flag, and the 2arry flag is placed in the least significant

    position #'. 29 is modified according to bit #B. :, 8, ;, A2

    are not affected.

    3+ample/ %AL

    %otate accumulator right through carry

    %A% none 3ach binary bit of the accumulator is rotated right by one position through the 2arry

    flag. 1it #' is placed in the 2arry

    flag, and the 2arry flag is placed in the most significant

    position #B. 29 is modified according to bit #'. :, 8, ;, A2

    are not affected.

    2omplement accumulator

    2@A The contents of the accumulator are complemented. "o flags

    are affected.

    3+ample/ 2@A

    2omplement carry

    2@2 The 2arry flag is complemented. "o other flags are affected.

    3+ample/ 2@2

    :et 2arry

    :T2 The 2arry flag is set to -. "o other flags are affected.

    3+ample/ :T2

    CONTROL INSTRUCTIONS

    $pcode $perand #escription

    "o operation

    "$; "o operation is performed. The instruction is fetched and

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    25/53

    The 2;U finishes e+ecuting the current instruction and haltsany further e+ecution. An interrupt or reset is necessary to e+itfrom the halt state.

    3+ample/ 4LT

    #isable interrupts

    #I The interrupt enable flip*flop is reset and all the interrupts

    e+cept the T%A; are disabled. "o flags are affected.

    3+ample/ #I

    3nable interrupts

    3I The interrupt enable flip*flop is set and all interrupts are

    enabled. "o flags are affected. After a system reset or the

    acknowledgement of an interrupt, the interrupt enable flip*

    flop is reset, thus disabling the interrupts. This instruction isnecessary to reenable the interrupts 5e+cept T%A;6.

    3+ample/ 3I

    %ead interrupt mask

    %I@ This is a multipurpose instruction used to read the status of

    interrupts B.(, .(, (.( and read serial data input bit. The

    instruction loads eight bits in the accumulator with the

    following interpretations 3+ample/ %I@

    conclusion/

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    26/53

  • 7/25/2019 MICROPORCESSOR 8085 Lab Manual

    27/53

    GP GANDHINAGAR EC DEPARTMENT MALP-3341101;SEM-4