VIK-85L OPERATING MANUAL
1
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
CONTENTS
Sl.No
CHAPTER
INTRODUCTION
1.
Page .No
4
1.1
8085 Microprocessor
1.2
8085 Overview
1.3
VIK-85L Board Overview
1.4
VIK-85L Specifications
2.0
SYSTEM DESCRIPTION
10
2.1
Hardware
10
2.2
Port Details
11
2.3
Power Supply Details
12
2.4
Keyboard Details
13
3.0
COMMANDS AND KEYS
14
3.1
Reset
14
3.2
H (Help Menu)
14
4.0
OPERATING INSTRUCTIONS
15
4.1
Power On
15
4.2
Keyboard Operation
15
4.3
Assembler & Disassembler
16
4.4
Assembler
16
4.5
Disassembler
19
4.6
M (Modify Memory Command)
20
2
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
4.7
G (Go Command)
24
4.8
R (Register Display/Modify)
25
4.9
T (Transfer Command)
27
4.10
B (Baud Rate)
28
4.11
S (Serial Mode Key)
29
4.12
E (Examine / Dump Memory)
30
5.0
TERMINAL EMULATION SOFTWARE
31
5.1
Serial Port
31
5.2
Software Package
31
6.0
REMOTE OPERATION OF VIK-85L
32
6.1
Download
35
6.2
Upload
37
7.0
PROGRAMMING DETAILS
38
7.1
Registers
38
7.2
Monitor Program
38
7.3
Breakpoint
39
APPENDIX I
VIK 85L COMPONENT LIST
40
APPENDIX II
VIK 85L CONNECTOR DETAILS
42
APPENDIX III EXAMPLE PROGRAMS
APPENDIX IV
50
SCHEMATIC DIAGRAM
3
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
CHAPTER 1
INTRODUCTION
1.1 8085 MICROPROCESSOR:
MICROPROCESSOR offers more advantages than conventional
discrete hardwired logic circuits. The major advantage is its programmability
to adapt to different environment and in addition it reduces the PCB space.
These ICs are also cost effective and could be used for any applications
ranging from Electronic toys to Programmable Logic Controllers (PLC) to
text or data processing equipment.
At present 8 bit Microprocessors are used in low end Video terminals,
PLCs etc. earlier these were used in CP/M computers.16 bit Microprocessors
are more popular at present and these are used in IBM PC computers.
The 8085 Microprocessor is the updated version of 8 bit
Microprocessor 8080A and the main advantage is that it can be operated
using single 5 volts supply. In addition it has more interrupt facilities and
serial input/output facility.
4
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
1.2 8085 OVERVIEW:
The 8085 Microprocessor uses a multiplexed address and data bus. The
address is split between the higher order 8-bit address and the lower 8-bit
address/data bus.
During the first clock cycle of machine cycle the lower order address
is sent out on address/data bus.
These lower order 8 bits may be latched externally by the Address latch
enable signal (ALE). During the rest of the machine cycle the data bus is
used for the memory/IO data.
8085 Microprocessor can access 64KB of external memory using its
16-bit address and memory read/write signals. Additionally it can access 256
bytes Input/Output devices using 8 address lines and IO read/write signals.
It has following set of registers:
A
Register (Accumulator)
Flag Register
5
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Of these BC , DE and HL in combination will act as 16 bit registers.
Internally it has Arithmetic Logic Unit (ALU), Instruction decoder,
Temporary registers and timing and control units.
Instruction set of 8085 Microprocessor include 8 bit addition and
subtraction, logical functions such as AND, OR, NOT. COMPARE etc.
INTERRUPTS:
The 8085 have 5 interrupt inputs, which are listed below:
External Interrupt (INTR)
RST 5.5 Interrupt
RST 6.5 Interrupt
RST 7.5 Interrupt
Trap
Of the above Trap is a non-maskable interrupt and normally used as
Power fail interrupt. RST 5.5 and RST 6.5 are high level sensitive like INTR
where as RST 7.5 is raising edge sensitive.
For RST 7.5 only a pulse is required to set an internal flip-flop, which
generates the internal interrupt request. The RST 7.5 request flip-flop
remains set until the request is serviced. This flip-flop may also be reset
using the SIM instruction.
PROGRAM STATUS WORD :The program status word is collection of Boolean flags, which retain
information concerning the state of users programs. The format of the PSW
is shown below.
6
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
07
06
05
04
03
02
01
00
AC
--
Sign bit
--
Zero flag
AC --
Auxiliary carry bit
--
Parity bit
--
Carry bit
--
Undefined
1.3 VIK-85L BOARD OVERVIEW:
The VIK-85L board is based on Intel 8085 Microprocessor, which
operates at 6.144 MHz. The board can operate using the 101/104 PC
keyboard supplied along with the trainer kit and 2 Line by 16-character LCD
display or from the PC (using the Terminal Emulation Software).
Microprocessors Address, Data and Control bus pins are brought to
the 50-pin FRC connector. VIK-85L is equipped with powerful software
monitor in 27C128 EPROM.
The monitor supports Video terminals RS232C interface, local 101
keyboard and LCD display. The board has 32KB CMOS static RAM (type
62256).
7
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
LCD
26 PIN CONNECTOR
BOTTOM
POWER SUPPLY CONNECTOR
KEY BOARD CONNECTOR
RS232 CONNECTOR
50 PIN CONNECTOR
26 PIN CONNECTOR
TOP
8
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
1.4 VIK-85L SPECIFICATIONS:
8085 Microprocessor operating at 6.144 MHz.
16KB powerful software monitor 27C128 EPROM.
Three 16 bit programmable timers from 8253/8254.
48 Programmable I/O lines from two nos. of 8255.
Serial interface using 8251.
50 Pin FRC connector for system bus expansion.
26 pin FRC connectors for user interface from 8255.
9 Pin D type female connector for RS 232C interface and 9 Pin
D type male connector for connecting to Power supply.
Six numbers of selectable baud rates from 150 to 9600.
101 PC type keyboard for entering user address/data and for
commands.
Built in line-by-line assembler and disassembler.
User-friendly software monitor for loading and executing
programs with break point facility.
Facility to connect to PC.
9
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
CHAPTER 2
SYSTEM DESCRIPTION
2.1 HARDWARE:
VIK-85L Microprocessor board designed around 8085 is ideal for
learning Microprocessors and peripherals.
The Microprocessor operates at 6.144 MHz using a 6.144 MHz crystal.
Lower bytes of address and data are multiplexed as in 8085 and hence a
decoder is necessary separate address and data. IC 74LS373 is used for this
purpose.
Firmware is stored in 27C128 EPROM. User data/programs can be
stored in 32KB CMOS static RAM (type 62256). Memory and I/O address
decoding signals are generated using simple 3 to 8 decoder 74139 and 7432
OR gates.
On board uses two 8255 ICs enhances the capabilities of the VIK-85L
kit. All the 48 I/O lines are brought to two 26-pin FRC connectors.
VIK-85L has onboard serial port; USART 8251A is used for this
purpose. MAX232 IC converts TTL transmit and receive signals to RS232C
levels. These signals are brought to 9 pin D type connector. This RS232
connector may be used for communicating with remote PC computer. Baud
rate of serial communication may be changed from 150 to 9600 baud.
10
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
One 3-channel timer IC of type 8253/8254 is provided in the board.
Transmit and receive clock for USART is obtained from Channel 0 of timer
IC 8253.
101 PC type keyboards is interfaced to Microprocessor through two
pins
of
8255
port
pins.
Communication
between
keyboard
and
Microprocessor takes place using 2 wires- one for serial clock and serial
data.
2 Line by 16 Character LCD display is directly connected to the bus
like a memory device. VIK-85L board is connected to the external power
supply using 9 pin D type connector.
2.2 PORT DETAILS:
DEVICE
ADDRESS
0000 3FFF
20 23
30 33
10 13
00 01
40 command
41 data
User RAM
8000 8FFF
A000 -- FFFF
(9000-9FFF reserved for
Monitor program)
EPROM
8255-1
8255-2
8253/8254
8251
LCD
11
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
2.3 POWER SUPPLY DETAILS:
VIK-85L trainer kit will work at 0 - 5v (1amp) from the power supply.
For your extra provision power supply have some dc Regulated voltage
outputs.
+5v
1Amp
+12v
250mA
-12v
250mA
12
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
2.4 KEYBOARD DETAILS:
101 PC type keyboard is interfaced to Microcontroller through its
port pins. Communication between keyboard and Microcontroller takes place
using 2 wires- one for serial clock and serial data.
13
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
CHAPTER 3
COMMANDS AND KEYS
To enter the commands and data 101 keyboard is provided along with
the board.
3.1 RESET:
This key is located in the main 85L board. On depressing this key the
program starts executing from the beginning or reset address 0000. On power
on reset it. Display VIK - 85 in local LCD display.
VIK 85
3.2 H (Help Menu):
This key is used go VIK-85L help menu and it will display the
following commands. Depressing the space bar key increments to display
the next command.
A <BEG>
B
D <BEG>
E<BEG><END>
G<BEG>
H
L<OFFSET>
M<ADDR>
N
Q
R<REG>
S
T<START><END><DS>
U<BEG><END>
-ASSEMBLE
-BAUD RATE
-DISASSEMBLE
-EXAMINE
-EXECUTE
-HELP COMMANDS
-DOWN LODE
-MODIFY
-NORMAL MODE
-QUIT
-REGISTER DISPLAY
-SERIAL MODE
-BLOCK TRANSFER
-UP LOAD
14
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
CHAPTER 4
OPERATING INSTRUCTIONS
4.1 POWER ON:
Connect the VIK-85L board to the power supply having the following
specifications.
+5V DC
1 Amp.
9 Pin D type connector is provided in the board for connecting it to the
external power supply.
Switch on the power supply after ensuring the correct voltages.
Following message will appear on the LCD display.
VIK 85
On power on or after reset the display shows VIK - 85 as a sign on
message. The prompt character is displayed in the next line informing the
user, the board is ready to accept the commands.
4.2 KEYBOARD OPERATION:
101 PC type keyboard is provided to enter the commands or functions
or data. Pressing any non-command key is aborted and waits for the valid
command.
15
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
4.3 ASSEMBLER & DISASSEMBLER:
VIK-85L permits the entry of programs using line-by-line assembler
facility available in the kit. It is also possible to disassemble the entered
programs.
4.4 ASSEMBLER:
Microprocessor/ Microcontroller executes programs entered in machine
code/ opcode it is highly cumbersome for the programmer to enter the
program in this method. However this is the best method as for as efficient or
program execution is concerned.
Next better technique is to enter the programs using the assembler.
Each instruction of Microprocessor/ Microcontroller is identified by specific
opcode or by mnemonics. Opcode program entry is by hex digits 0 to F
where as mnemonics uses alphabets A to Z.
Using assembler programs are entered through mnemonics, as it is
convenient for the programmer to remember the instruction set than that of
opcodes.
In line-by-line assembler as and when a line of entry is over the system
checks for validity of instruction and immediately converts to equivalent
opcode.
16
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
PROGRAM ENTRY USING ASSEMBLER:
VIK85-L is ready to accept the assembler entry command after power
on or after reset.
Commands can be entered in the second line of display and to enter
into assembler mode type A in the local keyboard. Next enter the starting
address from where the user program gets stored.
In VIK-85L, the user may enter the program from 8000-FFFF(if 32KB
RAM is installed). The range from 9F00-9FFF is used by Monitor Program
and on Reset SP is initialized at 9F00.
Example:
A9000
(Enter key =
On typing this line VIK-85L is ready to store the user program from
start address 9000.
Display the following and waits for the user data to be typed in the
second line.
9000:
-
ENTERING MNEMONICS:
As mentioned before, each instruction of Microprocessor can be
entered by specific set of characters- generally 2/3/4 letters followed by
respective operands.
List of instructions and mnemonics are given in the Appendix A.
17
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Example:
MOV A,B
Sequence for entering the above instruction is as follows.
Typing sequence
M
O
V
Space bar
A
,
B
Enter key
Example:
INC A
Typing sequence
I
N
C
Space bar
A
Enter key
As per the above procedure mnemonics are entered.
On completion of one line address, display in the first line
automatically gets incremented by respective value depending on the
instruction. Line by line assembler converts the entered mnemonics to
equivalent opcode and stores it in the displayed address.
If any wrong mnemonics or operands are entered ERROR message
is displayed.
18
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
On completion of one line of entry, the user may repeat the above
sequence of operation. Till the program is over or till the end of memory.
Termination of Assembler entry is by depressing two times of Enter key.
KEYS 0 TO F
These keys are used to enter hex address or data.
EDITING:
During the entry of mnemonics if any wrong entry is made it is
possible to edit it before depressing Enter key. Use the Backspace key in the
keyboard to erase the previous character and this process may be repeated till
the first character. Once a character is erased retype the correct character.
4.5 DISASSEMBLER:
Disassembler converts the hex bytes stored in the memory into
equivalent mnemonics. To enter into disassembler mode, type D in the
command mode followed by the memory address.
Example:
Assume following data is stored in the memory address 9000.
9000 3E
9001 0A
9002 00
To disassemble the above data type the following command
D9000
On completion of this command, the display is as follows.
9000
3E AA
MVI A,0A
19
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
To see the next lines depress Space bar key.
Display is
9002 00
NOP
In similar manner, the above sequence may be repeated and depressing
the Enter key can terminate this command.
4.6 M (MODIFY MEMORY COMMAND):
This key is used to display the external 64KB program memory area or
data. 32KB user memory may be modified in conjunction with cursor up and
down keys.
Enter key terminates the function.
Using this command the user can display/modify any external memory
address or Internal memory address.
ENTERING ADDRESS:
After depressing this key, the system is ready to accept the address
from the keyboard.
As 8085 is capable of addressing a maximum of 64KB memory, 4 hex
digits are required for address (0000-FFFF). As and when hex digits are
entered it is displayed in the LCD.
Only last four entries are retained.
20
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Address terminator is by Space bar key. On depressing this key, the
board displays the data of the selected memory address. Depressing any
other non-hex key results in error and aborts the current command and once
again waits for new command.
Cursor Up (Inc):
This key is used to increment memory address.
Cursor Down (Dec):
This key is used to decrement memory address.
ENTERING DATA:
Now, if required, entering the new data can modify data at the desired
address. Entry of data is also similar to that of address except it is 2 hex
digits instead of 4 hex digits. Terminator for data is Cursor up key or Cursor
down key or Enter key.
If data is terminator is Cursor up key the entered data is written in the
selected address and the next hex address with its data are displayed. Thus
using this key it is possible to enter opcode/data starting from the selected
address.
Cursor down key works in similar way as that of Cursor up key except
it decrements address each time when it is depressed.
As stated earlier the command can be aborted at any time using Enter
key.
21
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Example:
Key
Display In LCD
VIK - 85
-
VIK - 85
-M8
VIK - 85
-M84
VIK - 85
-M840
VIK - 85
-M8400
Enter
8400:
55 (previous data)
8400:
55 A
8400:
55 A3
Space bar
8401:
99 (previous data)
UP
8402:
66 (previous data)
UP
8403:
78 (previous data)
22
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
UP
8404:
9A (previous data)
DOWN
8403:
78
ENTER
VIK-85
-
(Next command expected)
Thus it is possible to load the opcode/data in memory and verify it
using M (MDFY),UP and DOWN keys.
Type M followed by desired address with termination by Enter key. As
in the local mode the system accepts only last four characters as address.
Example:
Typing M12349123 followed by Enter key displays address 9123 and
its data on the next line. Now the user can type in the desired data and this
also has to be terminated by Enter key. Terminating with Enter key modifies
data at address 9123 and returns back to initial command identification
mode.
However if space key is depressed then data is not only stored at
address 9123 but also displays the data at address 9124. In other words this is
similar to UP key operation. Hence it is possible enter data from the desired
address. This is a very useful feature for easy correction of entered
program/data.
Enter data 11 at 8400, 22 at 8401, 33 at 8402 and 44 at 8403.
M8400
23
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
8400-9811
space bar key
8401-2322
8402-3533
8403-4544
4.7 G (GO COMMAND):
This command is used to execute user programs from the specified
address.
Example:
G8500
Sequence for entering the above instruction is as follows.
Key
Display In LCD
VIK - 85
-
VIK - 85
-G8
VIK - 85
-G85
VIK 85
-G850
VIK - 85
-G8500
Enter
(jumps to user program)
24
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
The above command starts the program execution from address 8500.
If Enter key is depressed immediately after G, the program starts executing
from the value specified in PC of R command. Thus all register values
displayed in R command are initial values for user program address.
Enter Key (Exe)
This key is the terminating key for all functions and commands.
4.8 R (REIGSTER DISPLAY/MODIFY):
When this key is depressed it displays current register contents one
after another. After depressing this key the board waits for the register
number and Enter key from the user.
If for example, key B depressed and then Enter key the system will
display B contents.
As in the case of Modify, it is possible change the displayed register
contents. The entry is similar to that of data field entry. The termination for
register data entry is by Space bar key.
Entering Space bar key increments register number and its data is
displayed once again. Thus it is possible to display and modify all the sixteen
registers. Termination of this command is by Enter key.
Example 1:
Key
Display
R
A
Enter
-R
-RA
A = 12 (previous data)
25
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
3
4
Space bar
Enter
A = 12 3
A = 12 34
B = 89 (previous data)
VIK-85
-
After typing the R the user has a choice to display all registers by
depressing Enter key.
Example 2:
R (Enter key)
L=89
space bar key
A=55 space bar key
PC=8902
B=67
SP=9FF0
C=11
PSW=01
D=22
E=34
H=56
In the following example, A register value to be changed to 33 and B to
66.
Example 3:
RA (Enter key)
A=55 33
(space bar key)
B=67 66
(Enter key)
26
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Verify the changed register values:
R (Enter key)
L=89
(space bar key)
A=33 (space bar key)
PC=8902
B=66
SP=9FF0
C=11
PSW=01
D=22
E=34
H=56
4.9 T (TRANSFER COMMAND):
This command is useful for transferring data from one area to another.
The user has to specify the Source start address, Source end address and
Destination start address.
User can in Source start address and its delimiter with Space bar key.
Source end address is also keyed in similar way with Space bar key as
delimiter.
Next enter the Destination start address and its delimiter with Enter
key. On depressing the Enter key data is moved from one area to another.
Example:
T9000 90FF 9800 [Enter key]
The above command transfers the memory content starting from source
start address 9000 to destination start address 9800 till source end address
90FF is reached.
27
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Source start address
9000
Source end address
90FF
Destination start address
9800
4.10 B (BAUD RATE):
This key selects the baud rate for serial communication. On power on
reset the system selects default baud rate 2400.
When this key is depressed it displays the currently selected baud rate.
Default baud rate is 2400 baud and this will be selected during power on or
hardware reset and displayed in the first line. Second line display shows 150
baud.
By depressing the Space bar key the baud display can be changed from
150 to 300 and son on till 9600.
The system permits following baud rates:
9600 , 4800 , 2400 , 1200 , 600 , 300 and 150
By depressing the Enter key, the currently displayed baud rate is
selected for future serial communication (however, this will be modified if
reset key is depressed).
Note: Space bar key does not select the baud rate and is used to display
succeeding baud value only.
28
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
4.11 S (SERIAL MODE KEY):
When this key is depressed the system starts communicating through
RS232C connector. All keys are disabled except Reset and L.
The system displays the following message:
! SERIAL MODE
VIK-85L communicates with a remote Terminal or PC through the 9
pins RS 232 connector. Serial mode is established when S key is pressed in
the local keyboard.
Suitable baud rate should be selected prior to establishing the serial
communication. RS 232C connector details are given in appendix II
VIK-85L board data format is one start bit, 8 data bit (ASCII) and one
stop bit.
If serial communication is established the sign on message VIK-85
appears on the PC screen with prompt character in the next line indicating
the system is ready to accept commands from the user. Each command has to
be terminated by the Enter key of the PC and parameters are separated by
space key.
All the Commands, in the Local mode, can also be applied
in the serial mode. In addition serial mode has one more
command called E (Examine memory).
29
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
4.12 (Examine / Dump Memory):
This command will show the hex bytes on the console from the memory.
This command requires start address and end address.
Example:
E8500 85FF (Enter key)
This command will show hex bytes in the location from 8500 to 85ff.
4.13 N (Local Mode)
When this key is depressed, the system starts working through local 101
keyboard. Serial communication is disabled
!
NORMAL MODE
30
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
CHAPTER 5
TERMINAL EMULATION SOFTWARE
5.1 SERIAL PORT:
VIK-85L Microprocessor Trainer may be interfaced to a Personal
Computer using any PC terminal emulation software. Interface between
VIK-85L and PC is through RS232 connector.
5.2 SOFTWARE PACKAGE:
VIK-85L terminal emulation software is supplied on 1.44MB diskette
and contains the following programs.
TCSERIAL . EXE
31
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
CHAPTER 6
REMOTE OPERATION OF VIK-85L
Any IBM PC compatible PC or video terminal may be used for
communicating with VIK-85L via serial interface connector.
TCSERIAL software converts the PC to act as a video terminal. To
run this software type
TCSERIAL followed by Enter key in the PC.
Then display the following message
Enter the COM port number (type 1 or 2)
PC is now ready to send and receive the data from the VIK-85L.
32
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
May enter the COM port no and the baud rate as a command line arguments
Example:
D:\8086>TCSERIAL 1 6 [enter]
This will run the TCSERIAL program with the comport no 1
and it will do the communication with the baud rate of 4800 .
Different baud rates and their no. Are as follows
150 BR
-1
300 BR
-2
600 BR
-3
33
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
1200 BR - 4
2400 BR - 5
4800 BR - 6
9800 BR - 7
Depress S in the local keyboard of trainer kit. The kit displays the
following message.
! SERIAL MODE
Simultaneously prompt message VIK-85 message appears on the
screen indicating the kit is ready to accept the data from PC.
34
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
If you want to download any hex file from pc type the following
command
In serial mode local operation of the kit is inhibited except for reset key
and N.
To exit from this mode and to return to DOS mode, depress Esc
key
35
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
6.1 DOWNLOAD:
(DOWNLOADING OF DATA FROM PC TO KIT)
Depress S in the local keyboard of trainer kit. The kit displays the
following message.
!
SERIAL MODE
Simultaneously prompt message VIK-85 message appears on the pc
screen indicating the kit is ready to accept the data from PC.
If you want to download any hex file from pc type the following
command
L<OFFSET>
Depress key L in the PC keyboard (serial mode)
36
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Example:
L<0000>
Enter the file name =
(type the hex file name with .hex extension)
The user may key in the OFFSET address, which stores the data at
Offset plus received address. If Offset address is zero, the storing address is
same as that of received address.
Termination for the offset address is Enter key. Now the kit is ready to
accept the data from PC.
Example:
L<0200>
Enter the file name =
(type the hex file name with .hex extension)
In this command the Offset address is 200. So the storing address is
offset
From the received address
NOTE: If 8085 Cross Assembler package is available, it is possible to create
a hex file in PC. This hex code may be transferred to VIK-85L kit using the
download facility as explained above.
37
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
6.2 UPLOAD:
(UPLOADING OF DATA FROM KIT TO PC)
Depress U in the local keyboard.
The kit is ready to accept the start address. Enter the start address with
UP key as the termination key. This should be followed by the entry of end
address. Termination for end address is Enter key.
UPLOAD message is displayed in the LCD display and the data is
transferred to the PC and displayed simultaneously on the screen.
Example:
U8000 8500
This command will upload the hex byte in the location from 8000 to
8500
(Store the hex byte in Upld01.hex on dos prompt)
38
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
CHAPTER 7
PROGRAMMING DETAILS
This chapter describes the technique for development programs in
VIK-85L board. For the development of programs it is essential to get
familiar with the machine code of 8085 Microprocessor or mnemonics of
instruction set.
7.1 REGISTERS:
From the programmers point of view 8085 has the following registers:
A or Accumulator used for all logical and arithmetical
operations.
B, C, D, E, H and L registers are general-purpose registers.
Program Counter is 16 bit register capable of addressing from
0000-FFFF
Stack Pointer is an 16 bit register. It is initialized a value of
9F00,
Status/Flag register keeps track of flags.
7.2 MONITOR PROGRAM:
Monitor program uses following memory areas:
Program EPROM
0000-3FFF
External User RAM
8000-8FFF
A000-FFFF
39
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
User Interrupts
: External interrupts vectors to
address 9FC1 to 9FCA.
RST 5.5 Interrupt to vectors to address 9FC7
RST 6.5 Interrupt to vectors to address 9FC4
RST 7.5 Interrupt to vectors to address 9FC1
TRAP
Interrupt to vectors to address 9FCA
(the user has to enable desired interrupts in his program).
7.3 BREAKPOINT:
When writing programs it is essential to debug them and for this Break
points are necessary. Normally these are achieved by using software Break
points
Wherever Break points are required these could be set by entering
the opcode CF. As soon as Break points are encountered all the register
values are saved and displayed on the console or in local display.
It is possible to continue the program execution just by depressing G
and Enter in local mode.
BREAK POINT DISPLAY IN LOCAL MODE:
When Break point is encountered, all the register values are saved and
A=xx message is displayed in the LCD display. Now use Space bar key to
check register values one by one.
BREAK POINT DISPLAY IN SERIAL MODE:
When Break point is encountered, all the register values are saved and
all the Register contents are displayed in the console.
40
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
APPENDIX I
VIK 85L COMPONENT LIST
ICs:
U1
----------- 8085
U2
----------- 74LS373
U3
----------- 27C128
U4
----------- 62256
U5
----------- 7402
U6
----------- 74139
U7
----------- 74138
U8
----------- 8255
U9
----------- 8255
U10 ----------- 8253
U11 ----------- 8251
U12 ----------- MAX232
U13 ----------- 7404
CAPACITORS:
C1 TO C13
------------
0.1MF
C14
------------
1MF/25V
C15
------------
22MF/25V
C16
------------
22MF/25V
C17
------------
22MF/25V
C18
------------
22MF/25V
41
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
VIK 85L COMPONENT LIST
DISPLAYS:
L1
------------ LCD 2*16CHARACTERS
L2
------------ LED (GREEN)
RESISTORS:
R1
---------------
10K
R2
---------------
10K
R3
---------------
1K
R4
---------------
1K
R5
---------------
1K
R6
---------------
1K(Variable Resister)
R7
---------------
1K
R8
---------------
1K
R9
---------------
10K
R10 TO R14 ---------------
1K
R15
---------------
330
D1
---------------
1N4148
X1
---------------
6.144MHz
42
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
VIK 85L CONNECTOR DETAILS
APPENDIX II
50PIN FRC:
Pin Nos
Signal Details
A0
CS5
A1
CS3
A2
CS4
A3
CS6
A4
10
GND
11
A5
12
GND
13
A6
14
AD8
15
A7
16
AD9
17
HOLD
18
AD10
19
CS12
20
AD11
43
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Pin Nos
Signal Details
21
CS13
22
AD12
23
RST 5 . 5
24
AD13
25
RST6.5
26
AD14
27
RST 7.5
28
AD15
29
TRAP
30
PSENNC
31
SOD
32
ALE
33
SID
34
AD7
35
CS14
36
AD6
37
NC
38
AD5
39
HLDA
40
AD4
41
INTA
42
AD3
43
INTR
44
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Pin Nos
Signal Details
44
AD2
45
WR
46
AD1
47
RD
48
AD0
49
CLK
50
RESET
26PIN FRC (TOP):
1
PC3
PB0
PC2
PB1
PC1
PB2
PC0
PB3
PC4
10
PB4
11
PC5
12
PB5
13
PC6
14
PB6
15
PC7
45
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Pin Nos
Signal Details
16
PB7
17
RESET
18
GND
19
PA0
20
PA7
21
PA1
22
PA6
23
PA2
24
PA5
25
PA3
26
PA4
26PIN FRC (BOTTOM):
1
PC3
PB0
PC2
PB1
PC1
PB2
PC0
PB3
PC4
10
PB4
46
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Pin Nos
Signal Details
11
PC5
12
PB5
13
PC6
14
PB6
15
PC7
16
PB7
17
RESET
18
GND
19
PA0
20
PA7
21
PA1
22
PA6
23
PA2
24
PA5
25
PA3
26
PA4
47
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
5 PIN DIN CONNECTOR:
2 PC7 K/B DATA
5 VCC
3 NC
1 PC6 K\B CLK
4 GND
15 PIN D TYPE CONN (LCD):
GND
VCC
CONTRAST
R\D
W\D
LCD CE
D0
D1
D2
D3
D4
R\D
D5
D6
D7
BACK LIGHT
48
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
9 PIN 'D' TYPE (MALE):
Power supply connector:
Pin Nos
Signal Details
+5V
P2
NC
1
6
2
7
3
8
4
9
5
NC
GND
NC
GND
NC
NC
NC
CONNECTOR DB9
9 PIN DTYPE (FEMALE):
RS232 Connector
NC
NC
P2
1
6
2
7
3
8
4
9
5
RXD
CTS
TXD
NC
NC
NC
GND
CONNECTOR DB9
49
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
50
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
EXAMPLE PROGRAMS
8-BIT MULTIPLICATION
FLOW DIAGRAM:
START
Transfer the multiplier and multiplier to 2 separate register
NO
Is the
YES
Multiplier is
zero?
Transfer zero in result register
Initialize the content of a temporary register to zero
Add the multiplicand with the temp. Reg and
store it in temp. register
Decrement the multiplier
NO
Is the
Multiplier is
zero?
YES
Transfer the temp.reg value to result register
EXIT
51
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
PROGRAM:
INPUT
OUTPUT
START:
:
Multiplicand in 8500
Multiplier in 8501
:
Result is stored at 8502
Result is also in Acc .If the result exceeds FF the carry
flag will set.
Address Opcode Mnemonics
8100
3A 00 85
LDA 8500
8103
8104
8107
47
3A 01 85
4F
MOV B,A
LDA 8501
MOV C,A
8108
FE 00
CPI 00
810A
810D
CA 16 81
AF
JZ 8116
XRA A
810E
810f
8110
8113
8116
8119
80
OD
CA 16 81
C3 0E 81
32 02 85
CF
ADD B
DCR C
JZ 8116
JMP 810E
STA 8502
RST 1
Comments
; Mov the multiplicand (X1)
; to Acc. And also to B reg
; Mov the multiplier (x1) in to
; C reg
; If X2=0 then result is 0 and
; exit
; Exit addr=8116
; Clear acc and flags add the
; X1 as many time as the X2
; Decrement x2
; Store the result and exit
; Multiply start addr=810E
; Store the content of acc
; Break point
EX:
INPUT:
OUTPUT:
8500 - 0B
8501 - 0C
8502 - 84
*****
52
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
16-BIT MULTIPLICATION
FLOW DIAGRAM:
START
Transfer the multiplicand and multiplier to 2 separate reg pair.
NO
YES
Is
Multiplier
is zero?
Transfer zero to the result reg.
Initialize temp.reg pair to zero
Add the multiplicand with the temp.reg
Decrement multiplier
NO
Is the
Multiplier
is zero?
YES
Transfer the temp.reg content to result reg.
EXIT
53
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
INPUT :
OUTPUT:
Multiplicand (X1) Low Byte In 8500
High Byte In 8501
Multiplier (X2) In 8502 (8-Bit)
Result is stored at 8503 (low byte) and at 8504 (high byte)
Result is also in hl if the result exceeds FF the carry flag will
set
START:
Address Opcode
Mnemonics
8100
8103
8104
8105
8108
2A 00 85
54
5D
3A 02 85
4F
LHLD 8500
MOV D,H
MOV E,L
LDA 8502
MOV C,A
8109
FE 00
CPI 00
810B
810E
CA 19 81
21 00 00
JZ 8119
LXI H,0000
8111
19
DAD D
8112
8113
0D
CA 19 81
DCR C
JZ 8119
8116
C3 11 81
JMP 8111
8119
811C
22 03 85
CF
SHLD 8503
RST 1
EX:
INPUT:
8500: 0B ;LSB
8501: 0A ;MSB
8502: 03
Comments
; Move the x1 to HL pair
; Copy the x1 to DE pair
; Mov the multiplier (x2)
; into c reg
; If x2=0 then result is 0
; and exit
; Exit addr =8119
; Init the hl to 0 add x1 as
; many time as the x2
; 16 bit addition between hl
; and DE added value in HL
; Decrement x2
; Store the result and exit
; (exit addr=8119)
; Jump multiply (multiply =
; 8111)
; Store the content of acc
; Break point
OUTPUT:
8503: 21 ;LSB
8504: 1E ;MSB
*****
54
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
8-BIT DIVISION
FLOW DIAGRAM:
START
Transfer the dividend and divisor to 2
separate register r1 and r2
Initialize the temporary register 'zero'
YES
If dividend
is < divisor
NO
Subtract (dividend - divisor)
Store the dividend in
reminder reg
Store the result in dividend reg
Store the temp.reg 2
to quotient reg
Increment temp.reg 1
EXIT
if dividend
is < divisor
NO
YES
55
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
PROGRAM:
INPUT
8500
8501
Dividend
Divider
OUTPUT
8502
8503
Quotient
Reminder
START:
Address
8100
8103
8104
8107
8109
810A
810D
810E
810F
8112
8115
8516
8119
EX:
Opcode
Mnemonics
3A 01 85
47
3A 00 85
0E 00
B8
DA 12 81
90
0C
C3 09 81
32 03 85
79
32 02 85
CF
INPUT
RESULT
Comments
LDA 8501
MOV B,A ;BA
LDA 8500
MVI C,00
CMP B
JC 8112
SUB B
INR C
JMP 8109
STA 8503
MOV A,C
STA 8502
RST 1
:
; ADivider
; ADividend
; Count for quotient
; Check for A<B
; IF A<b then go to store
; A=A-B
; Count for quotient
; {8503}A--- Reminder
; A C quotient
; {8502} A Quotient
; Break point
8500
8501
Oa
02
8502
8503
05 Quotient
00 Reminder
(that is 0a/02)
******
56
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
BCD TO BINARY (Hexa decimal) CONVERTION
FLOW DIAGRAM:
START
Initialize the register r with zero.
Move the most significant byte to a temp.reg.
Move a count in temporary counter.
Add the reg r with temporary reg and result is stored in reg r.
Decrement the counter.
Yes
IS the
Counter
is zero?
No
Move the least significant byte to a temp.reg.
Add the reg r with temporary reg and result is stored in reg r.
EXIT
57
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
PROGRAM:
INPUT:
EX:
Low byte of BCD in 8500
= 09
(No should be 0 to 9)
High byte in next address 8501 = 09
(No should be 0 to 9)
OUTPUT:
Result is stored at 8502
= 63
START:
Address
Opcode
Mnemonics
8100
8103
21 01 85
7E
LXI H,8501
MOV A,M
8104
8105
87
47
ADD A
MOV B,A
8106
8107
8108
8109
87
87
80
2B
ADD A
ADD A
ADD B
DCX H
810A
86
ADD M
810B
23
INX H
810C
810D
810F
23
77
CF
INX H
MOV M,A
RST 1
Comments
; Get msb of bcd (x1) from
; 8051
; Now multiply x1 with 10
; Here multiplication is
; Done by addition method
; Now point the hl ptr at lsb
;of bcd (x2)
; Add x2 with the Acc
; content
; Now Acc .has the final
; result
; Store the result at 8502
; Break point
******
58
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
BINARY (hex) TO ASCII CONVERSION
FLOW DIAGRAM:
STRAT
Move the binary data to a temp.reg 1 & temp.reg 2.
To mask the higher nibble of the temp.reg 1.
NO
If the
value > 9
YES
Add '07'.
Add '30'
store it in memory location for lower nibble
.
Move the data in temp.reg 2 to temp.reg 1
Mask the lower nibble of the temp.reg.
59
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
A
NO
If the
value > 9
YES
Add '07'.
Add '30'
store it in memory location for higher nibble .
EXIT
PROGRAM:
INPUT :
OUTPUT:
EXAMPLE:
Binary hex byte in 8500.
ASCII of higher nibble is at 8501
ASCII of lower nibble is at 8502
IF
8500 A1
THEN
8501 41 ASCII OF 'A'
8502 31 ASCII OF '1'
60
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
START:
Address
Opcode
Mnemonics
8100
8103
8104
8105
8106
21 00 85
7E
47
23
0F
LXI H, 8500
MOV A,M
MOV B,A
INX H
RRC
8107
8108
8109
810A
0F
0F
0F
CD 15 81
RRC
RRC
RRC
CALL 8115
810D
77
MOV M,A
810E
810F
8110
23
78
CD 15 81
INX H
MOV A,B
CALL 8115
8113
77
MOV M,A
8114
CF
RST 1
Comments
; Acc (8500) hex byte
;B A
; Now HL=8501
; Bring the higher nibble
; to lower nibble of acc
; Now convert the lower
; nibble to ASCII
; Store that ASCII at
; 8501
; Now HL=8502
;AB
; Now convert the lower
; nibble to ASCII
; Store that ASCII at
; 8502
; Break point
ASCII :
This function converts the lower nibble of Acc to its ASCII
value.
8115
8117
8119
E6 OF
FE 0A
DA 1E 81
ANI 0F
CPI 0A
JC 811E
811C
C6 07
ADI 07
811E
8120
C6 30
C9
ADI 30
RET
; Mask the higher nibble
; Check is it greater then 9
; If A not >9 then simply add
; 30
; If A is > 9 then add 37 to
; get the respective ASCII.
******
61
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
ASSCENDING ORDER
FLOW DIAGRAM:
START
load the counter with the number of elements in the array
move the first data into the temp.reg
NO
If the
temp.reg data
< next data
swap the next data
and the data reg
YES
set the swap flag
Is the
count is
zero?
START
NO
YES
62
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Decrement the swap flag
YES
Start
Is the
swap flag is
zero ?
NO
Exit
PROGRAM:
INPUT:
OUTPUT:
EXAMPLE:
RESULT:
8500 no of elements in an array (count)
8500 starting address of array
The elements of the array are stored in ascending
order and stored in the same array.
8500
05 (count)
8501 08 , 02 , 01 , 05 , 09
8501 01 , 02 , 05 , 08 , 09
63
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
START:
Address Opcode
Mnemonics
Comments
; Flag for swapping
8100
8102
8105
06 00
21 00 85
4E
MVI B,00
LXI H,8500
MOV C,M
8106
8107
810A
0D
CA 20 81
23
DCR C
JZ 8120
INX H
810B
7E
MOV A,M
810C
23
INX H
810D
810E
BE
DA 18 81
CMP M
JC 8118
8111
8112
8113
8114
8115
56
77
2B
72
23
MOV D,M
MOV M ,A
DCX H
MOV M,D
INX H
8116
06 01
MVI B,01
; Now move m ptr to the
; next byte
; Set the swap flag.
8118
0D
DCR C
; Decrement the count
8119
C2 0B 81
JNZ 810B
; If C
811C
05
DCR B
; After C=0 check the swap
; Load the count in to the C
; reg.
; If C = 1 no process
; Jump to 8120(prog end)
; Move the memory pointer
; to start address of array
; Get the byte pointed by
; m ptr
; Move the m ptr to next
; byte
; Compare with Acc.
; If Acc < m then no
; swapping
; Else swap the bytes
0then jump 810b
; flag.
811D
CA 00 81
JZ 8100
; If it is set then once
; again continue the
; process at the final Stage
; B will not set so the
; program will terminate
8120
CF
RST 1
; Break point
64
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
DESCENDING ORDER
START
load the counter with the number of elements in the array
move the first data into the temp.reg
NO
If the
temp.reg data
> next data
swap the next data
and the data reg
YES
set the swap flag
Is the
count is
zero?
START
NO
YES
65
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
Decrement the swap flag
YES
Start
Is the
swap flag is
zero ?
NO
Exit
PROGRAM:
INPUT:
OUTPUT:
EXAMPLE:
RESULT:
8500 no of elements in an array (count)
8500 starting address of array
The elements of the array are stored in
Descending order and stored in the same array.
8500
05 (count)
8501 08 , 02 , 01 , 05 , 09
8501 09 , 08 , 05 , 02 , 01
66
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
START:
Address Opcode
Mnemonics
Comments
; Flag for swapping
8100
8102
8105
06 00
21 00 85
4E
MVI B,00
LXI H,8500
MOV C,M
8106
8107
810A
0D
CA 20 81
23
DCR C
JZ 8120
INX H
810B
7E
MOV A,M
810C
23
INX H
810D
810E
BE
D2 18 81
CMP M
JNC 8118
8111
56
MOV D,M
8112
8113
8114
8115
77
2B
72
23
MOV M,A
DCX H
MOV M,D
INX H
8116
8118
8119
811C
06 01
0D
C2 0B 81
05
MVI B,01
DCR C
JNZ 810B
DCR B
811D
CA 00 81
JZ 8100
8120
CF
RST 1
; Load the count in to the
; C reg
; If C = 1 no process
; Jump to 8120(prog end)
; Move the memory
; pointer to start address
; of array
; Get the byte pointed by
; m ptr
; Move the m ptr to next
; byte
; Compare with Acc.
; If Acc < m then no
; swapping
; Else swap the bytes
; Now move m ptr to the
; next byte
; Set the swap flag.
; Decrement the count
; If C 0then jump 810b
; After C=0 check the
; swap flag.
; If it is set then once
; again
; Continue the process at
; the final stage B will not
; set so the program will
; terminate
; Break point
******
67
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
BIGGEST NUMBER IN AN ARRAY
FLOW DIAGRAM:
START
Load in number of elements in an array to a counter.
Yes
Is the
EXIT
Counter is zero?
No
Is the
Move the data to a
result reg.
Counter is one?
YES
No
EXIT
Move the data to a
Temp.reg .
No
If the Next
Data<temp.reg
data
Yes
Decrement the
counter.
A
68
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
No
Is the
Counter zero?
Yes
Store the temp.reg value to result reg.
EXIT
PROGRAM:
INPUT:
8500 No of elements in an array (count)
8501 Array starts from here
OUTPUT:
Acc and 8510 will contain the biggest no of the
array.
EXAMPLE:
8500
8501
8510
Acc
05
08 , 02 ,01 , 05 , 09
09
09
69
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
START:
Address Opcode Mnemonics
8100
8103
8104
8105
8108
21 00 85
4E
0D
CA 1B 81
23
LXI H,8500
MOV C,M
DCR C
JZ 811B
INX H
8109
810A
810B
810C
810F
8110
8111
8114
8117
8118
811B
7E
23
BE
D2 10 81
7E
0D
C2 0A 81
C3 18 81
7E
32 10 85
CF
MOV A,M
INX H
CMP M
JNC 8110
MOV A,M
DCR C
JNZ 810A
JNZ 8118
MOV A,M
STA 8510
RST 1
Comments
; Load the count
; Load the count in to C reg
; If count =0 then exit
; Get the num and exit
; Move the memory pointer
;to start address
; Get the byte pointed by m ptr
; Move them ptr to the next byte
; Compare with Acc.
; If Acc > m then no swapping.
; Else get the large no in to Acc.
; Decrement the count.
; If C=0 then jump 810A
; Store the biggest num
; Break Point
******
70
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
VERIFING THE PORTS OF 8255
FLOW DIAGRAM:
START
Initialize the ports as output port.
Load the data in temp.reg.
output to port A .
load the data in temp.reg .
output to port B .
Load the data in temp.reg .
output to port C .
EXIT
71
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
START:
Address Opcode
Mnemonics
Comments
8100
3E 80
MVI A,80
; Load the control word
8102
D3 23
OUT 23
; output to control reg
8104
3E 44
MVI A,44
; Load data in Acc
8106
D3 20
OUT 20
; output to port A
8108
3E 88
MVI A,88
; Load data in Acc.
810A
D3 21
OUT 21
; output to port B.
810C
3E FF
MVI A,FF
; Load data
810E
D3 22
OUT 22
; output to port C
8110
CF
RST 1
; Break point
******
72
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
SQUARE WAVE GENERATION USING 8253/54
FLOW DIAGRAM:
START
Initialize the control register of 8253
.
load '02' into LSB of counter 2 .
load '00' into MSB of counter 2 .
START
73
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972
VIK-85L OPERATING MANUAL
PROGRAM:
OUTPUT:
This program will generate the square wave of
Frequency 625 KHz.
Observe the wave form at pin no 10 of 8253 IC
START:
Address
Opcode Mnemonics
Comments
8100
8102
3E B7
D3 13
MVI A,B7
OUT 13
8104
8106
3E 02
D3 12
MVI A,02
OUT 12
8108
810A
3E 00
D3 12
MVI A,00
OUT 12
810C
CF
RST 1
; Load the control word in Acc
; output the Acc content to
; control reg (I/O addr.13)
; Load lsb count in the Acc.
; output the Acc content to
; counter2
; Load MSB count in Acc
; Output the Acc content to
; counter2
; Break point
******
74
VIKASHA ELECTRONICS (MADRAS) PVT LTD, CHENNAI- 32, PH-22501972