NBA Final MPMC Lab Manual
NBA Final MPMC Lab Manual
NBA Final MPMC Lab Manual
DEPARTMENT OF ELECTRONICS
AND COMMUNICATION
ENGINEERING ,
VASIREDDY VENKATADRI
INSTITUTE OF TECHNOLOGY,
NAMBUR.
INDEX
Page.
S.No. Contents
No
1 Syllabus 4
2 Equipment required for laboratory 5
3 Introduction to 8086, Masm/Tasm Editor 7
4 Turbo Assembler Linker Debugger 10
5 Introduction to the trainer & Instructions to user 12
6 Hexadecimal keypad legend interpretation 15
7 Function Key Operation 15
Exp. Page.
NAME OF PROGRAM
No. No
1 8 bit addition 17
2 16 bit addition 19
3 8 bit subtraction 21
4 16 bit subtraction 23
5 Multibyte addition 25
6 Multibyte subtraction 27
7 4 digit decimal number addition 29
8 Multiplication of 8-bit signed number by 16-bit signed number 31
9 Multiplication of 16 -bit unsigned number by 16-bit unsigned number 33
10 Division of 16 -bit unsigned number by 16-bit unsigned number 35
11 Division of 16-bit signed number by 8-bit signed number 37
12 Packed BCD to unpacked BCD conversion 39
13 Packed BCD to ASCII conversion 41
14 ASCII addition 43
15 ASCII subtraction 45
16 Count the number of even and odd numbers from a series 47
17 Count the numbers consists of ‘1’ as a sixth bit 49
18 Arrange a series of 8-bt signed numbers in descending order 51
19 Arrange a series of 16-bt unsigned numbers in ascending order 53
20 String transfer in forward direction 55
Exp. Page.
No. NAME OF PROGRAM No
1 Add two 8 bit numbers 73
2 Subtraction two 8 bit numbers 74
3 Division two 8 bit numbers 75
4 Add two 16 bit numbers 76
5 Subtraction two 16 bit numbers 77
6 Division two 16 bit numbers 78
7 8279 – keyboard display- write a program to display a string of characters 79
8 8255 – PPI-write alp to generate sinusoidal wave using ppi 82
9 8259 – programmable interupt controller 84
10 8251 – USART 85
Exp. Page.
NAME OF PROGRAM
No. No
1 Reading and writing on a parallel port 87
2 Timer in differnent modes 88
3 Serial communication implementation 89
The students are required to develop the necessary Algorithm, Flowchart and Assembly
Language Program Source Code for executing the following functions using MASM/TASM
software and to verify the results with necessary Hardware Kits.
1. Introduction to MASM/TASM.
2. Arithmetic operation- Multi byte Addition and Subtraction, Multiplication and Division-
Signed and unsigned Arithmetic operation, ASCII- Arithmetic operation.
3. Logic operations-Shift and rotate- Converting packed BCD to unpacked BCD, BCD to ASCII
conversion.
4. By using string operation and Instruction prefix: Move Block, Reverse string, Sorting,
Inserting, Deleting, Length of the string, String comparison.
5. DOS/BIOS programming: Reading keyboard (Buffered with and without echo) - Display
characters, Strings.
Write C programs to interface 8051 chip to Interfacing modules to Develop single chip solutions.
1. Simple Calculator using 6 digit seven segment display and Hex Keyboard interface to 8051.
2. Alphanumeric LCD panel and Hex keypad input interface to 8051.
3. External ADC and Temperature control interface to 8051.
4. Generate different waveforms Sine, Square, Triangular, and Ramp etc. using DAC interface to
8051; change the frequency and Amplitude.
2. Interfaces/peripheral subsystems
i) 8259 PIC
ii) 8279-KB/Display
An editor is a program, which allows you to create a file containing the assembly language
statements for your program. As you type in your program, the editor stores the ASCII codes
for the letters and numbers in successive RAM locations. When you have typed in all of your
programs, you then save the file on a floppy of hard disk. This file is called source file. The
next step is to process the source file with an assembler. In the TASM assembler, you should
give your source file name the extension, .ASM
ASSEM BLER
An assembler program is used to translate the assembly language mnemonics for instructions
to the corresponding binary codes. When you run the assembler, it reads the source file of
your program the disk, where you saved it after editing on the first pass through the source
program the assembler determines the displacement of named data items, the offset of
labels and pails this information in a symbol table. On the second pass through the source
program, the assembler produces the binary code for each instruction and inserts the offset
etc that is calculated during the first pass. The assembler generates two files on floppy or
hard disk. The first file called the object file is given the extension. OBJ. The object file
contains the binary codes for the instructions and information about the addresses of the
instructions. The second file generated by the assembler is called assembler list file. The list
file contains your assembly language statements, the binary codes for each instructions and
the offset for each instruction. In TASM assembler, TASM source file name ASM is used to
assemble the file. Edit source file name LST is used to view the list file, which is
generated, when you assemble the file.
LINKER
A linker is a program used to join several object files into one large object file and convert to
an exe file. The linker produces a link file, which contains the binary codes for all the
combined modules. The linker however doesn’t assign absolute addresses to the program, it
assigns is said to be reloadable because it can be put anywhere in memory to be run. In
TASM, TLINK source filename is used to link the file.
DEBUGGER
A debugger is a program which allows you to load your object code program into system
memory, execute the program and troubleshoot are debug it the debugger allows you to look
at the contents of registers and memory locations after your program runs. It allows you to
change the contents of register and memory locations after your program runs. It allows you
to change the contents of register and memory locations and return the program. A debugger
also allows you to set a break point at any point in the program. If you inset a breakpoint the
debugger will run the program upto the instruction where the breakpoint is set and stop
execution. You can then examine register and memory contents to see whether the results
are correct at that point. In TASM, td filename is issued to debug the file.
DEBUGGER FUNCTIONS:
1. Debugger allows looking at the contents of registers and memory locations.
2. We can extend 8-bit register to 16-bit register which the help of extended register option.
3. Debugger allows setting breakpoints at any point with the program.
4. The debugger will run the program upto the instruction where the breakpoint is set and
then stop execution of program. At this point, we can examine registry and memory
contents at that point.
5. With the help of dump we can view register contents.
6. We can trace the program step by step with the help of F7.
7. We can execute the program completely at a time using F8.
DEBUGGER COMMANDS
5. Run Linker TLINK.EXE- generate .EXE file from the .OBJ file tlink/v proj
Trace into (can use F7 key): executes one instruction; traces "into" procedures.
Step over (can use F8 key): executes one instruction; skips (does not trace into)
procedures. Hitting either of these executes the instruction, and moves the arrow to the next
instruction. As each instruction executes, the effects might be visible in the Registers Window
and Watches Window
Trace into (can use F7 key): executes one instruction; traces "into" procedures.
Step over (can use F8 key): executes one instruction; skips (does not trace into)
procedures. Hitting either of these executes the instruction, and moves the arrow to the
next instruction. As each instruction executes, the effects might be visible in the Registers
Window and Watches Window
2. Setting and Removing Breakpoints
To set a breakpoint, position the cursor on the desired line of source code and press F2.
The line containing the breakpoint will turn red. Pressing F2 again removes the breakpoint.
To execute all instructions from the current instruction pointer up to the next encountered
breakpoint, choose Run (can use F9 key) from the Run menu item.
3. Examining Registers
Another window, the Registers Window, can be opened to examine the current value of
the CPU registers and flags. The View menu can be used to open this Registers Window.
The registers and flags might change as each instruction is executed.
4. Examining Memory
To examine memory, you will need to open an Inspector window. An Inspector window
shows the contents of a data structure (or simple variable) in the program you are debugging.
It also allows you to modify the contents of the data structure or variable. To open an
Inspector window, place the cursor on what you want to inspect and press CTRL-I. After
you've examined the data item, press the ESC key to remove the Inspector window.
• Examine and optionally modify the contents of memory (byte or word format)
• Examine and optionally modify the processor registers.
• Assemble and Disassemble 8086/8088 instructions (via line assembler, disassembler).
• Perform fast numerical computations using the optional 8087 Numeric data processor.
• Execute the user program at full speed.
• Debug user program through single step and Breakpoint facilities.
• Write or read data to or from I/O ports (byte or word format).
• Move a block of data or program within the memory
• Download user programs into ESA 86/88-2 from a host computer system.
SPECIFICATIONS
Central processor
8086 CPU, operating at 8MHz in maximum mode (Supplied with 8086 CPU). (Memory
cycles have zero wait states and I/O cycles have one wait state).
Co-Processor
On-board 8087 Numeric Data processor (optional)
Memory
EPROM: 4 JEDEC compatible slots offer the following options:
64K bytes using 27128s or,
128K bytes using 27256s or,
256K bytes using 27512s
(System firmware is supplied in 2x27256s. The other two sockets are for user expansion).
Interrupts
INTER controlled through 8259A, on-board Interrupt Controller: provides interrupt vectors
for eight sources. Complete flexibility in selecting off-board or on-board interrupt sources.
Internal: Interrupt vectors 1(single step) and 3 (breakpoint) reserved for monitor.
Interface Signals
CPU Bus: De-multiplexed and fully buffered, TTL compatible, Address, Data & Control
signals are available on two 50-pin ribbon cable connectors.
Parallel I/O: 48 Programmable parallel I/O lines (TTL compatible) through two 26 pin
ribbon cable connectors. (Connector details compatible to our other microcomputer trainers).
Configuration 86/88-2
86/88-2-microcomputer trainer is versatile and can be configured in a number of ways, as
determined by the setting of a DIP switch and other jumpers. (Refer to the component
layout diagram in appendix C to locate the DIP switch and the jumpers).
Printer Enable/Disable
86/88-2 firmware includes the driver program fro centronics compatible parallel printer
interface. This driver can be enabled/disabled as shown below:
DIP SWITCH
SW3 SW2 SW1 Baud rate
OFF OFF ON 9,600*
Memory selection:
86/88-2 has four sockets, labeled U9, U8, U7, U6 for RAM. These sockets are configured for
62256(32X 4) devices. Two of these sockets are populated (providing 64K Bytes of RAM)
and two are for user expansion.
Function
Operation
Key
The RESET key allows you to terminate any present activity and to return
your ESA 86/88-2 to an initialize state. When pressed, the sign-on
RESET
message appears in the display and the monitor is ready for command
entry.
The + (plus) key allows you to add two hexadecimal values. This function
+ simplifies relative addressing by allowing you to readily calculate an
address location relative to a base address.
The – (minus) key allows you to subtract one hexadecimal value from
–
another.
The REG (register) key allows you to use the contents of any of the
REG
8086/8088’s registers as an address or data value.
The NEXT key is used to separate keypad entries and to increment the
NEXT
address field to the next consecutive memory location.
The PREV key is used to decrement the address field to previous memory
PREV
location.
The dot key is the command terminator. When pressed, the current
EXEC (.)
command is executed.
1) NEXT or, means the same operation
NOTE
2) EXEC or, means the same operation
Program:
Instruction description:
MOV (Move):
ADD (Addition):
Theoretical calculations:
Observations:
Result:
Program :
Instruction description:
INT 21H:
Theoretical calculations:
Observations:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Instruction description:
MOV (Move):
SUB (Subtraction):.
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000H
DS:2001 DS:2001H
DS:2002 DS:2002H
DS:2003 DS:2003H
DS:5000H DS:5000H
DS:5001H DS:50001
DS:5002H DS:5002H
DS:5003H DS:5003H
Result:
Program :
Instruction description:
SUB (Subtraction):.
INT 21H:.
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000H
DS:2001 DS:2001H
DS:2002 DS:2002H
DS:2003 DS:2003H
DS:5000H DS:5000H
DS:5001H DS:50001
DS:5002H DS:5002H
DS:5003H DS:5003H
Result:
Program:
INT 21H
CODE ENDS
END START
Instruction description:
INT 21H:.
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000H
DS:2001 DS:2001H
DS:2002 DS:2002H
DS:2003 DS:2003H
DS:2004 DS:2004
DS:2005 DS:2005
DS:2006 DS:2006
DS:2007 DS:2007
DS:5000H DS:5000H
DS:50001 DS:50001
DS:5002H DS:5002H
DS:5003H 00H DS:5003H
Result:
Program:
Instruction description:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000H
DS:2001 DS:2001H
DS:2002 DS:2002H
DS:2003 DS:2003H
DS:2004 DS:2004
DS:2005 DS:2005
DS:2006 DS:2006
DS:2007 DS:2007
DS:5000H DS:5000H
DS:50001 DS:50001
DS:5002H DS:5002H
DS:5003H DS:5003H
Result:
Program:
Instruction description:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000H
DS:2001 DS:2001H
DS:2002 DS:2002H
DS:2003 DS:2003H
DS:5000H DS:5000H
DS:5001H DS:50001
DS:5002H DS:5002H
DS:5003H DS:5003H
Result:
VVIT, Department of Electronics and Communication Engineering Page
30
MICROPROCESSORS & MICROCONTROLLER LAB
Program:
CODE ENDS
END START
Instruction description:
IMUL:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000H DS:5000
DS:5001H DS:5001
DS:5002H DS:5002
DS:5003H DS:5003
Result:
Program:
END START
Instruction description:
MUL (Multiplication):
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program:
INT 21H
CODE ENDS
END START
Instruction description:
IDIV:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
.
Program:
Instruction description:
IDIV:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program :
END START
Instruction description:
AND:
ROR:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program :
INT 21H
CODE ENDS
END START
Instruction description:
OR:
ROL:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program :
Instruction description:
AAA:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program :
OR AX, 3030H
MOV RES, AX
MOV AH, 4CH
INT 21H
CODE ENDS
END START
Instruction description:
AAS:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program :
Instruction description:
INC:
DEC:
SHR:
LEA (Load Effective Address) :.
JNZ (Jump No Zero):.
Theoretical calculations:
Observations:
CS: DS:
D
S:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:2004 DS:2004
DS:2005 DS:2005
DS:2006 DS:2006
DS:2007 DS:2007
DS:2008 DS:2008
DS:2009 DS:2009
DS:200A DS:200A
VVIT, Department of Electronics and Communication Engineering Page
48
MICROPROCESSORS & MICROCONTROLLER LAB
DS:200B DS:200B
DS:200C DS:200C
DS:200D DS:200D
DS:200E DS:200E
DS:2010 DS:2010
DS:2011 DS:2011
DS:2012 DS:2012
DS:2013 DS:2013
DS:2014 DS:2014
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program :
MOV DS, AX
LEA SI, SERIES
MOV CX, CNT
AGAIN: MOV AX, [SI]
AND AX, 0020H
JZ GO
INC CNTR
GO: INC SI
LOOP AGAIN
MOV AH, 4CH
INT 21H
CODE ENDS
END START
Instruction description:
INC:
DEC:
SHR:
Theoretical calculations:
Observations:
CS: DS:
DS
:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:2004 DS:2004
DS:2005 DS:2005
DS:2006 DS:2006
DS:2007 DS:2007
DS:2008 DS:2008
DS:2009 DS:2009
DS:200A DS:200A
DS:200B DS:200B
DS:200C DS:200C
DS:200D DS:200D
DS:200E DS:200E
DS:2010 DS:2010
DS:2011 DS:2011
DS:2012 DS:2012
DS:2013 DS:2013
DS:2014 DS:2014
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program :
Instruction description:
LOOP:
XCHG (Exchange):
CMP:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:2004 DS:2004
DS:2005 DS:2005
DS:2006 DS:2006
DS:2007 DS:2007
DS:2008 DS:2008
DS:2009 DS:2009
Result:
Program :
Instruction description:
JBE:
JNZ:
Theoretical calculations:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:2004 DS:2004
DS:2005 DS:2005
DS:2006 DS:2006
DS:2007 DS:2007
DS:2008 DS:2008
DS:2009 DS:2009
DS:200A DS:200A
DS:200B DS:200B
DS:200C DS:200C
DS:200D DS:200D
DS:200E DS:200E
DS:200F DS:200F
DS:2010 DS:2010
DS:2011 DS:2011
DS:2012 DS:2012
DS:2013 DS:2013
Result:
Program:
MOV DS, AX
MOV AX, EXTRA
MOV ES, AX
LEA SI, SOURSE_STG
LEA DI, DESTINATION_STG
CLD
MOV CX, CNT
REP MOVSB
MOV AH, 4CH
INT 21H
CODE ENDS
END START
Instruction description:
MOVSB:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:2004 DS:2004
DS:5000 DS:5000
DS:5001 DS:5001
DS:5002 DS:5002
DS:5003 DS:5003
Result:
Program :
MOV DS, AX
MOV AX, EXTRA
MOV ES, AX
LEA SI, SOURSE_STG
LEA DI, DESTINATION_STG
CLD
MOV CX, CNT
ADD DI, CX
DEC DI
NXT_CHAR: MOVSB
SUB DI, 02H
LOOP NXT_CHAR
MOV AH, 4CH
INT 21H
CODE ENDS
END START
Instruction description:
LOOP:
Observations:
CS: DS:
DS:2000 DS:2000 67
DS:2001 DS:2001 6F
DS:2002 DS:2002 6F
DS:2003 DS:2003 64
DS:2004 DS:2004 00
DS:5000 DS:5000 64
DS:5001 DS:5001 6F
DS:5002 DS:5002 6F
DS:5003 DS:5003 67
Result:
Instruction description:
NOP:
CLD:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:2004 DS:2004
DS:2005 DS:2005
DS:2006 DS:2006
DS:2007 DS:2007
DS:2008 DS:2008
DS:2009 DS:2009
DS:200A DS:200A
DS:200B DS:200B
DS:200C DS:200C
DS:200D DS:200D
DS:200E DS:200E
DS:200F DS:200F
DS:2010 DS:2010
DS:2011 DS:2011
DS:2012 DS:2012
DS:2013 DS:2013
DS:2014 DS:2014
DS:2015 DS:2015
DS:2016 DS:2016
DS:2017 DS:2017
ES:5000 ES:5000
ES:5001 ES:5001
ES:5002 ES:5002
ES:5003 ES:5003
ES:5004 ES:5004
ES:5005 ES:5005
ES:5006 ES:5006
ES:5007 ES:5007
ES:5008 ES:5008
ES:5009 ES:5009
ES:500A ES:500A
ES:500B ES:500B
ES:500C ES:500C
ES:500D ES:500D
ES:500E ES:500E
ES:500F ES:500F
ES:5010 ES:5010
ES:5011 ES:5011
VVIT, Department of Electronics and Communication Engineering Page
61
MICROPROCESSORS & MICROCONTROLLER LAB
ES:5012 ES:5012
ES:5013 ES:5013
ES:5014 ES:5014
ES:5015 ES:5015
ES:5016 ES:5016
ES:5017 ES:5017
ES:5018 ES:5018
ES:5019 ES:5019
ES:501A ES:501A
ES:501B ES:501B
ES:501C ES:501C
Result:
MOV ES, AX
MOV SI, OFFSET STRING1
MOV DI, OFFSET STRING2
CLD
MOV CX, 13
REP MOVSB
CLD
MOV SI, 18
MOV CX, 12
REP MOVSB
MOV AH, 4CH
INT 21H
CODE ENDS
END START
DESCRIPTION:
MOVSB:
Observations:
CS: DS:
DS:2000 DS:2000
DS:2001 DS:2001
DS:2002 DS:2002
DS:2003 DS:2003
DS:2004 DS:2004
DS:2005 DS:2005
DS:2006 DS:2006
DS:2007 DS:2007
DS:2008 DS:2008
DS:2009 DS:2009
DS:200A DS:200A
DS:200B DS:200B
DS:200C DS:200C
DS:200D DS:200D
DS:200E DS:200E
DS:200F DS:200F
DS:2010 DS:2010
DS:2011 DS:2011
DS:2012 DS:2012
DS:2013 DS:2013
DS:2014 DS:2014
DS:2015 DS:2015
DS:2016 DS:2016
DS:2017 DS:2017
DS:2018 DS:2018
DS:2019 DS:2019
DS:201A DS:201A
DS:201B DS:201B
DS:201C DS:201C
ES:5000 ES:5000
ES:5001 ES:5001
ES:5002 ES:5002
ES:5003 ES:5003
ES:5004 ES:5004
ES:5005 ES:5005
ES:5006 ES:5006
ES:5007 ES:5007
ES:5008 ES:5008
ES:5009 ES:5009
ES:500A ES:500A
ES:500B ES:500B
ES:500C ES:500C
ES:500D ES:500D
ES:500E ES:500E
ES:500F ES:500F
ES:5010 ES:5010
ES:5011 ES:5011
ES:5012 ES:5012
ES:5013 ES:5013
ES:5014 ES:5014
ES:5015 ES:5015
ES:5016 ES:5016
ES:5017 ES:5017
Result:
Program :
Instruction description:
INT 21H
Observations:
Result:
Program :
CODE SEGMENT
START: MOV AX, DATA
MOV DS, AX
MOV ES, AX
MOV BX, 0H
CLD
LEA DI, DESTINATION_STG
LEA DX, MSG
MOV AH, 09H
INT 21H
NXT_CHAR: MOV AH, 01H
INT 21H
CMP AL, ODH
JE TERM
INC BX
STOSB
JMP NXT_CHAR
TERM: MOV LNT_STG, BX
MOV AH, 4CH
INT 21H
CODE ENDS
END START
Instruction description:
INT 21H
STOSB:
Observations:
Result:
Program :
Instruction description:
INT 21H
Observations:
Result:
LEFT AS AN EXERCISE
CONT: LEA DX, MSG5
MOV AH, 09H
INT 21H
MOV AH, 01H
INT 21H
CMP AL, ‘Y’
JE AGAIN
CMP AL, ‘N’
JE TERM
JMP CONT
TERM: MOV AH, 4CH
INT 21H
CODE ENDS
END START
Result:
Instruction description:
CMPSB:
Observations:
Y N
ENTER YOUR STRING 1: ________ Go back to command
window
Instruction description:
CMP :
Observations:
ENTER UR PASSWORD: _____________________________
After 3 attempts
SORRY, ACCESS IS DENIED / YES, U CAN RUN UR APPLICATION ON THE SYSTEM
Result:
AIM: Write a program to Add 8 bytes stored from 2000H and store the result from 3000H using 8086.
Apparatus:
2. Keyboard
3. Power cable
Program Description:
Program:
Result:
AIM: Write a program to Add 8 bytes stored from 2000H and store the result from 3000H using 8086.
Apparatus:
2. Keyboard.
3. Power cable.
VVIT, Department of Electronics and Communication Engineering Page
74
MICROPROCESSORS & MICROCONTROLLER LAB
Program Description:
Program:
Result:
AIM: Write a program to Add 8 bytes stored from 2000H and store the result from 3000H using 8086.
Apparatus:
2. Keyboard.
3. Power cable.
Program Description:
Program:
Result:
AIM: Write a program to Add 8 bytes stored from 1000H and store the result from 2000H using 8086.
Apparatus:
2.Keyboard.
3.Power cable.
Program Description:
Program:
Result:
AIM: Write a program to Add 8 bytes stored from 1000H and store the result from 2000H using 8086.
Apparatus:
2.keyboard.
3.Power cable.
Program Description:
Program:
100DH Hlt
Result:
AIM: Write a program to Add 8 bytes stored from 1000H and store the result from 2000H using
8086.
Apparatus:
2.Keyboard.
3.Power cable.
Program Description:
Program:
Result:
AIM: Write a program to display a string of characters on seven segment display using 8086.
Apparatus:
3.Keyboard.
3.Power cable.
Program Description:
Program:
1200H FF FF FF FF
FF FF FF FF
98 68 7C 7C
0C FF FF FF
D7 D6 D5 D4 D3 D2 D1 D0
A3 A2 A1 A0 B3 B2 B1 B0
D C B A DP G F E
1 0 0 1 1 0 0 0 98H
0 1 1 0 1 0 0 0 68H
0 1 1 1 1 0 0 0 7CH
0 0 0 0 1 1 0 0 0CH
Result:
AIM: Write a program to generate a sinwave from using DAC 8255 using 8086.
Apparatus:
Program Description:
Program:
Result: .
APPARATUS:
1. 8086 TRAINER KIT
2. 8259 STUDY CARD
3. KEYBOARD, CABLES, ETC…
PROGRAM:
ORG 1000H
MOV AL,17H
OUT 0C0H, AL
MOV AL,08H
OUT 0C2H, AL
MOV AL,01H
OUT 0C2H, AL
MOV AL,FEH
OUT 0C2H, AL
STI
HERE: JMP HERE
MOV AL,20H
LOOP 0C0H,AL
INT 02H
Interrupt Vector:-
0000:0200 00h
0000:0021 12h
0000:0022 00h
0000:0023 00h
OBSERVATIONS:
INPUT:
OUTPUT:
RESULT:
8251 – USART
AIM: To interface USART (Universal Synchronous Asynchronous Receiver Transmitter) with 8086 microprocessor.
APPARATUS:
1 8086 TRAINER KIT
2 8251 STUDY CARD
3 ADAPTER, KEYBOARD, CABLES, ETC…
PROGRAM:
TRANSMITTER END:
ORG 1000H
MOV AL,36H
OUT 0CEH, AL
MOV AL,10H
OUT 0C8H, AL
MOV AL,00H
OUT 0C8H, AL
MOV AL,4EH
OUT 0C2H, AL
MOV AL,37H
OUT 0C2H, AL
LOOP1:IN AL,0C2H
AND AL,04H
JZ LOOP1
MOV AL,41H
OUT 0C0H,AL
INT 02H
RECEIVER END:
ORG 1200H
MOV AL,36H
OUT 0CEH, AL
MOV AL,10H
OUT 0C8H, AL
MOV AL,00H
OUT 0C8H, AL
MOV AL,4EH
OUT 0C2H, AL
MOV AL,37H
OUT 0C2H, AL
LOOP2:IN AL,0C2H
AND AL,04H
JZ LOOP2
IN AL,0C0H
MOV BX,I500H
MOV [BX],AL
INT 02H
RESULT:
MICROCONTROLLER 8051
Reading and Writing on a parallel Port
AIM: Write a program to intialise a port and transfer the data between ports.
Program:
i) ORG 00H
MOV P0,#05H
MOV P0,#0AH
MOV P2, #50H
MOV P3, #0A5H
JMP $
END
ADD A, R0
MOV P3,A
JMP $
END
RESULT:
Program:
ORG 00H
MOV R0, #05H
X:
DJNZ R0,X
JMP $
END
ORG 00H
RESULT:
Program:
ORG 00H
MOV TMOD, #20H
MOV TH1, #0FWH
SETB TR1
MOV SCON, #50H
X:
JNB RI,$
MOV R0,SBUT
MOV P1,R0
CLR RI
JMP X
END
RESULT:
AIM: Write a program to Add 8 bytes stored from 4100H and store the result from 4500H using 8051.
Apparatus:
Program Description:
Program:
Result:
AIM: Write a program to Add 8 bytes stored from 4100H and store the result from 4500H using 8051.
Apparatus:
Program Description:
Program:
Result:
AIM: Write a program to Add 8 bytes stored from 4100H and store the result from 4500H using 8051.
Apparatus:
Program Description:
Result:
thinking”