Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block...

80
Advanced 8086 Microprocessor Trainer NV5586A Learning Material Ver 1.0 Designed & Manufactured by: 141-B, Electronic Complex, Pardesipura, Indore- 452 010 India, Tel.: 91-731- 4211500, Telefax: 91-731-4202959, Toll free: 1800-103-5050, E-mail: [email protected] Website: www.nvistech.com www.hik-consulting.pl

Transcript of Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block...

Page 1: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

Advanced 8086 Microprocessor TrainerNV5586A

Learning MaterialVer 1.0

Designed & Manufactured by:

141-B, Electronic Complex, Pardesipura, Indore- 452 010 India, Tel.: 91-731- 4211500,

Telefax: 91-731-4202959, Toll free: 1800-103-5050, E-mail: [email protected]

Website: www.nvistech.com

www.hik-consulting.pl

Page 2: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 2

Advanced 8086 Microprocessor TrainerNV5586A

Table of Contents

1. System Introduction 3

2. System Specifications 4

3. System Capabilities 5

4. Hardware Description 6

5. Command Description 18

6. Memory I/O Mapping 28

7. Subroutines 30

8. Serial Communication 40

9. MASM Macro Assembler 44

10. Sample Programs 47

11. On-Board Interface 68

12. Parallel Commutation between two NV5586A Trainers using 8255 in i/o mode 71

13. Serial Commutation between two NV5586A Trainers 72

14. Connector/Jumper Details 73

15. Jumper/DIP switch Details 76

16. Block Diagram 77

17. Warranty 78

18. List of Service Centers 79

19. List of Accessories 80

www.hik-consulting.pl

Page 3: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 3

System IntroductionGeneral Description:NV5586A is a single board microprocessor training/development kit configured around the Intel’s 16bit Microprocessor 8086. This kit can be used to train engineers, to control any industrial process and todevelop software for 8086 systems.

The kit has been designed to operate in the max. mode. Co-processor 8087 and I/O Processor 8089 canbe added on board.

The Kit communicates with the outside world through an IBM PC compatible Keyboard with 20x2LCD Display. The kit also has the capacity of interacting with PC.

NV5586A is packed up with powerful monitor in 128K Bytes of factory programmed EPROMS and32K Bytes of Read/Write Memory. The total memory on the board is 144K Bytes. The system has 72programmable I/O lines. The serial I/O Communication is made possible through 8251.

For control applications, three 16 bit Timer/Counters are available through 8253. For real timeapplications, the 8 level of interrupt are provided through 8259. NV5586A provides onboard batteryback up for onboard RAM. This saves the user’s program in case of power failure.

The onboard resident system monitor software is very powerful. It provides various softwarecommands like BLOCK MOVE, SINGLE STEP, EXECUTE, FILL etc. Which are helpful indebugging/developing software. An onboard line assembler provides user to write program inassembling language.

www.hik-consulting.pl

Page 4: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 4

System Specifications

Central Processor : 8086, 16 bit Microprocessor operating in max. mode.

Co-Processor Support : Support 8087 Numeric Data Processor.

I/O Processor Support : Support 8089 I/O Processor.

EPROM : 128K Bytes of EPROM Loaded with monitor program.

RAM : 32K bytes of CMOS RAM with Battery Backup using 3.6V Ni-CdBattery.

Parallel : 72 I/O lines using three nos. of 8255.

Serial : RS-232-C Interface using 8251.

Interrupt : 8 different level interrupt using 8259.

Timer/Counter : Three 16 bit Timer/Counter using 8253.

Keyboard & Display : 105 IBM PC Keyboard & 20x2 LCD Display.

BUS : All address, data and control signals (TTL Compatible) available at 50Pin & 20 Pin FRC Connector.

Power Supply : 5V/ 2 Amps, ±12V/250mA

Physical Size : 32.6cm x 25.2cm

Operating Temp. : 0 to 50°C.

www.hik-consulting.pl

Page 5: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 5

System Capabilities

Keyboard Mode:

1. Examine/Modify the memory byte locations.

2. Examine/Modify the contents of any of internal register of 8086.

3. Move a block of Data/Program from one location to another location.

4. Fill a particular memory area with a constant.

5. To execute the program in full clock speed.

6. To execute program in single instruction execution.

System Installation:

To install NV5586A the following additional things are required.

1. Connect the External SMPS Power Supply to AC Power and 5 pin connector to the left side on NV5586AKit.

2. Switch on the Power Supply at the rear end of SMPS supply.

3. A message – NV5586A 8086 Mic.Tr. will come on display (PRESS RESET if you do not get - NV5586A8086 Mic.Tr.

4. Now NV5586A Kit is ready for the user's experiments for Keyboard Mode commands.

www.hik-consulting.pl

Page 6: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 6

Hardware DescriptionCPU:8086 is a 16 bit, third generation microprocessor and is suitable for an exceptionally wide spectrum ofmicrocomputer applications. This flexibility is one of most outstanding characteristics.

8086 has got 16 data lines and 20 address lines. The lower 16 address lines are multiplexed with 16 data lines.Hence it becomes necessary to latch the address lines. This is done by using 74 LS 373. In fact several of the 40CPU pins have dual functions that are selected by a strapping pin. In this kit 8086 is used in the max. mode(MN/Mx input held logically low).

The 8088 is designed with an 8-bit external path to memory and I/O. Except that the 8086 can transfer 16 bits ata time, the two processors & software are identical in almost every respect. Software identical in almost everyrespect. Software written for one CPU will execute on the other without alteration. The two processors aredesigned to operate with the 8089 I/O processors and other processors in multiprocessing and distributedprocessing systems.

The INTR, TEST & Hold Inputs to 8086 are pulled down and are brought out at PCB FRC connector.

The mask able interrupt INTR is available to the peripheral circuits through the expansion Bus. To use the maskable interrupt an interrupt vector pointer must be provided on the data bus when INTA is active. An interruptController Circuit is provided to take care of more than one source of interrupt.

Co-Processor 8087:The 8087 Co-processor “hooks” have been designed into the 8086 and 8088 so that these types of processor canbe accommodated in the future. A co-processor differs from an independent processor in that it obtains itsinstructions from another processor, called a host. The co-processor monitors instructions fetched by the hostand recognizes certain of these as its own and executes them. A co-processor, in effect, extends the instructionset of its host computer.

I/O Processor 8089:The 8086 and 8088 are designed to be used with the 8089 in high performance I/O applications. The 8089 inconceptually resembles a microprocessor with two DMA channels and an instruction set specifically tailored forI/O operations. Unlike simple DMA controllers, the 8089 can service I/O devices directly, removing this taskfrom the CPU. In addition, it can transfer data on its own bus or on the system bus, can match 8-bit or 16-bitperipherals to 8-bit or 16-bit buses, and can transfer data from memory to memory and from I/O devices to I/Odevice. 8089 has been used here in local mode. The system bus, can match 8-bit or 16-bit peripherals to 8-bit or16-bit buses, and can transfer data from memory to memory and from I/O devices to I/O device. 8089 has beenused here in local mode.

Clock Generation:The clock generator circuit is an Intel’s 8284 clock generator/driver. The circuit accepts a crystal input whichoperates at a fundamental frequency of 6.144 MHz. (6.14 MHz was selected since this frequency is a multiple ofthe baud rate clock and also provides a suitable frequency for the CPU). The clock generator/driver divides thecrystal frequency by three to produce the 2MHz CLK signal required by the CPU. Additionally, the clockgenerator performs a further divide-by-two output called PCLK (peripheral clock) which is the primary clocksignal used by the remainder of the circuits.

The clock generator/driver provides two control signal outputs which are synchronized (internally) to the 2 MHzCLK signal; RDY (ready) and RST (reset). RST is used to reset the NV5586A to an initialized state that occurswhen the RES input goes low (when power first is applied or when the SYSTEM RESET key is pressed). TheRDY output is active (logically high) when the RDY 1 input from the wait state generator is active. As will beexplained in the next section, the RDY 1 input is active whenever onboard memory is addressed or when aselected number of “wait states” occurs.The system can operate at either 2 MHz or 1 MHz. This is selected by a set of jumpers JP3 on the right handside of the 8284 clock generator as shown below:

1. 2 MHz (UPPER)

2. CLK

3. 1 MHz (LOWER)

The NV5586A is supplied in 2 MHz configuration.

www.hik-consulting.pl

Page 7: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 7

Bus Controller:The 8288 is a Bus Controller which decodes status signals output by an 8089, or a maximum mode 8086. Whenthese signals indicate that the processor is to run a bus cycle, the 8288 issues a bus command that identifies thebus cycle as memory read, memory write, I/O read, I/O write, etc. It also provides a signal that strobes theaddress into latches. The 8288 provides the drive level needed for the bus control lines in medium to largesystems.

Memory:NV5586A provides 128K Bytes of EPROM loaded with monitor and 32K bytes of CMOS RAM. The totalonboard memory can be configured as follows:

EPROM - 128K Bytes of EPROM using two 27C512.

RAM - 32K Bytes of RAM.

The system provides two 28 Pin sockets for the EPROM area named as EVEN-ROM & ODD-ROM and two 28Pin sockets for the RAM area named as EVEN-RAM & ODD-RAM. EVEN-ROM & ODD-ROM can be definedto have EPROM 27512.

With the 20 bit address of 8086, a total of 1 Mega Bytes of memory can be addressed with the address slot as00000 to FFFFF. Although the total onboard memory capacity is 180K Bytes 128K Bytes of EPROM and 32KBytes of RAM.

8255:

8255 is a programmable peripheral interface (PPI) designed to use with 8086 Microprocessor. This basicallyacts as a general purpose I/O component to interface peripheral equipments to the system bus. It is not necessaryto have an external logic interface with peripheral devices since the functional configuration of 8255 isprogrammed by the system software. It has got three input/output ports of 8 lines each (PORT-A, PORT-B andPORT-C). Port-C can be divided into two ports of 4 lines each named as Port-C upper and Port-C lower. AnyInput/Output combination of Port-A, Port-B, Port-C upper and Port-C lower can be defined using the appropriatesoftware commands. The Port addresses for these ports are given here. NV5586A provides nine Input/Outputports of 8 lines each using three 8255 chips. These ports are brought out at connectors.

8253:

This chip is a programmable interval timer/counter and can be used for the generation of accurate time delaysunder software control. Various other functions that can be implemented with this chip are programmable rategenerator. Event Counter, Binary rate multiplier, real time clock etc. This chip has got three independent 16 bitcounters each having a count rate of up to 2 MHz. The CLK, GATE & OUT signals of these timers are broughtout at the connector.

8251:

This chip is a programmable communication interface and is used as a peripheral device. This device acceptsdata characters from the CPU in parallel form and then converts them into a continuous serial data stream fortransmission. Simultaneously it can receive serial data stream and converts them into parallel data characters forthe CPU. This chip will signal the CPU whenever it can accept a new character for transmission or whenever ithas received a character for the CPU. The CPU can read the complete status of it at any time. 8251 has beenutilized in NV5586A for RS-232-C serial interface.

8259:

The 8259 is a device specifically designed for use in real time, interrupt driven microcomputer systems. Itmanages eight levels of requests and has built in features for expandability to other 8259’s. It is programmed bysystem’s software as an I/O peripheral. A selection of priority modes in which the requests are processed by8259 can be configured to match his system requirements. The priority modes can be changed or reconfigureddynamically at any time during the main program.

Battery Backup:The NV5586A provides a battery back up for the onboard RAM area using 3.6V Ni-Cd Rechargeable battery.NV5586A has facility for connecting +5V to the RAM area if the Ni-Cd battery fails. The selection for +5V orBattery supply Jumper (JP2).

www.hik-consulting.pl

Page 8: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 8

Display:This display contains 2 lines and each line consists of 20 words (20x2). This is a cursor LCD display modular.The CPU receives each 8 bits letter which is locked into the internal display data of RAM (data display of RAM80 bytes (D.D.RAM) allows 80 characters to be stored), and transfer to 5x7 dot of array word and appear on thedisplayed.

This LCD modular contains the word generator ROM that will supply 160 different 5x7 dot of array word andalso a 64 bytes word generator RAM. Users can define 8 types 5x7 dot of array word.

The position of word display goes into the LCD Modular through the data bus in CPU. Next through theinstruction register and finally write the words into the data register to display on a specific location. The LCDModular will automatically increase or decrease the words in order to move to different addresses. The user cantherefore continue sending in word code. The cursor as to moved around or moved in the right of left direction.

Specification of Display:

Display data RAM : 80 x 8 BLT (80 words)

Character generator ROM : 160 of 5x7 dot of array word

Character generator RAM : 8 different users programmed 5x7 dot of array

Kinds of instructions : Clear the display, send cursor home (HOME), ON/OFF display. CursorON/OFF, character blinking cursor move to another position, displaychange position.

When the internal power is on, the circuit is reset. Internal circuit vibrator.

Functional Block Diagram Figure 1

www.hik-consulting.pl

Page 9: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 9

Note: Some models incorporate a temperature compensation circuit within the bias voltage generator.

The LCD modular has 2 8-bits register-one instruction register (IR) and one data register (DR).

The instruction register stores the instruction code and address information, which contains display dataRAM and address of character generator RAM. However, the content of IR is only for read-in but notread-out.

The data register can only temporary store data, the input data first goes through LCD and is stored inthe data register. It will then automatically be transferred to display data RAM or character generatorRAM.When the CPU read the data from the displayed RAM or from the character generator RAM, itwills also temporary store the data in the data register. When the address information is input into theinstruction register, the relative data will be moved from display register RAM or character generatorRAM to the data register. Then the data can be read from data register by using the output instruction ofCPU.

One way to select the two registers is to select the register signal (RS) like follow:

RS R/W Function

0 0 Data Bus —> instruction Register

0 1 Read out busy flags (BUSY FLAG DB7) and address counter (DB0-DB6)

1 0 Input into data register and execute the inner instruction: (D.R.RAM—>D.R. OR C.G.RAM — D.R.)

1 1 Get the data out form register, and execute the inner instruction:(D.D.RAM—> D.R. OR C.G.RAM—> D.R.)

Busy Flag (B.F.):

When busy flag is “1”, it indicates that the LCD Modular is executing the inner instruction and no otherinstruction can be accepted. The LCD Modular can only accept information when BF is lower to “0”.

Address Counter (A.C.):

The address counter is used to count the display data RAM, or address of character generator RAM. When theaddress setting instruction address will be sent into the address counter.

When the data is sent into or read out from display register RAM or from the character generator RAM, theaddress counter will automatically add or subtract 1.

When the content of address counter is in RS = 0 and R/W = 1, the output data line is DB0 DB6.

Display Data RAM (D.D. RAM):

This is an 80x8 bit RAM, which can store 80 8-bit character codes as the display data; it can be sent to CPU asthe RAM data section without going through RAM section.

Address setting of data display RAM is as followed:

High level bus Low level bus

AC6 AC5 AC4 AC3 AC2 AC1 AC0

Data displays RAM and display position of LCD is as followed:

Character Position: 1 2 3 4 5 6 7 8 9 10 11…19 20(Decimal)

First Line: 00 01 02 03 04 05 06 07 08 09 0A..16 17(Hexadecimal)

Second Line: 40 41 42 43 44 45 46 47 48 49 4A...56 57(Hexadecimal)

www.hik-consulting.pl

Page 10: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 10

Character Generator ROM (C.G. ROM):

This ROM generates 5x7 dot of array character has 160 different 8-bit character code. The shape and code areshown in Table 2 and 3.

Character Generator RAM (C.G.RAM):

This RAM stores 8 different 5x7 dot of array character which allows the user to design the program. When thecharacter codes are stored in the C.G.RAM, which are the same as the characters in Table 2 and 3, they will besent to display data RAM. The display data and characters are shown in Table 4.

Timing Generator:

Sending signals into the inner register during generating process.

Character Codes:

www.hik-consulting.pl

Page 11: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 11

Note:

1. The CG RAM generates character patterns in accordance with the user’s program.

2. Shaded areas indicate 5x10 dot character patterns.

Character code:

Note :

1. The CG RAM generates character patterns in accordance with the user’s program.

2. Shaded areas indicate 5x10 dot character patterns.

www.hik-consulting.pl

Page 12: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 12

Relationship among Character Code:

(DD RAM), CG RAM Address, And Character Pattern (CG RAM)

Character Pattern for 5x7 Foat

* Signifies a “don’t care” bit.

Note:

1. Character code bits 0-2 correspond to CG RAM address bits 3-5. Each of the 8 unique bit stringsdesignated one of the 8 character patterns.

2. A CG RAM address bit 0-2 designates the row position of each character pattern. The 8 the row is thecursor position. CG RAM data in the 8 the row is OR’ed with the display cursor. Any “1” bits in the 8 therow will result in the displayed dot regardless of the cursor status (ON/OFF). Accordingly, if the cursor isto be used, CG RAM data for the 8 the row should be set to “0”.

3. CG RAM data bits 0-4 correspond to the column position of each character pattern bit 4 corresponding tothe leftmost column of the character pattern CG RAM data bus are not used for displaying characterpatterns, but may be used as a general.

4. As shown in tables 2 and 3, character patterns in the CG RAM are accessed by character codes with bits 4-7 equal to “0”. For example, the character code “00” (HEX) or “80” (HEX), since bit 3 of the charactercode is a don’t care bit (i.e. can take either value “0” or “1”).

5. CG RAM data “1” produces a dark dot, and data “0” produces a light dot in the corresponding position onthe display panel.

www.hik-consulting.pl

Page 13: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 13

Functions of Reset:

Using the Internal Reset Circuit to Start:

LCD Modular internal has an automatic power supply to be used to RESET when the power rises. DuringRESET, the busy flag is set. When the voltage is raised to 4.5V in about 10ms, it is in the busy stage. Thefollowing instructions are then used to set the beginning stage of LCD.

1. Clear display

2. Function set

DL = 1 8-bit data length interface

N = 0 (single line display)

F = 0 The source of 5x7 dot of array character

3. Display ON/OFF control

D = 1 Display OFF

C = 0 Cursor OFF

B = 0 Character flashing function OFF

4. Entry mode set

I/D = 1 Increase mode

S = 0 Display OFF

Note : If the time for the power to increases from 0.2V to 4.5V is greater than 0.1ms but less than 10ms, thecurrent cut-off will drop to 0.2V before it rises again. If it takes more than 1ms, the LCD modular willautomatically RESET. Otherwise, it has to depend on an external software instruction to RESET (As describebelow).

Diagram of module RESET power.

Figure 2

www.hik-consulting.pl

Page 14: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 14

Instruction Set:

Note :

1. Symbol “*” signifies a “don’t care” bit

2. Correct input value for “N” is predetermined for each model

www.hik-consulting.pl

Page 15: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 15

Initialization by Instructions:If the power conditions for the normal operation of the internal reset circuit are not satisfied.

LCD unit must be initialized by executing a sense of the instructions. The procedure fro this initializationprocess is as follows.

Instruction Description:

When the LCD is controlled by the CPU, only the instruction register (IR) and the data register (DR) can be readdirectly by the CPU. The commands from outside the modular can decide the internal operation of LCD. Thesecommands include the register selection (RS) signals, read/write (R/W) signals, and data buffering signals (DB0-DB6).

Table 5 lists all the useful commands in the LCD modular and the execution time, these commands are dividedinto the following group:

1. Commands of set LCD module

2. Commands of internal set address RAM

3. Commands of data transfer in or out from the internal RAM

4. Other commands

When the LCD modular is executing a command it will reject other commands. Except the “busy flag/readaddress counter, the internal counting period of busy flag is set to as “1”. If the CPU wants to send in othercommands it will have to check the busy flag first, until it is cleared to “0” before it send in. The explanation isas followed:

www.hik-consulting.pl

Page 16: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 16

Display Clear command:This command will put the display data into a empty space” code (20H), address counter will be cleared to 0.When executing this command, display OFF, the cursor or the character blinking function will be moved to themost left side if it is in the set condition.

Display/Cursor Home:The address counter will be cleared to 0, content of D.D. RAM will not be influenced; but if the cursor or thecharacter blinking function is in the set condition, it will be moved to the most left side position.

Entry Mode Set:I/D bit = “1”, “1” is added in the address counter after each time it read/write a display data RAM character code,so that the cursor or the character blinking function will move one place to the left and vise-versa when I/D=0.The read/write (R/W) character generator also has the same function.

S bit = 1, but each time it read/write a display data RAM code, it will move to the display direction and moveone space to the left (I/D=0) or one space to the right (I/D=1). When S=0, the display will not move.

When data enters the character generator RAM, the display will not move.

Display ON/OFF:D: D=1 - Display ON

D=0 - Display OFF

C: C=1 - Cursor display on the display address of the display counter

C=0 - Cursor does not display

B: B=1 - Character blinking of cursor position at feq or fosc=250KHz freq, therefore all blackpoints and character display will exchange with each other. Each character display and overshadow 409.6ms.

Display/Cursor Shift:S/C R/L

0 0 - Cursor move to the left (AC <—AC-1)

0 0 - Cursor move to the right (AC <—AC+1)

1 0 - All the characters and cursor move to the left

1 1 - All the characters and cursor move to the right

Note: When the display moves, the address counter will not move.

Function Set:

DL : Select data length for the interface circuit.

DL=1 - Using the 8 bits data length.

DL=0 - Using the 4 bits data length.

N : Select the display format (one or two lines)

C.G. RAM Address Set:Address counter and character generator RAM have address which is driven by the binary 6-bit. When thisinstruction is driven in, data can be sent into the CPU and character generator -RAM.

D.D. RAM Address Set:Address counter and display data RAM have addresses which are driven by the binary 7-bit. When thisinstruction is driven in, data can be sent into the CPU and the display data RAM. When N=0 (a single linedisplay), binary code ADD between 00H and 4FH; when N=1 (a two lines display), the binary code ADD from00H until 27H as the first line of from 40H until 67H as the second line.

Read Busy Flag/Address Counter:The busy flag (BF) in LCD can be read from the CPU, using the instruction of LCD modular is the execution ofthe internal instruction BF = 1 represents the busy stage (execution of the internal instruction), it will not acceptany instruction at this time until BF = 0.

www.hik-consulting.pl

Page 17: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 17

Content of address counter and the busy flag will be read out at the same time, it is a 7-bit binary, the addresscounter will instruct one of the addresses, either the character generator RAM or display data RAM. This isdetermined by the final input address set instruction.

Send Data Into C.G. RAM/D.D. RAM:Data with 8-bit in length can be sent into the character generator RAM or the display data RAM. The address ofthe input data is instructed by the address counter, however, the address of address counter is influenced by thefinal input address set instruction.

After data input whether the address counter add 1 or minus 1 is determined by the design of the module. It canalso be designed as location movement of the display.

Read Data Out of C.G. RAM/D.D. RAM:Character generator RAM with 8-bit in length or the display data RAM can be read by the CPU. The read outdata address is instructed by the address counter. The address counter is instructed by the final input address setinstruction.

This instruction has to be set in C.G. RAM/D.D. RAM address, once shift cursor instruction of the C.G.RAM/D.D. RAM data is read out, no other instruction can be read out.

The address setting instruction will read the data address into address counter.

Shift cursor command will allow the previous address setting to be used again in order to read the D.D. RAMdata. The data can be read from the C.G. RAM/D.D. RAM after the cursor shift.

After the execution of data address counter add 1 or minus 1 will be set in the LCD modular.

After the execution of data read out, the display will not shift.

The operation of this device is similarly with the operation of IBM PC’s DEBUG system. For convenience, theoperation instructions will be displayed when the device is being switched on or RESET.

This device also has memory ability to preserve data for future use. There is a memory indicator on the displayonce the data being kept after Reset. The system program starts from 0000:0000 after reset, in order to check thelength of the RAM, there is a byte to be inverted and returned to the original for every 4K in length, the verifyingprocedure will be repeated until none of the byte can be inverted. During this period, avoid using the RESET toprevent the data from unable to return to the original setting. The RAM address is to be displayed by 4 positionsand up to FFFFH, however, 5 positions will be used if it exceeds FFFFH.

Operating Commands:After power ON the system, it will display as follows:

After pressing <Enter>, the operating commands will be displayed:

www.hik-consulting.pl

Page 18: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 18

BackSpace

Space

Command DescriptionA – Assemble:This command is used to convert the input Assemble Language to the Machine Language in the memory. Onceunder this command, first set the address which is similar to the command “D” followed by an Enter or an ArrowDown key to go to a new step. However, only a maximum of 35 words are allowed for input.

The following are some useful keys used to move the cursor around:

Move one space to the left.

Delete the character at the cursor.

Simply Press the key ‘A’. After the command, an “A” will appear on the screen:

Assembly language can be input at this time.

1. Only contains the Effective address but the Segment base is included A 400.

2. Input includes the segment base and the Effective address A 0000:400.

3. Totally depends on the built in Segment base and Effective address A.

If one of the above is used, 0400 will appear on the screen and ready for input data.

Example:

Clear second line, display DX value, and DX values are altered by key-in to be displayed at LCD.

0:0400 MOV DL,C0

0:0402 CALL F000:F078

0:0407 MOV DH,00C2

0:040A CALL F000:F068

0:040F CMP AL,0D

0:0411 JNE 040A

0:0413 HLT

Before entering the above program connect the system to the power supply properly. Then the following menuwill be displayed on LCD screen, if not, switch off the power supply and re-check.

The following steps are to be taken:

1. Press the key A and the LCD display is as shown here:

2. Now the user enter the segment address and effective address simultaneously as follows:

www.hik-consulting.pl

Page 19: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 19

3. Now press Enter key, the effective address will appear.

From now onwards user can enter the program in assembly language. First pick the first instruction.

While entering this instruction, the following mistakes may happen:

1. If user has entered the wrong instruction as follows:

As user press the Enter key, then above instruction will not be converted into machine language. And the cursorwill point left side of the instruction as follows:

Now by using the <Backspace> keys, user can move the cursor right side and indicate at the below of ‘C’.

Delete the character by using <Space >keys.

Press Enter key, then this input assemble language will be converted into machine language in the memory andjump to the next memory location.

2. Or user has entered the wrong instruction as follows:

As user press the <Enter > key, then above instruction will not be converted into machine language. And thecursor will point left side of the instruction as follows:

Now just type again the correct instruction it will replace the previous characters.

Press Enter key, then this input assemble language will be converted into machine language in the memory andjump to the next memory location.

3. Or user has entered the wrong instruction as follows:

www.hik-consulting.pl

Page 20: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 20

As user press the Enter key, then above instruction will not be converted into machine language. And the cursorwill point left side of the instruction as follows:

And user wants to write whole instruction again, then by using the <Space> keys, the content at the location 400will be erased as follows:

Now by using <Backspace> key user can come back again to initial position

Now enter the instruction again.

Press <Enter> key, then this input assemble language will be converted into machine language in the memoryand jump to the next memory location.

Now write the next instruction as follows:

In this way, user can enter the whole program, by pressing <Enter> key.

Now by using GO command, the machine language statements can be executed and the value of DX will bedisplayed in the second line of the LCD.

Note : When “A” and “U” are being used, the operation used:

0000:1E00

0000:1FFF as the buffer.

D - Display or modify the RAM’s Hexadecimal:A.D.U. is the important commands in the compiling. The effective address or both the effective address andSegment base can be used during input. When the cursor is placed at the beginning, the key will immediatelyshow “F000” as the Segment base and the Effective address next.

Syntax:

D (If no input, press Enter key or ARROW UP/DOWN key would allow the built-in address to beused)

www.hik-consulting.pl

Page 21: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 21

D 0400 (Uses built-in Segment base but specify the Effective address)

D 0:0400 (Specify both the Segment base and Effective address)

If press the <Enter> or the ARROW UP key after specifying the address, the memory will display the data.Press ARROW UP key will allowed the address to ADD 8 and store in the memory as a whole number.Otherwise, an ARROW DOWN key indicates an subtraction of 8 in the address and these changes in the memory(as a machine language).

Syntax:

If address is not a whole number 8, the following will show:

The above data shown at the location 400 are the arbitrary data’s.

Example:

If the user wants to see the codes of the above program, the following steps are to be taken:

1. Press F7 key, the menu will display.

2. Press D key, and write the effective address. The following will be displayed:

3. Press <Enter> key, then the following will be displayed:

Use key for further view.

F - Fill data into the RAM:By setting the starting, ending address and the details, an <Enter> key will allow the data to enter the RAM.

Syntax:

Once ‘F’ is entered, the command can be preceded.

www.hik-consulting.pl

Page 22: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 22

The ending position has to be bigger than or equal to the starting position, otherwise the smaller user willbecome the ending position and the bigger user is the starting position.

G - Proceed to the address for execution:

The GO command, which causes the machine language statements to be executed. This command executes theloaded program and allows the user to specify the addresses at which program execution will stop. The syntax isas followed:

When the ‘G’ key has been applied, the procedure can be taken place.

It shows the address 0000:0400 by default if your program resides on another location than user have to changeaddress.

Once the ‘GO’ command has been executed, it will completely leave the system and proceed to the user’sprogram.

Flowchart of G-Command

I – Interrupt:

Three Interrupts (Effective address) can be set in for the program execution, the CPU will continuously make asingle-step subprogram for checking IP values. When the IP register has the same value as the Interrupt’saddress, it will enter the Interrupt’s subprogram. Enter command “I” will interrupt the program.

Syntax:

The I key allows interruption to be shown on the screen.

www.hik-consulting.pl

Page 23: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 23

Note:1. During interrupt setting, the address alternation register has commands like POP ES, MOV DS, AS, etc. to

execute with the next command.

2. The program will be delayed for due to the fact that CPU has to send each command individually into thesubprogram.

3. During the interruption, the command GO would allow the program to execute until the nextINTERRUPT.

Example:To break point at 0402, 0407 and 0411 in the example given on Page-3, the following steps are to be taken:

1. Press the key F7 and the LCD display is as shown here:

2. Now press the key I and the LCD display is as shown here:

Modify using <Space> and <Backspace >keys as follows:

3. Press the key F7 and then G. The display will be as follows:

4. Press the Enter key and then F7.

This indicates the first break-point is at 0402. To proceed further, press G, Enter, and then F7 .

This indicates the second break-point is at 0407. To proceed further, press G, Enter, and then F7 .

This indicates the third break-point is at 0411. One can use any commands including Examine Register bypressing the key R.

Note:

In above figure observe the command R is also displayed this command only appears during step execution ofprogram or when Breakpoints are applied at some addresses using I command.

Display Register:Command “R” displays the content in the register. This command allows the user to examine the content of theregister in the CPU. Each time during display, 4 registers will be shown. The following are some of the displayand criteria of the register:

www.hik-consulting.pl

Page 24: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 24

The first group register (AX, BX, CX, DX) will be shown first when enter the command “R”. The key willjump to the second group; the fourth group can return to the first group.

When the content in the register is displayed, the cursor will not appear, the user therefore cannot change thecontent in the register

M - Moving Data:The command MOVE is used to move data in the memory from a specified address to another address by inputthe starting address, the ending address and the desire address. A RETURN key is then used to execute thechanges.

Syntax:

The ‘M’ key allows the data to be moved to another address:

The ending address must be greater than or equal to the starting address. The sum of the starting address in plusthe corrected ending address in the target can not exceed FFFF. Otherwise, it will cause an input error and haveto redo the whole procedure.

T - Trace Program (an N-step designed command):This command is used for program execution. TRACE will enter the INTERRUPT subprogram every time theprogram execute. N has a decimal range from 1-99 with 10 as the rounding off number, and only operate if N isnot 0; other-wise it will clear the function.

Syntax:

T 00 - STEP

Decimal TRACE setting

Only 0-9 numerical keys are allowed to use to operate for this command but not any other keys.

Example:

Enter the following program using ‘A’ 0000:0400 and press Enter key.

www.hik-consulting.pl

Page 25: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 25

Now if user wants to see the process of the above program, then the procedure is as follows:

1. After entering the above program, press F7 key, then the menu will be displayed as follows:

2. Press the Key ‘T’. The screen displays as follows:

3. Now the user can view the program after the one instruction, two instructions, and so on by defining thenumber which is to be entered through keyboard.

Example:

The instruction pointer stops after every single instruction.

After completion, press ‘F7’ for a menu display.

4. Press the key ‘G’, the menu will appear.

5. Press Enter key.

6. Press ‘F7’ key, the single stepping will start and the following menu will be displayed:

1ST instruction is executed.

Press ‘G’ key and next ‘F7’ key for further view, the following results will be displayed:

www.hik-consulting.pl

Page 26: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 26

2nd instruction is executed.

Press ‘G’ key and next ‘F7’ key for further view, the following results will be displayed:3rd instruction is executed.

Press ‘G’ key and next ‘F7’ key for further view, the following results will be displayed:4th instruction is executed.

Press ‘G’ key and next ‘F7’ key for further view, the following results will be displayed:

Here user can observe the process of program execution, because data 30 is greater than 20 so that carry will notgenerate and the program execution will jump to the desired label. Now again press ‘G’ key and next ‘F7’ key

Anywhere during trace command, one can examine/modify the registers using ‘R’ command (refer RegisterCommand Description).

Note:

Refer to the INTERRUPT command for precaution.

U – Unassemble:The UNASSEMBLE command decodes the value of a group memory location mnemonics, and display on thedisplayed. Once enter this command, input the proper design address. The following is the correct way to inputaddress:

1. The content of the Unassemble 0400 will start if only the starting address is entered. The built-in segmentbase is used here if it is not entered.

2. The content of the Unassemble 0000:0400 will start if only the starting address is entered with segmentaddress as 0000:0400.

Press “U” key would enter the Unassemble design:

www.hik-consulting.pl

Page 27: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 27

Display the address first, then display the machine code (if the machine code is too long, they will be continuedon the second line). The second line displays the assemble program and the process is completely done. To seefurther press F7 key and then U again and then again enter next address.

If the user needs to modify the instruction, press key ‘F7’ will move to the command Assemble (A). And writethe address of the instruction which is to be modified. Press Enter key and write the correct instruction and againpress Enter key. Press key ‘F7’ another time would bring the instruction back to the Unassembled.

The “U” command can be used to examine the program but not more than 127 instructions in forward direction.When the program reaches the end, the “U” command can be used to decode the program again or forward.

Example:

The example entered earlier can be seen as follows:

1. Press ‘U’ key, and enter the starting address of the program.

2. Press Enter key, the following will be displayed:

3. Press F7 and then “U” and enter the next address for further view.

4. If the user want to modify at the address 0404, then following steps are to be taken:

a. Press ‘F7’ key, the menu will display.

b. Press ‘A’ key and enter the address 0404 as follows:

c. Press Enter key and write the instruction again.

d. Press Enter key so that the modifications has been taken place.

Note: When commands “A” and “U” are executed, the system program uses 0000:1E00-1FFF as the buffer,therefore during the execution of “A” and “U”, this segment cannot be used.

www.hik-consulting.pl

Page 28: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 28

Memory / I/O Mapping

Memory Section:

Address Purposes

0000:0000

0000:7FFF

RAM AREA

{ODD RAM & EVENRAM }

F000:0000

F000:FFFF

ROM MONITOR AREA

{ODD ROM & EVEN ROM}

I/O Address:

The addresses of the various chips in I/O mapped in NV5586A are as follows:

Device No. Port No. Selected Device

8255-I PPI

70 Port A

72 Port B

74 Port C

76 Control Word

8255-II PPI

80 Port A

82 Port B

84 Port C

86 Control Word

8255-III PPI

10 Port A

12 Port B

14 Port C

16 Control Word

8253 PIT

00 Counter 0

02 Counter 1

04 Counter 2

06 Counter 3

8259 30Interrupt controller

Data Word

32Command/Status

Word

8251 50 Data Register

52Controller Word

Register

www.hik-consulting.pl

Page 29: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 29

RAM Memory:Address Purposes

0000:0000Interrupt Vector Section (INTI, INT2, INT3 have arrangedthe interrupt section and stack segment

Stack Segment0000:0390 BUFFER

0000:039B SYSTEM DATA

0000:93E0 BUFFER (Only if needed)

0000:0400to

0000:7FFFUSER’S RAM AREA

System Data of RAM:

0000:039B - Store 9B, will stop at thesubprogram exit next tothe WAIT command eachtime it leave the interruptdisplay subprogram, waitingfor F2 to continue execution(is used in TRACE to convertto single-step hardware).

0000:039C

0000:039D TRACE Buffer

0000:039F - Flags, function of each byte is

as followed:

BIT:

0 : Enter NMI as 1, otherwise as 0

1 : After the “G” key, will be set to as 0, ‘SHIFT’ + ‘F7’

2 : During subprogram, is set to as 1

3 : Set to 1 after entering INTERRUPT

4 : Use in interrupt system

5 : Use in interrupt System

6 : Set 0 to INTERRUPT, and set 1 to TRACE

7 : Set TRACE or INTERRUPT as TF flags, timer 1

0000:03A0 Buffer of Interrupt setting

0000:03A5

0000:03AE Preserved battery to test bit

0000:03AF

0000:039E - Flags, use the command “A”

0000:03B0

0000:03D8 Data stored in the registermonitor during interruption

Note: Address 4350 to 4900 is used for internal operation of trainer and this area in not user accessible.

www.hik-consulting.pl

Page 30: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 30

SubroutinesAddress Text Description

F000:F000 JMP BCBA Recorder Program

F000:F003 JMP BB00 RS-232 Program

Practical Use of Subprogram (ROM’S Content)

Address Text DescriptionF000:F040 CALL SIF000:F042 RETFF000:F044 CALL FEEO Write AL’s instruction

into LCDF000:F047 RETFF000:F048 CALL FEFO Write AL’s data into

LCDF000:F04B RETFF000:F04C CALL FFOO Read LCD and store

data in ALF000:F04F RETFF000:F050 CALL FE7A Input keys and store

value in ALF000:F053 RETFF000:F054 CALL FE8A Convert input numerical

values into ASCII codeand store in AL. If it isnot a number than it willbe set to C-Flags as “1”.

F000:F058 CALL FEAO Convert the inputalphabetical values intoASCII code. If it is notan alphabet then it willbe set to C-Flags as “1”.

F000:F05B RETFF000:F05C CALL FEB5 Convert the input symbols

into ASCII code and storein AL. If it is not asymbol than set to C-Flagsas “1”.

F000:F05F RETFF000:F060 CALL FDF5 Convert the input

functional keys intoASCII code and store inAL. Otherwise, set to C-Flags as “1”.

F000:F063 RETFF000:F064 CALL FB35 Call for the above 4

sub-program and changeinput key into ASCII tostore in AL.

F000:F067 RETF

F000:F068 CALL EA35 Save the input 4 digitsin DX, display positionfrom BL to BH instruction.

F000:F06B RETFF000:F06C CALL FAAO Store input 4 digits in

DX as SEGMENT BASE

www.hik-consulting.pl

Page 31: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 31

AND ANOTHER 4 digitsas the Effective address inDI (DX: DI).

F000:F06F RETFF000:F070 CALL FE15 Convert the ASCII code

in AL to hexadecimalF000:F073 RETFF000:F074 CALL FE30 Convert the hexadecimal

in AL to ASCII code andstore in between AH and AL

F000:F077 RETFF000:F078 CALL FF2B Delete one lineF000:F07B RETFF000:F07C CALL FCD5 Clear the screenF000:F07F REFTF000:F080 CALL FD20 Cursor blinking movementF000:F083 RETFF000:F084 CALL FDCO Insert the lower 4 bits into

the DX with BH instructionF000:F088 CALL FFOA Write the hexadecimal in

AL into cursor addressF000:F08B RETFF000:F08C CALL FF20 Write the hexadecimal in

AX into cursor addressF000:F08F RETFF000:F094 CALL F39A Write the hexadecimal

in AX into BLdesignated address

F000:F097 RETFF000:F098 CALL FD4A Read in 2 letters from

BL designated position,change to hexadecimaland store in AX

F000:F09B RETFF000:F09C CALL FD7A Read in 4 letters from BL

designated position, changeto hexadecimal and store inAX

F000:F09F RETFF000:F0A0 CALL FE55 Beep......F000:F0A3 RETFF000:F0A4 CALL EFDA Extended subprogram can

be planned. Plan 8253 #2counter as the extendedcounting and check key-inwhen leaving the subprogram

F000:F0A7 RETF

Codes Table:

The key-in code in transferred to ASCII and the ability to transfer the address, FF means empty codes that havenot been defined.

Character Code: (F000:FF60 - FF83)

F000:FF60 :ASCII 30 31 32 33 34 35 36 37 38 39 41

Number 0 1 2 3 4 5 6 7 8 9 A

www.hik-consulting.pl

Page 32: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 32

:FF70

:

ASCII 42 43 44 45 46 47 48 49 4A 4B 4C

Alphabet B C D E F G H I J K L

ASCII 4D 4E 4F 50 51 52 53 54 55 56 57

Alphabet M N O P Q R S T U V W

FF80 :ASCII 58 59 5A FF FF FF FF FF FF FF FF

Alphabet X Y Z

Symbols Code: (F000:FF90-FFBF)

F000:FF90:

ASCII FF 3C 3E 3F

Symbols < > ?

:FFA0 :

ASCII FF 3D 5F FF FF 2F 2D 7F 26 2A 2B 28

Symbols = ^ / - ← & * + (

ASCII 29 7E 2C 2E

Symbols ) → , .

:FFB0 :

ASCII FF FF 3B 3A 22 FF FF 5B 5D 7B 7D FF

Symbols ; : " [ ] { }

ASCII 21 23 24 25

Symbols ! # $ %

Functional key: (F000: FFBC-FF9B)

2D 0D FF 94

SP ← FI DEL

93 90 91 92 20 0D FF D4 D3 D0 D1 D2

← CLS GO ↑ SP ← INS → EDIT LIST ↓

Note:1. CTRL ON conditions have not been defined.

2. SP and ← area use under the key SHIFT ON and OFF.

Checking section of interrupt vector positionAfter RESET, the system program will allow the stored data to begin from 0:0000 until Interrupt vector position.FF is the undefined interrupt that for the user to decide.

F000:FFC0 :

FF FF FF FF CA F7 00 F0INT1

30 F7 00 F0 1A F7 00 F0INT2 INT3

FFD0 : FF FF FF FF FF FF FF FFFF FF FF FF FF FF FF FF

FFE0 : FF FF FF FF FF FF FF FFFF FF FF FF FF FF FF FF

www.hik-consulting.pl

Page 33: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 33

Sub-Program:The 8086/8088 so-called subprogram has both the same segment calling and the different segment calling. Thedifferent segment calling is used towards the different. The different segment calling is used towards thedifferent segment of subprogram. The subprogram of this system program has to be all in the same segment inorder to call the same subprogram (the same segment and different segment subprogram are different from RETcommand). For user convenience, the system program will start from F000:F040 as the catalog section of thesubprogram. In the subprogram catalog segment, if the same segment subprogram RET is changed to differentsegment subprogram RET is changed to different segment subprogram RETF. The user can therefore choose thedifferent segment calling from any segment to call one of the subprogram in the catalog segment.

Another method of using system subprogram is to use the M command to move all the programs in the systeminto the user’s segment. This allows direct access to the calling commands in the segment. Since there are othersubprogram that can be called from the subprogram, all the programs have to be moved together in order toprotect each other address (when every subprogram is being used in the catalog, it should start moving fromF000:EA00-FF4F), it is therefore a waste of space.

The user can add new program into the empty space of catalog section.

Operation description of sub-program:

F000 : F040 CALL SI

The calling of the implied address will allow the subprogram address to be registered into the SI calling if acalled program is not in the catalog section.

Input Parameter : The calling of subprogram address is instructed by SI.However, others dependon the needs of the subprogram calling.

Output Parameter : Depends on the execution of subprogram.

F000 : F044 CALL FEEO

Write all the commands in the AL into the LCD modular.

Input Parameter : AL stores the LCD modular orders that have been written in.

Output Parameter : None

F000 : F048 CALL FEFO

Write all the data from AL into the cursor position of the LCD (the position of the address counter).

Input Parameter : Written data is stored in AL

Output Parameter : None

F000 : F04C CALL FF00

Read out data from cursor position of LCD (the instructed position of address counter) into AL.

Input Parameter : None

Output Parameter : AL stores the read in data.

F000 : F050 CALL FE7A

Read out the key-in from 8279 (execute only when the key is pressed).

Input Parameter : None

Output Parameter : The key-in value is stored in AL.

F000 : F054 CALL FE8A

Change the numerical key-in value into ASCII code, clear the C-Flag to 0 for numerical key otherwise set 1 for

non-numerical key with out changing AL value.

Input Parameter : The key-in value is stored in AL

www.hik-consulting.pl

Page 34: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 34

Output Parameter : If it is a numerical key, transfer into the relative ASCII values, store in AL andclear all flags. All non-numerical keys are set in C-Flag, and AL value changes.

F000 : F058 CALL FEAO

Change the alphabetical key-in value into ASCII code; clear the C-Flags to 0 for alphabetical keys otherwise set1 for non-alphabetical keys without changing the AL value.

Input Parameter : The key-in value is stored in AL

Output Parameter : If is an alphabetical key, transfer to ASCII code to be stored in AL and clearthe C-Flags. Otherwise, the AL value will not change.

F000 : F05C CALL FEB5

Change the signs key-in into ASCII code, the undefined signs key will be transferred to FF to be stored in AL,and clear the C-Flag to 0; otherwise set the flags to 1 without changing the AL values.

Input Parameter : The key-in value is stored in AL.

Output Parameter : If it is a sign, transfer to ASCII code to be stored in AL and clear the C-Flag,otherwise, set the C-Flags to 1 without changing AL values.F000 : F060 CALL FDE5

Change the functional keys into the key-in values (Enter and SP keys as the ASCII code, whereas others are setby the system program), those undefined one will be stored as FF in AL and clear the C-Flag to 0.

Input Parameter : The key-in codes are stored in AL.

Output Parameter : If it is functional key, transfer to key-in code to be stored in AL and clear theC-Flags, otherwise set the C-flags to 1 without changing AL values.F000 : F064 CALL FB35

A combination of (6) (7) (8) (9) function.

Input Parameter : The key-in values are stored in AL.

Output Parameter : The AL not only transfers the code but also clear the C-Flags to 0. Otherwiseset the C-Flag to 1 without changing AL values.F000 : F068 CALL EA35

Input a 4 digits number at the BX appointed location and store in DX in order to be displayed in LCD modular.BL will appoint the first position. BH will appoint BL where to start, BH has to be smaller than 4 & follows theaddress counter in the LCD modular. When BL=X0XX XXXX, it is the first line; when BL = X1XX XXXX, itis the second line. The exact location is the sum of BL and BH. When input, → key and ← key will operate thecursor location. If the key-in function is changed to key code, it will leave the subprogram after it is stored inAL.

The BH is set to 0 for first time entry, the rest will be according to the key-in to determine the code.

Input Parameter:

DX : The first displayed number after the entry

BL : The display location of word at the most left side.

BH : Which location from BL the character starts.

Output Parameter:

AL : The code used for storing functional key.

DX : Store the displayed numbers.

F000 : F06C CALL FAA0

The appointed location of BL and BH, the code of input section and effective address are stored consequently inDX and DI (i.e. DX: DI).

www.hik-consulting.pl

Page 35: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 35

The displayed location of most left side character is instructed by BL, BH instructs the position from the firstcharacter onwards. If BH is smaller than 9 but not equal to 4, BL add to BH will be the exact location of displaylocation.

The keys, are used to operate the cursor while input numbers. It will also allow the cursor to move betweensegment and effective address. Other than these three functional keys, the rest will transfer to code number andjump out of subprogram.

Input parameter :

BL : Instruct the most left side word to display location. The rules is the same as (1).

BH : Instruct the position starting from BL, first entry into the subprogram is set to 0,program execution will follow the operation whether to add or subtract.

Output Parameter : Al stores the key-in code of functional keys.

F000 : F070 CALL FE15

Transfer the numbers in AL from ASCII code to hexadecimal to be stored in lower 4 bits of AL , clear to C-Flagat the same time to 0. But set the C-Flag of non-numerical ASCII code to 1, without changing the code of AL.

Input Parameter : ASCII code of numbers that are stored in AL.

Output Parameter : The ASCII code of the numbers in AL will be transferred to hexadecimal to bestored in the lower 4 bit, clear the C-flag to 0 otherwise set C-Flags to 1 with-outchanging the AL code.

F000 : F074 CALL FE30

After changing the hexadecimal in AL to ASCII code, the higher level is stored in AH and the lower level isstored in AL.

Input Parameter : AL stores the exchanged hexadecimal.

Output Parameter : AH stores the higher level ASCII, AL stores the lower level ASCII.

F000 : F078 CALL FF2B

Clear the first line display of the BL, display of D.D. RAM will be stored into the blank code “20”, and then thecursor will move back to the starting point.

BL = X0XX XXXX means clearing the first line.

BL = X1XX XXXX means clearing the second line.

Input parameter : BL indicates the number of cleared lines.

Output Parameter : BL stores 80 (first line) or CO (second line).

F000 : F07C CALL FCD5

Clear display (blank code “20” is stored in the display)

Input Parameter : None

Output Parameter : None

F000 : f080 CALL FD20

The cursor blink, waiting for the key to jump out.

Input Parameter : None

Output Parameter : AL stores the key-in code from 8279.

F000 : F084 CALL FDC0

Insert the AL lower 4 bit hexadecimal into the DX, the location is determined by BH. BH must be smaller thanr, BH = 0 represents it is inserted into the most left-sided position of DX.

Input Parameter : The AL lower 4 bit means an insert into hexadecimal.

www.hik-consulting.pl

Page 36: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 36

DX - means inserted numbers.

BH - indicates inserted location.

Output Parameter : Dx is the code after insertion.

F000 : F088 CALL FFOA

Write the AL code into cursor location (inside the address of the address counter).

Input Parameter : AL stores the code that is ready for input.

Output Parameter : None

F000 : F08C CALL FF20

Write the AX code into the cursor location.

Input Parameter : AX stores the code that is ready for input.

Output Parameter : None

F000 : F094 CALL F39A

Write the AX code into the BL indicated location of LCD, BL indicates the first line or second line as in (11).

Input Parameter : BL indicates the most left-sided location of the word. AX stores the codes that areready for input.

Output parameter : None

F000 : F098 CALL FD4A

The LCD which instructed by BL read out 2-bit and change it to hexadecimal to be stored in AL, also clear theC-Flag as 0. If it is a non-numerical character, the C-Flag will be set to 1 and return once AL is back. Theinstruction of BL location is the same as (11).

Input Parameter : BL indicates the read-in of the first word on the left.

Output Parameter : If read a number, then will transfer to hexadecimal to be stored in AL. The C-flaghas to be cleared to 0, otherwise it is taken back to AL, and moreover the C-Flag isset to 1 in order to return.

F000 : F09C CALL FD7A

The LCD which instructed by BL read out 4-bit, changes to hexadecimal to be stored in AX, and Clear the C-Flag to 0. If it is non-numerical code, the C-Flag is set to 1 and is also taken back into AX before it returns. Blinstructed the number on the most left, the rule ins the same as in (11).

Input Parameter : BL instructs the first word that is ready to read out from the most left side.

Output Parameter : The number read will be transfer to hexadecimal to be stored in AX, and clear theC-Flag to 0. Otherwise, the AL code will return and the C-Flag will be set to 1.

F000 : F0A0 CALL FE55

Make a beep sound.

Input Parameter : None

Output Parameter : None

F000 : F0A4 CALL FEDA

Delay subprogram that can be designed, the delay is counted by the counter # 2 of 8253. It will check the key atthe end, in order to jump out the subprogram after it read.

Input Parameter : Before input, counter # 2 of 8253 has to be programmed. The subprogram willcheck counter # 2 and Jump out once react the end.

Output Parameter : AL—AL code 00 represents no key-in, otherwise AL code will be the key-in code.If AH is influenced, it will change (indefinite value).

www.hik-consulting.pl

Page 37: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 37

Practical Examples of Subprogram:

NOTE: Programs in Assembly language directly compile on Trainer Assembler while writing program inAssembly language in Trainer do not add prefix Zero (0) or any postfix like H as shown in figure and use addressof label names in place of Label name in trainer.

Example-1

Input alphabetical key, and display at LCD

0:0400 MOV AL,01 Clear display commandsto be stored in AL

0:0402 CALL F000:F044 Calling instruction isinput into LCD subprogram

0:0407 MOV AL,0D Command that displayON/OFF is stored in AL 0D= 0000 1101Letter blinking cursor OFFdisplay ON DisplayON/OFF order

0:0409 CALL F000:F044 Call for write-ininstruction subprogram

0:040E CALL F000:F050 Call for the read key-in0:0413 CALL F000:F058 Call the alphabetical

key code and transferinto the subprogram

0:0418 JB 040E Ignore the alphabeticalkey-in, return tooriginal key-in; otherwiseexecute the next instruction.

0:041A CALL F000:F048 Key-in code enter intoLCD modular

0:041F JMP 040E0:0422 HLTProgram input starts executing from 400, the first word blinking can be seen at this time, they can be input againin order to be displayed on LCD. 21st to 41st word will exceed the first line display boundary, therefore they arestored in LCD modular but will not be shown. The 41st word will be the first letter on the second line.Similarly, 61st to 80th word will not be shown.

www.hik-consulting.pl

Page 38: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 38

Example-2

Clear second line, display DX value, and DX values are altered by key-in to be display at LCD.

0:0400 MOV AL,01 Clear display commandsto be stored in AL

0:0402 MOV BL,C0 Write the set LCD addresscounter commands into BL.CO=1100 0000 representthe position of second line

0:0404 CALL F000:F078 Clear second line0:0409 MOV BX,00C2 Input parameter of

subprogram is storedin BX.

B0-B5 set the word at the most left side to display position, B6=1 represents the second line, B7 can beany number. After entering subprogram, it is automatically set to 1 (B=Bit).

BH as 00 instructs the cursor and the first word location, first time entering subprogram is set to 0, therest will automatically add or subtract.

0:040C CALL F000:F068 Input 4 bits.

0:0411 CMP AL,0D whether it is Enter key

0:0413 JNZ 040A Non-Enter key willjump back to inputsubprogram, otherwiseit will execute the nextcommand.

Program will clear the second line first, but display 4 bits (DX value) on the second line and wait for input.

After the key-in numbers, the display value can be altered and stored in DX. Press Enter key would stop theprogram.

Example-3

Display 4 bits (AX value) on BL instructed location.

0:0400 MOV BL,80 Input parameter ofsubprogram is stored inBL. B6=0 represents 1st

line0:0402 CALL F000:F078 Clear the first line.0:0407 MOV AX,8088 Input parameter of

subprogram is storedin BL. Among 84=10000100, B0 to B5 displaythe first word on the mostleft side. B6 as 0represents the 1st linedisplay, B7 can be anyvalue that automaticallyset to 1 once enter thesubprogram. It is theD.D. RAM addresscommand.

0:040A CALL F000:F094 Display AX.0:040F HLT

Program will first clear the first line, then store “8088” into AX to display the first line.

www.hik-consulting.pl

Page 39: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 39

Example-4

Check table to display one line of letter.

0:0400 MOV BL,CO0:0402 CALL F000:F078 Clear the second line0:0407 MOV AL,C2 Parameter of subprogram

stored in AL. B)-B5 iswritten into LCD addresscounter, instructed theword on the most left side.B6 as 1 represents thesecond line.B7 as 1represents the set D.D.RAM address instruction.

0:0409 CALL F000:F044 Commands in AL arewritten into LCD

0:040E PUSH CS0:040F POP DS Segment value set

for table checking0:0410 MOV SI,600 Starting address of table

checking is stored into SI0:0413 MOV CX,0A Store table checking

length in CX0:0416 CLD Clear directional flag0:0417 LODSB Read in data from table

checking section until AL.0:0418 CALL F000:F048 Input AL data into LCD

modular.0:041D LOOP 0416 CX not equal to 0 would

continue execution loop.0:041F HLTProgram execution at address 0:0600 is stored into the ASCII code of display data, like followed (can be setoneself):

0:0600 41 42 43 44 45 46 47 48 49 4A

Program starts from 0:600 to be stored as ASCII data code and display on LCD modular i.e. A B C D E F G H IJ.

www.hik-consulting.pl

Page 40: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 40

Serial Communication

NV5586A has facility of Serial Interface with PC for any serial Transmission & Reception. Through this facilityone can upload & download data from / to PC. For Downloading & Uploading microprocessor lab software isprovided.

Microprocessor lab is simple software for IBM-PC compatible computers. It allows the user to communicatewith the computer through serial port with the facility of downloading & uploading of the data between thecomputer and the other serial devices.

The user can communicate NV5586A trainer with PC using software as below procedure mentioned.

Fig 1a• First run the microprocessor lab software setup.

• After the installation is complete above window is appear on screen (fig 1a).• Close the entire programs (like HyperTerminal) which use same com port.

• In software NV5585 is set as default so its image appear on screen

Fig 2a• For selecting the com port of PC use selection button “Select Com Port” (fig2a)

• For connecting the NV5586A use button “Connect to port”, and that particular button become red. Fordisconnect click on same button.

www.hik-consulting.pl

Page 41: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 41

Fig 3a

• For selecting the trainer click button “Connect NV5586A” and it change to “Disconnect NV5586A”.Fordisconnect the trainer click on same button.

Uploading:Microprocessor lab software provides a feature by which the data stored in NV5586A can be stored in the disk ofPC. This can be achieved by following the instructions given as below:

ExampleWe are storing the program/data of NV5586A from 0000:0400 (Starting address) to 0000:04FF (End address) asan example to demonstrate the UPLOADING features.

1. On NV5586A, execute from F000:F003 using G command as follows:

Press Enter key and the following will come on the display:

Press ‘F7’ key to come in the OUT mode.

1st location indicates the starting address (F000:0400) and the 2nd location indicates the end address (0400)of the memory area to be transmitted on to the Serial Port. Change this to 0000:0400 to 04FF as follows:

www.hik-consulting.pl

Page 42: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 42

Fig 4a

For uploading the file press “Capture text” (fig 4) button on lower right of window and another window shownbelow is appears (fig 5).

Fig 5a2. Then give any name with extension .TXT and Click <Start>.

3. After that press <Enter> key of NV5586A trainer.

4. Now you will see Data on the “Response” window.

Fig 6a

5. After file transfer complete click on button “Save File” (fig 6)

6. Now your file is saved in the PC. By this procedure one can upload data in PC.

Downloading:

The following procedure is to be adopted for downloading the file from PC to NV5586A.

• For Down Loading the .KIT or .TXT from PC to NV5586A trainer click button “Send File” on right lowerside of screen and screen appear for selecting the file form given location .And follow the procedure givenbelow in section Down Loading.

www.hik-consulting.pl

Page 43: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 43

Fig 7a

Fig 8aOn NV5586A, execute from F000:F003 using G command as follows:

Press Enter key and the following will come on the display:

Change the location from F000:0400 to 0000:0400. This is the 1st RAM location data will be received from thePC and this address will keep on incrementing on receipt of each Data Byte.

Press Enter key of trainer keyboard and then click on open button on screen appear on PC

1. Then type File to be downloaded i.e. ABC.TXT.

2. After that address field on NV5586A will go on incrementing will display till the last address field atwhere user have saved ABC.TXT File.

www.hik-consulting.pl

Page 44: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 44

MASM Macro-Assembler

To use MASM Software and download generated file to Trainer please follow these steps

Write program given in following format for 8086

NOTE:

While writing Programs for MASM Compiler add prefix Zero (0) and postfix H as shown in figure and use labelnames.

; TEST PROGRAM FOR 8255 EM03 TO GENERATE SQUARE WAVE OUTPUTCODE SEGMENTASSUME CS: CODE, DS: CODEPROG PROC FAR

ORG 400H ;Step-1MOV AL, 80H ;0400 B0 80OUT 66H, AL ;0402 E6 66 for inbuilt

8255 change 66Hto 76H

;Step-2START: MOV AL, 55H ;0404 B0 55

;Step-3OUT 60H, AL ;0406 E6 60 for inbuilt

8255 change 60Hto 70H

;Step-4OUT 62H, AL ;0408 E6 62 for inbuilt

8255 change 62Hto 72H

;Step-5OUT 64H, AL ;040A E6 64 for inbuilt

8255 change 64Hto 74H

CALL DELAY1 ;040C E8 0D 00MOV AL, 0AAH ;040F B0 AA

;Step-6OUT 60H, AL ;0411 E6 60 for inbuilt

8255 change 60Hto 70H

;Step-7OUT 62H, AL ;0413 E6 62 for inbuilt

8255 change 62Hto 72H

;Step-8OUT 64H, AL ;0415 E6 64 for inbuilt

8255 change 64Hto 74H

CALL DELAY1 ;0417 E8 02 00;Step-9

JMP START; 041A EB E8DELAY1: MOV CX, 0000H ;041C B9 0000DL1: DEC CX ;041F 49

www.hik-consulting.pl

Page 45: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 45

JNZ DL1 ;0420 75 FDRET ;0422 C3

PROG ENDPCODE ENDS

END

Starting Portion and ending portion should be there. In between this we can write any instructions withinitial address Org 400H program

NOTE: We can write above file in any window or dos editor directly. And change extension to .ASM

Step2>save above file suppose file name ABC.ASM in same folder where the assembler is saved.

Step3>Now do the following steps

Open command prompt window by typing cmd in run command a window appears as shown below

Now enter into the cross assembler directory for my system it is in C: drive

Run MASM file in below mention format

www.hik-consulting.pl

Page 46: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 46

Then press “ENTER” key of PC keyboard four times .The PC screen will display

SUCCESSFUL 0 WARNING & 0 SERVE ERROR

Note: The ASM file should be in same folder where MASM assembler is placed

Step4>Run LINK file in below mention format

C :> LINK.exe ABC (No need to give any extension.)

Then press “ENTER” key of PC keyboard four times PC screen will display

SUCCESSFUL 0 WARNING TO STACK SEGMENT.

Step 5>Run EXE2BIN file in below mention format.

C:>EXE2BIN.exe ABC (No need to give any extension)Then ENTER key of PC keyboard once.It will generate binary file of your program

Step 6>Now run Ascbin.exe in the below mention formatC:>Ascbin.exethen ENTER(from PC keyboard)

This is a Program to convert ascii file to bin file & bin file to ascii fileAfter pressing ENTER it will show

Press <ESC> to exit programPress <s> & <enter> to exit nowPress <c> & <Enter> to continue

Now Press C for continues.

Step 7> Window will open asking for

1) BIN to ASCII2) ASCII to BIN

Select no 1 for BIN to ASCII then ENTER (from PC keyboard)

Step 8>Again window will open asking for

Enter the BIN filename?Enter the filename with extension ABC.binEnter the BIN filename? ABC.binAfter pressing ENTER it will again prompt for ASCII filename

Enter the ASCII filename? ABC.ASC

Note: In these fields extensions are necessary

Enter origin? 0000:0400 then ENTER (from PC keyboard)

Our ASCII file will be generated named ABC.asc down load this file into M8086—02Connect HyperTerminal with kit then select transfer then send text file.Our file will be down loaded into kit.

www.hik-consulting.pl

Page 47: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 47

Sample Programs

The monitor software of NV5586A resides in 128K Byte of EPROM. The system software has certain usefulroutines, which can be utilized by the user for developing his programs. The address of these routines is given inthe Subroutine chapter.

Example

The following sample programs are given here to make the user familiarize with the operation of NV5586A.

1. 16-bit addition

2. 16- bit subtraction

3. 16-bit multiplication

4. 32- bit division

5. Program for addition of two no and display it on LCD

6. Moving data form 500 memory location to 600 memory location

7. Program for moving string form one memory location to other

8. Searching a no in given array

9. Program for comparing two string

10. Program for comparing two string

11. Find the largest number in a given string.

12. Sort a string of bytes in descending order.

13. ASCII multiplication.

14. Divide a string of unpacked ASCII digits.

15. Calculate the no. of bytes in a string of data.

16. Convert the string of data to its compliment form.

NOTE:

Programs in Assembly language directly compile on Trainer Assembler while writing program in Assemblylanguage in Trainer do not add prefix Zero (0) or any postfix like H as shown in figure and use address of labelnames in place of Label name in trainer.

Program-1:

16-BIT ADDITION:

MEMORY ADDRESS OPCODES MNEMONICS400 B8 34 12 MOV AX,1234 ; Load 1234 in AX403 05 78 56 ADD AX,5678 ; Add 5678 to content of AX406 88 26 20 04 MOV [420],AH ; Load result on ram location420 & 42140A 88 66 21 04 MOV [421],AL40E F4 HLT

INPUT: 1234+ 5678

RESULT: Result at 420 and 421 = 68AC

www.hik-consulting.pl

Page 48: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 48

Program-2:

16- BIT SUBTRACTION:

MEMORY ADDRESS OPCODES MNEMONICS

400 B8 43 43 MOV AX,4343 ; Load 4343 to AX403 2D 21 21 SUB AX,2121 ; Sub content of AX to 2121406 88 26 20 04 MOV [420],AH ;Load result on ram location

42040A 88 06 21 04 MOV [421],AL ;Load result on ram location

42140E F4 HLT

INPUT: 4343 - 2121

RESULT: Result at 420 and 421= 2222

Program-3:

16-BIT MULTIPLICATION:

MEMORYADDRESS

OPCODES MNEMONICS

400 B8 34 12 MOV AX, FEDC ; Load FEDC to AX403 BB 11 11 MOV BX, BA98 ;Load BA98 to BX406 F7 E3 MUL BX408 88 36 50 04 MOV [450],DH ;Load result to 450 memory location40C 88 16 51 04 MOV [451],DL ;Load result to 451 memory location410 88 26 52 04 MOV [452],AH ;Load result to 452 memory location414 88 06 53 04 MOV [453],AL ;Load result to 453 memory location418 F4 HLT

INPUT: FEDC*BA98

RESULT: 450 & 451 = B9C3452 & 453 = 2AA0.

Program-4:

32- BIT DIVISION:

MEMORYADDRESS

OPCODES MNEMONICS

400 BA 00 00 MOV DX,0000 ;Load dividend to DX403 B8 FF FF MOV AX,FFFF ;Load to AX406 B9 FF FF MOV CX, FFFF ;Load divisor to CX408 F7 F1 DIV CX40B 88 26 50 04 MOV [450],AH ;Load result to 450 ram location40F 88 06 51 04 MOV [451],AL ;Load result to 451 ram location413 88 36 52 04 MOV [452],DH ;Load result to 452 ram location417 04 16 53 04 MOV [453],DL ;Load result to 450 ram location41B F4 HLT

INPUT:DIVIDEND: DX = 0000

AX = FFFFDIVISOR: CX = FFFF

www.hik-consulting.pl

Page 49: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 49

RESULT:450 & 451 = 0001452 & 453 = 0000

Program-5:

Program for addition of two no and display it on LCD

Here the data is break in to part because we can transfer 8 bit at a time on LCD using given function

Operand 30+30

Result =60

Program- 6:

Moving data form 500 memory locations to 600 memory locations

Address OPCODE MNEMONICS Comments400 BE 0005 MOV SI,500 Starting Location403 BF 0006 MOV DI,600 Destination Location406 B9 0F 00 MOV CX,000F No byte to transfer409 8B 04 MOV AX,[SI]40B 89 05 MOV [DI],AX40D 46 INC SI40E 47 INC DI40F 49 DEC CX410 75 F7 JNE 409412 F4 HLT

Enter the data at 500 location

Ex-01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16

And after running the code above data is transfer to 600 locations

MemoryAddress

Opcode Mnemonics Comments

400 B8 30 00 MOV AX,30 Move data in AX403 05 30 00 ADD AX,30 ADD data to

content of AX406 88 C2 MOV DL,AL Move lower 8 bit

of AX in to lower8 bit of DX

408 9A 78 F0 00 F0 CALL F000:F078

Call to displayfunction

40D 88 E6 MOV DH,AH Move higher 8 bitof AX to higher 8bit of DX

40F 9A 68 F0 00 F068 CALL F000;F068 Call to LCDdisplay function

414 75 F2 JNE 0408 Unconditionaljump to 408MEMORYlocation

416 F4 HLTwww.hik-consulting.pl

Page 50: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 50

Program -7:

Program for moving string form one memory location to other

Address OPCODE MNEMONICS Comments400 8B 0E 00 05 MOV CX,[500] Size of string is

store at 500 location404 8D 36 50 05 LEA SI,[550] Load effective

address408 8D 3E 00 06 LEA DI,[600]40C FC CLD40D F3 REP40E A4 MOVSB Move string byte40F HLT F4

1. Enter the size of string on 500 memory location

2. Enter the string on 550 memory location

3. String copy to 600 memory location

Program -8:

Searching a no in given array

MemoryAddress

Opcode Mnemonics Comments

400 BE 00 05 MOV SI,500403 BF 00 06 MOV DI,600406 8A 0C MOV CL,[SI]408 46 INC SI409 8A 04 MOV AL,[SI]40B 46 INC SI40C 3A 04 LOOP: CMP AL,[SI]40E 74 09 JZ END410 46 INC SI411 FE C9 DEC CL413 75 F7 JNZ 40C415 B0 FF MOV

AL,0FFH417 88 04 MOV [SI],AL419 8A 1C END: MOV BL,[SI]41B 88 1D MOV [DI],BL41D CD 02 INT 02H41F F4 HLT

INPUT: 500 = 04H (LENGTH 0F ARRAY)501 = 35H502 = 18H503 = 35H504 = 54H505 = 72H

Note: The element which one we want to search is stored at location 501h & The number of elementsin an array is stored at location 500h.

www.hik-consulting.pl

Page 51: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 51

RESULT:1. If the elment which one we want to search is in an array, then it will be store at the location [500]

i.e 35 is stored

2. If the element which one we want of search is not in an array, then FF will be stored at location600 to indicate ERROR condition.

Program -9:

Program for comparing two string

Address OPCODE MNEMONICS400 8D 36 00 05 LEA SI,[500] Location of 1 string404 8D 3E 50 05 LEA DI,[550] Location of 2 string408 B9 03 00 MOC CX,0003 Size of string40B FC CLD40D F3 REP40E A6 CMPSB410 75 07 JNE 417412 B0 01 MOV AL,01416 FF HLT

Enter the string at address 500Ex-AA,BB,CC

Enter the 2 string at address 550Ex-AA,BB,CC

If both string are same then result is 01 at 600 location and string are not matching then 00 at 600memory location

Program-10:

To ADD two Binary numbers each 8 Bytes long:

Add, Op Code Mnemonic Comments0 400 F8 CLC Clear Carry Flag.0401 B9 04 00 MOV CX,0004 Load Counter register

with no. of timesaddition to beperformed(i.e. Initializethe counter register).

0404 BE 00 05 MOV SI,0500 Load source IndexReg. with startingaddress of Ist Binaryno. (LSBs array).

0407 BF 08 05 MOV DI, 0508 Load DestinationIndex Reg. with Dest.Address (where theresult of add. is to bestarted storing). Alsoit’s the starting addressof MSBs of array.

040A 8B 04 MOV AX,[SI] Load Data bytes(which are in location

www.hik-consulting.pl

Page 52: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 52

0500 and 0501 in 16bit ACC. i.e. (0500)– AH (0501) – AL

040C 11 05 ADC [DI],AX Add the contents(MS Bytes) of 0508,0509 with the contents(LS Bytes) of 0500 +0501 and store theresult in location 0508onwards.

040E 46 INC SI Point at 0502 LOCN(Next relevant sourceLOCN).

0410 47 INC DI Point at nextrelevant LOCN, i.e.

0411 47 INC DI 0504.0412 49 DEC CX Decrement the

counter.0413 75 F5 JNE 040A If not zero (i.e.

CX =0000) thencontinue addition.

0415 F4 HLT Else, Halt.

For example:After Execution

0500 : 01 0508 : 0A 0508 : 0B0501 : 02 0509 : 0B 0509 : 0D0502 : 03 050A : 0C 050A : 0F0503 : 04 050B : 0E 050B : 120504 : 05 050C : 0F 050C : 140505 : 06 050D : 10 050D : 160506 : 07 050E : 11 050E : 180507 : 08 050F : 12 050F : 1A

Program - 11:

To find the maximum no. in a given string (16 Bytes long) and store it in location 0510.

Add. Op Code Mnemonic Comments

0400 BE 00 05 MOV SI, 0500 Load SI reg. withstarting address ofstring.

0403 B9 10 00 MOV CX, 0010 Initialize CounterReg. (with the lengthof string i.e. no. ofbytes).

0406 B4 00 MOV AH, 00 Initialize the 8 bitAcc.

0408 3A 24 CMP AH,[SI] The 1st data byteof the string with‘00’.

040A 73 02 JNB 040E If both bytes match(above is equal) thenbranch to (l).

040C 8A 24 MOV AH,[SI] Else, move thecontents of (0500)

www.hik-consulting.pl

Page 53: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 53

into 8 bit ACC, i.e.,a real no. in AH.

040E 46 INC SI Point at the nextaddress of string.

040F E0 F7 LOOPNE 0408 Decrement thecounter value, ifnot zero, continueprocessing(searching to theMax. No. continued.)

0411 88 24 MOV[SI],AH Max. No. in 0510address.

0413 F4 HLT Halt.For example

After Execution

0500 : 01 0508 : 120501 : 02 0509 : 080502 : 03 050A : 090503 : 04 050B : 0A0504 : 05 050C : 0B0505 : 06 050D : 0E0506 : 15 050E : 0C0507 : 07 050F : 0D

0510 : 15Program - 12:

To sort a string of a no. of bytes in descending order:

Add. Op Code Mnemonic Comments

0400 BE 00 05 MOV SI,0500 Initialize SI Reg.with Mem LOCN0500.

0403 8B 1C MOV BX, [SI] BX has the no.of bytes (to be usedfor sorting) LOCNS0500 & 0501.

0405 4B DEC BX Decrement the no.of bytes by one.

0406 8B 0C MOV CX [SI] Also CX has theno. of bytes inLOCNS 0500 and0501.

0408 49 DEC CX Decrement the no.of bytes by one.

0409 BE 02 05 MOV SI, 0502 Initialize SI reg.with the startingaddress of string(having data bytes).

040C 8A 04 MOV AL, [SI] Move the first databyte of string intoAL.

040E 46 INC SI Point at the nextbytes of the string.

040F 3A 04 CMP AL,[SI] Compare the twobytes of string.

0411 73 06 JAE 0419 If two bytes are

www.hik-consulting.pl

Page 54: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 54

equal or 1st byteis above that thesecond Byte Branchto (1).

0413 86 04 XCHG AL, [SI] Else0415 4E DEC SI Second byte is less

than first byte andswap (interchange)the two bytes.

0416 88 04 MOV [SI],AL0418 46 INC SI Point at the next

LOCN of the string.0419 E2 F1 (1) LOOP 040C Loop if CX is not

zero (i.e. continueprocessing till z=0)

041B 4B DEC BX At this juncture, firstsorting will be overi.e. first no. islogically

041C BE 00 05 MOV SI,0500 compared with therest of the nos. Forthe correct sorting,all the nos. mustbe compared witheach other logically,i.e. above processingshould be carried outno. of bytes times.

041F 75 E5 JNE 04060421 F4 HLT Halt.

For ExampleAfter Execution

0500 : 05 0502 : 28

0501 : 00 0503 : 25

0502 : 20 0504 : 20

0503 : 25 0505 : 15

0504 : 28 0506 : 07

0505 : 15

0506 : 07

Program - 13:

ASCII Multiplication

To multiply an ASCII string of eight numbers by a single ASCII digit. The result is a string of unpacked BCDdigits.

Add. Op Code Mnemonic Comments

0400 BE 00 05 MOV SI,0500 Load SI reg. withstarting addressof string.

0403 BF 08 05 MOV DI,0508 Load DI reg.with the startingaddress of result

www.hik-consulting.pl

Page 55: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 55

LOCNS.0406 B2 34 MOV DL,34 Load DL with the.

Multiplier ASCIIDigit.

0408 B9 08 00 MOV CX,0008 Load counter reg.with the no. of bytesin the string.

040B C6 05 00 MOV BYTE[DI],00

040E 80 E2 0F AND DL, 0F MS nibble ofMultiplier is zeroed.

0411 8A 04 MOV AL, [SI] First ASCII no. ofstring in AL.

0413 46 INC SI Point at the nextLOCN in string(of ASCII Nos.)

0414 24 0F AND AL, 0F MS nibble atMultiplier no gapand is also zeroed.

0416 F6 E2 MUL DL Perform the fn.AX = AL* DL

0418 D4 0A AAM Perform the fn.AH=AL/0A,AL=remainder.

041A 02 05 ADD AL,[DI] The contents of AL(remainder obtainedby performing theabove operation)

041C 37 AAA Added with 00 whichare in 1st Dest.LOCN. The contentsof AL are unpackedDecimal no. and arestored in 1st Dest.LOCN (=0508).

041D 88 05 MOV [DI],AL041F 47 INC DI Point at the next

Dest. LOCN.0420 88 25 MOV [DI],AH Contents of AH

(Quotient got inAAM operation)are moved in nextbest. LOCN (0509).

0422 49 DEC CX Decrement theCounter reg.

0423 75 EB JNE 0411 If not zero, continuemultiply and storingunpacked BCDdigits, ELSE.

0425 F4 HLT HALT.

For ExampleAfter Execution

(Unpacked BCD Digits)

0500 : 31 0508 : 04

www.hik-consulting.pl

Page 56: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 56

0501 : 32 0509 : 08

0502 : 33 050A : 02

0503 : 34 050B : 07

0504 : 35 050C : 01

0505 : 36 050D : 06

0506 : 31 050E : 06

0507 : 32 050F : 08

Program - 14:

To Divide a String of Unpacked ASCII Digits:

Add. Op Code Mnemonic Comments0400 B2 36 MOV DL, 36 DL having the

divisor, a single 8bit ASCII Digit.

0402 BE 00 05 MOV SI, 0500 Load SI with thestarting address ofASCII string.

0405 BF 08 05 MOV DI, 0508 Load DI with thestarting address ofthe result LOCNS.

0408 B9 08 00 MOV CX, 0008 Initialize the counterReg. with the no. ofbytes in the string.

040B 80 E2 0F AND DL, 0F MS nibble of DLcontents is zeroed.

040E 32 E4 XOR AH,AH Initialize the 8 bitACC (=00)

0410 AC LODSB Load AL with thecontents of addressaccessed by SI reg.and increment SIreg. i.e. point at thenext address LOCN.

0411 80 E0 0F AND AL,0F MS nibble of ALcontents is also zeroed.

0414 D5 0A AAD Perform the fn.AL=(AH * OA) + AL),AH = 00.

0416 F6 F2 DIV DL Perform the fn.AD/DL AL = Quotientand AH = reminder.

0418 AA STOSB The contents of ALare stored in theAddress pointed toby the DI reg. andnext address LOCNin DI reg. is pointed(i.e. current addressLOCN of DI reg. isincremented by one).

0419 E0 F5 LOOPNE 0410 Continue dividingthe unpacked ASCII

www.hik-consulting.pl

Page 57: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 57

digits if the contentsof C are not zeroed;else.

041B F4 HLT Halt.

For ExampleAfter Execution

0500 : 31 0508 : 00

0501 : 32 0509 : 02

0502 : 33 050A : 00

0503 : 34 050B : 05

0504 : 35 050C : 07

0505 : 36 050D : 06

0506 : 31 050E : 00

0507 : 32 050F : 02

Program - 15:

To calculate the no. of bytes in a string starting from 0502 up to an identifier (data byte) placed in ALreg. The actual count will be in LOCN 0500 & 0501.

Add. OpCode Mnemonic Comments

0400 BE 00 05 MOV SI, 0500 Load SI reg. withthe starting Addresswhere the result isto be stored.

0403 B9 FF FF MOV CX, FFFF Initialize thecounter register.

0406 BF 02 05 MOV DI, 0502 Load DI reg. withthe starting addressof string.

0409 B0 03 MOV AL, 03 Store the identifierin ASL.

040B F2 REPNE040C AE SCASB Data byte accessed

by DI reg. comparedwith identifier withoutaltering either of thecontents, this comparingcontinuous with theincrementing of DIcontents (AddressLOCN) till the twobytes match. With

each scanning thecontents of CX go ondecrement by one.

040D F7 D1 NOT CX Z’S complementedCX & Move CX 89 OCMOV (si),CX 040Fcontents into 0500.

040F F4 HLT Halt.

www.hik-consulting.pl

Page 58: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 58

For Example

Let (509) = 03 Let (0502) = 03

Then after executing the program CX = 0008 & (0500) = 08 (0501) = 00

Program - 16:

A Data string of no. of bytes (to be specified in CX reg.) is located from the starting address 0500. This datastring is to be converted to its equivalent 2' S complement Form and the result is to be stored from 0600 onwards.

Add. Op Code Mnemonic Comments

0400 BE 00 05 MOV SI, 0500 Load SI reg., withthe starting addressof data string.

0403 BF 00 06 MOV DI, 0600 Load DI with thestarting addressof result LOCNS.

0406 B9 10 00 MOV CX, 0010 Load CX with theno. of bytes in thestring.

0409 AC (1) LODSB Load AL with Databyte accessed by SIreg. and incrementthe address LOCNin SI reg.

040A F6 D8 NEG AL The contents of ALare 2’s comple-mented.

040C AA STOSB Store AL contentsin LOCN pointed toby DI ref. &increment thecurrent Locationin DI reg.

040D E0 FA Loop NE 0409 If CX = 0000,continue 2’scomplementingthe data in stringelse;

040F F4 HLT Halt.

For Example

After Execution

0500 : 01 0600 : FF

0501 : 02 0601 : FE

0502 : 03 0602 : FD

0503 : 04 0603 : FC

0504 : 05 0604 : FB

0505 : 06 0605 : FA

0506 : 07 0606 : F9

0507 : 08 0607 : F8

www.hik-consulting.pl

Page 59: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 59

0508 : 09 0608 : F7

0509 : 0A 0609 : F6

050A : 0B 060A : F5

050B : 0C 060B : F4

050C : 0D 060C : F3

050D : 0E 060D : F2

050E : 0F 060E : F1

050F : 10 060F : F0

Program 17:

Serial Port Programming

This following program will character from PC and displayed on LCD. The baud rate parameters to be set aresame as described earlier in this chapter. Use Hyper Terminal communication software on your PC which ismentioned in Serial Communication Chapter.

A). This program receives the character from PC and display it on LCD.

Add. OpCode Mnemonic Comments

0400 B0 B7 MOV AL,B7 control wordformat of 8253

0402 E6 03 OUT 03,AL0404 B0 13 MOV AL,13 count is given to

set the baud rateat 4800

0406 E6 02 OUT 02,AL0408 B0 00 MOV AL,00040A E6 02 OUT 02,AL040C B0 4E MOV AL,4E mode instruction

format inasynchronousmode

040E E6 51 OUT 51,AL0410 B0 05 MOV AL,05 command instruction

format make transitenable and receiveenable high

0412 E6 51 OUT 51,AL0414 9A 7C F0 00 F0 LM: CALLF000:F07Cclear the display0419 B3 80 MOV BL,80 delete the first

line041B 9A 78 F0 00 F0 CALLF000:F0780420 B9 14 00 MOV CX,00140423 E4 51 L1: IN AL,51 check for Rx

RDY signal0425 24 02 AND AL,020427 74 FA JE 04230429 E4 50 IN AL,50 character is received

from PC terminal& displayed intoLCD modulatorin first line

042B 9A 48 F0 00 F0 CALLF000:F0480430 E2 F1 LOOP04230432 B3 C0 MOV BL,C0 delete second line0434 9A 78 F0 00 F0 CALLF000:F0780439 B9 14 00 MOV CX,0014043C E4 51 L2: IN AL,51 check for Rx RDY

www.hik-consulting.pl

Page 60: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 60

signal043E 2402 AND AL,020440 74FA JE 043C0442 E4 50 IN AL,50 received the

character insecond line

0444 9A 48 F0 00 F0 CALLF000:F0480449 E2 F1 LOOP043C044B E9 C6 FF JMP 0414

Execute using ‘G’ 000:0400 and press any key on the PC keyboard, same will be displayed on the LCD displayof the NV5586A.

B). The following example will transmits characters to PC and simultaneously display on LCD.

Add. Op Code Mnemonic Comments

0400 B0 B7 MOV AL,B7 control wordformat for 8253

0402 E6 03 OUT 03,AL0404 B0 13 MOV AL,13 count is given to

set the baud rateat 4800

0406 E6 02 OUT 02,AL0408 B0 00 MOV AL,00040A E6 02 OUT 02,AL040C B0 4E MOV AL,4E mode instruction

format in asynch-ronous mode

040E E6 51 OUT 51,AL0410 B0 05 MOV AL,05 ;make transmit

enable and receiveenable high

0412 E6 51 OUT 51,AL0414 9A 7C F0 00 F0 L3: CALL F000:F07C clear the display0419 B9 14 00 MOV CX,0014041C B3 80 MOV BL,80 delete the first line041E 9A 78 F0 00 F0 CALL F000:F0780423 51 L2: PUSH CX0424 9A 50 F0 00 F0 CALL F000:F050 call for the read

key in CALLF000:F058;call thealphabetical key codeand transfer intosubprogram

0429 9A 58 F0 00 F0 CALL F000:F058 key in code enterinto LCD modulator.

042E 9A 48 F0 00 F0 CALL F000:F0480433 50 PUSH AX0434 E4 51 L1: IN AL,510436 24 01 AND AL,01 check for TxRDY

signal0438 74 FA JE 0434043A 58 POP AX043B E6 50 OUT 50,AL transmit the

character toCRT terminal

043D 59 POP CX043E E2 E3 LOOP 04230440 B9 14 00 MOV CX,00140443 B3 80 MOV BL,80 delete the first

line0445 9A 78 F0 00 F0 CALL F000:F078

www.hik-consulting.pl

Page 61: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 61

044A 51 L5: PUSH CX044B 9A 50 F0 00 F0 CALL F000:F050call for the read

key in0450 9A 58 F0 00 F0 CALL F000:F058call the alphabetical

key code & transferinto subprogram

0455 9A 48 F0 00 F0 CALL F000:F048key in code enterinto LCD modulator

045A 50 PUSH AX045B E4 51 L4: IN AL,51 check for TxRDY

signal045D 24 01 AND AL,01045F 74 FA JE 045B0461 58 POP AX0462 E6 50 OUT 50,AL Transmit the

character to CRTterminal

0464 59 POP CX0465 E2 E3 LOOP 044A0467 E9 AA FF JMP 0414

Execute using ‘G’ command from 0000:0400 and press any key of theNV5586A keyboard, the same will be displayed on the LCD and on the screen of PC.

Program 18:8259 Interrupt Controller

The following program illustrates the use of IRQ0 of 8259. Whenever user made Pin 18 of 8259 OR Pin 1 ofConnector CN6 is made low. The 0000:400 program branches to 2000 address.

Note: Keep SW2 in ON position while running this program.

Add. Op Code Mnemonic Comments

0400 B8 00 00 MOV AX,0000 data segment isinitialize to zero

0403 8E D8 MOV DS,AX0405 B8 00 20 MOV AX,2000 interrupt location

is defined0408 89 06 00 00 MOV [0000],AX040C B8 00 00 MOV AX,0000040F 89 06 02 00 MOV [0002],AX0413 B0 17 MOV AL,17 ICW1 Command0415 E6 30 OUT 30,AL0417 B0 00 MOV AL,00 ICW2 Command0419 E6 31 OUT 31,AL041B B0 01 MOV AL,01 ICW4 Command041D E6 31 OUT 31,AL041F B0 FE MOV AL,FE unmask IRQ00421 E6 31 OUT 31,AL0423 9A 7C F0 00 F0 CALL F0000:F07C clear display0428 B3 80 MOV BL,80 input parameter of

subprogram isstored in BL,clear 1st line

042A 9A 78 F0 00 F0 CALL F000:F078042F B080 MOV AL,80 write all the

commands in ALinto LCDmodulator

0431 9A 44 F0 00 F0 CALL F000:F0440436 0E PUSH CS

www.hik-consulting.pl

Page 62: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 62

0437 1F POP DS0438 B3 00 06 MOV SI,600 starting addr of

table is storedinto SI

043B BE 0F 00 MOV CX,000F store tablechecking lengthin CX

043E FC L1: CLD clear directionflag

043F AC L0DSB0440 9A 48 F0 00 F0 CALL F000:F048 input AL data

into LCDmodulator

0445 E2 F7 LOOP 043E0447 FB STI set interrupt flag0448 E9 FD FF JMP 0448 Interrupt sub-

routine at0000:2000

2000 9A 7C F0 00 F0 CALL F000:F07C clear the display2005 B3 80 MOV BL,80 delete the first

line2007 9A 78 F0 00 F0 CALL F000:F078200C B0 86 MOV AL,86 write all the

commands in ALinto LCDmodulator

200E 9A 44 F0 00 F0 CALL F000:F0442013 0E PUSH CS2014 1F POP DS2015 BE 21 06 MOV SI,621 addr of table is

stored in SI2018 B9 0D 00 MOV CX,00S0D table length

stored in CX201B FC L3: CLD201C AC L0DSB201D 9A 48 F0 00 F0 CALL F000:F048 input AL data

into LCDmodulator

2022 E2 F7 LOOP 201B2024 CF IRET return to the

execution program

0600 57 41 49 54 49 4E 47 20 Waiting For IRQ0

46 4F 52 20 49 4E 54 FF Interrupt

0621 49 52 30 20 49 4E 54

45 52 52 55 50 54

www.hik-consulting.pl

Page 63: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 63

Use of 8087 Processor:

The following programs illustrate the use of 8087 processor.

Problem – 19:

Write a program to calculate N3= ÖN12 + N22 32 bit integer value stored at 300 H and 304H respectively. Theresult should be store at 308H.

Steps Required:

1. Load N1 and calculate its N12 value

2. Load N2 and calculate its N22 value

3. Add the two.

4. Take the square root and store it in 308 location.

Addr. Op Code Mnemonic Comments

Step-10200 9B BB 00 03 MOV BX,0300H BX POINTS TO N10204 DB 07 FLD (BX) Load N10206 9B DA 0F FMUL (DX) Give wait calculate

N12Step-20209 9B DD D9 FSTP ST (1) Load N2 in ST (1)020C 9B BB 04 03 MOV BX, 0304 H Load Bx to

point N20210 DB 07 FLD (Bx) Load N20212 9B DA 0F FMUL (Bx) Get N22Step-30215 9B D8 C1 FADD ST (1) Add the N12 +

N22 the result ison TOP of stack.

Step-40218 9B D9 FA FSQRT Calculate square

root of N12 + 22021B 9B BB 08 03 MOV BX, 0308 Load BX with

0308 for storingresult.

021F DB 17 FST (BX) Store the result (TOS)0221 9B FWAIT ON 0308.0222 CC INT 3 Give Break Point.

Steps required for running the program:

1. Enter the program from 0000: 0200 location.

2. Set up the data in memory location 300 and 304.

N1 0300 : 09 00 00 00

N2 0304 : 04 00 00 00

3. Run the program by GO Command and see the result as follows:

N3 0308 : 0A 00 00 00

www.hik-consulting.pl

Page 64: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 64

Problem:

Write a program to calculate Sin (z) where Z - is defined in degrees.

Solution: Sin (z) is calculated using tangent function of 8087.

tan (Z/2) = Y/X

then Sin (z) =YX

2XY

+

The FPTAN instruction has to be given data in radians. The value of degrees is to be converted in radian. Onexecution of FPTAN the result is return in Y/X format where X is written on top of stack and Y is the next to topof stack. Further the argument must satisfy 0< argument < P1/4. This is the reason we restrict Z to satisfy 0< Z< 90.

This restriction can be eliminated, by more computation. If Z is unrestricted, then the use of FPREM function of8087 to reduce the argument to the required range and use the relation Sin (P1 + Z) = -Sin z

The above problem is solved by calculating Z/2, then converting the degrees into radians and then calculating thetangents. The resulting values of X and Y are used for calculating Sin (Z).

The following steps are required to implement this program.

1. Calculating the Z/2

2. Calculate the angle in radians.

3. Calculate tan (Z/2) = X/Y format.

4. Calculate Sin Z =Y2X2

2XY

+

5. Get the integer value argument - 4.

Add. Opcode Mnemonic Comments

Step-10200 B4 00 MOV AH, 00 Clear AH0202 D1 E8 SHR AX, 01 Z = Z/2.0204 A3 00 03 MOV, W ARGI,AX Load AX in Arg.10207 DF 06 00 03 FILD ARGI Loading Z\2 on TOSStep-2020B C7 06 02 03 MOVWARG 2,00B4 ARG 2 I is loaded

with B4 i.e. 180°value in hex.

020F B4 000211 9B DF 06 02 03 FILD ARG 2 Insert F Wait and

load AR G2.0216 9B DE F9 FDIVRP Wait and divide

ST (O) = z/180.0219 9B D9 EB FILDP ST (O) = PI021C 9B DE C9 FMULRP ST (O) = PI X Z/180

Total Angle In RadiansStep-3021F 9B D9 F2 FTAN Calculate tan Z/2

as Y/X.0222 9B D9 F0 FILD ST(O) Duplicate X on

top of stack.Step-40225 9B D8 C9 FMUL ST,ST(1) ST (O) =X * X0228 9B D9 C2 FILD ST (2) ST (O) = Y.022B 9B D8 CB FMUL ST (O),ST 3 ST (O) = Y * Y022E 9B DE C1 FADDP ST (1),ST(O) YXY is popped

of and top of stack

www.hik-consulting.pl

Page 65: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 65

ST(O) = X2 + Y2.0231 9B DE F9 FDIVRP ST (O) = x/x2 + Y20234 9B DE C9 FMULRP ST (O) = XY/X2+Y20237 9B D9 C0 FLD ST (O) Duplicate the top

of stack.023A 9B DE C1 FADDP ST(I),ST(O) ST(O)= 2XY/

(X2+Y2) =Sing(Z).Step-5023D C7 06 04 03 MOV,W ARG Load ARG3 with

E 2710H 10 2710,000 value

0243 9B DF 06 04 03 FILD ARG 30248 9B DE C9 FMURP ST (0)=10,000*

SIN(Z)024B 9B D9 FC FRND INT Round the integer.024E 9B DF 36 06 03 FSTP ARG4 Store it in BCD

form.0253 9B FWAIT0254 A1 06 03 MOV,AX,ARG4 The result is stored

at 0306 and Ax. Goto monitor.

0257 CC CC Go to monitor.

In the addition to above, the stack operation on each instruction execution is shown. This will help to understandthe program in details. This way of writing will help user to gain confidence in writing the program for 8087.

Steps required implementing the program:

1. Enter the above program.

2. Do not use any memory location from 0300 to 0308 as they are required for implementing the program.

3. Enter the value of angle in AL, say for calculating Sin 30, the AL should be 1EH.

4. Execute the program and observe the value in AX, the result will be AX=5000H. The output in packedBCD form is available in the register AX. A decimal point is to be assumed before the first BCD digit.

5. Execute the program for various values of Sin Z

Input Output Sin Z

(AL) (AX)

10 2756 Sin 16

2E 7193 Sin 46

3C 8660 Sin 60

56 9976 Sin 86

The stack operation on execution of each instruction.

1. FLDI ARGI

ST (0) -—> ————ARGI z

————2. FILD ARG2

ST (0) -—- ARG 180°

ST (1) --— ARGI Z

3. FDIVRP

ST (0) --— Z/180

4. FLDPI

www.hik-consulting.pl

Page 66: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 66

ST (0) --—> PI

ST (1) Z/180

5. FMULRP

ST (0) —-- PI * Z/180

ST (1) Z/180

6. FPTAN

ST (0) --— X

ST (1) Y

ST (2) Z/180

7. FLX ST (0)

ST (0) X

ST (1) X

ST (2) Y

ST (3) Z/180

8. FMUL ST (0), ST (1)

ST (0) X2

ST (1) X

ST (2) Y

ST (3) Z/180

9. FLD ST (2)

ST (0) Y

ST (1) X2

ST (2) X

ST (3) Y

ST (4) Z/180

10. FLD ST (0), ST (3)

ST (0) X2

ST (1) X2

ST (2) X

ST (3) Y

ST (4) Z/180

11. FADDP ST (1) ST (0)

ST (0) X2 + Y2

ST (1) X

ST (2) Y

ST (3) Z/180

12. FDIVRP

ST (0) X/X2 + Y2

ST (1) Y

ST (2) Z/180

13. FMULRP

ST (0) XY/X2 + Y2

ST (1) Z/180

14. FLD ST (0)

ST (0) XY/X2 + Y2

www.hik-consulting.pl

Page 67: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 67

ST (1) XY/X2 + Y2

ST (2) Z/180

15. FADD P ST (1), ST (0)

ST (0) 2XY/X2 + Y2

ST (0) =SIN (Z)

16. FLDI ARG 3

ST (0) 10,000

ST (1) SIN(Z)

17. FMUR P

ST (0) 10,000 X

SIN Z

18. FRNDINT

ST (0) Rounding the integer

19. FSTP AR G 4The argument has the result.

Program – 20:

This is a sample program for Port A,B,C of 8255-I generating square wave output at Connector 8255-I.

Address Code LABEL Mnemonic Comments

0400 B0 80 MOV AL,80H ;INIT 8255 CWR0402 E6 76 OUT 66H,AL ;PA,PB,PC AS

OUTPUT PORT0404 B0 55 Start: MOV AL,55H ;MOVE ACC

DATA 55H0406 E6 70 OUT 60H,AL ;OUT AT PA0408 E6 72 OUT 62H,AL ; OUT AT PB040A E6 74 OUT 64H,AL ;OUT AT PB040C E8 0D 00 CALLDELAY1040F B0 AA MOV AL,0AAH ;Move Acc

data AAH0411 E6 70 OUT 60H,AL ;OUT AT PA0413 E6 72 OUT 62H,AL ; OUT AT PB0415 E6 74 OUT 64H,AL ;OUT AT PB0417 E8 02 00 CALLDELAY1041A EB E8 JMP START ;JUMP TO START041C B9 0000Delay1:MOV CX,0FFFFH ;DELAY ROUTINE041F 49 DL1: DEC CX0420 75 FD JNE DL10422 C3 RET

www.hik-consulting.pl

Page 68: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 68

On-Board Interface

ADC-0809 (Analog Input):

NV5586A provides an onboard interface for ADC 0809 chip which allows the user to have 8 analog inputchannels, namely A0 to A7. These input points are brought out at the block Channels. ADC0809 is an 8 bit A/Dchip designed here to provide an input level of 0 to 5 volts.

The procedure to be followed for using ADC 0809 is as follows:

1. ADC0809 is internally interfaced with 8255-I so port address for 8255-I should be followed forcommunicating with ADC chip.

2. Select ADC with the help of Rotary provided on Trainer

3. Select channel by outputting the code 00 to 07 at Port address 01.

4. Send a SOC and ALE (Start of conversion by outputting 00,03 at Port address 02).

5. Input from Port address 02 to check for EOC (end of conversion) at D0.

6. Read the ADC 0809 by inputting from Port address 00.

These addresses are given in I/O MAPPING details. After executing the below program, it displays all 8channels in the LCD screen. The input for 8 Channel ADC are provided on trainer A0 to A7.

Program:

The following program reads the Input voltage from A0 to A7 i.e.Channel-1 to Channel-8 and displays the sameon the LCD screen.

Port A 70H

Port B 72H

Port C 74H

Control Word 76H

Put this program directly on any Text Editor and give Extension as .ASM and compile with MASM Assembler

CODE SEGMENTASSUME CS: CODE, DS: CODEPROG PROC FAR

ORG 0400HMOV AL,98H ;INTIALISE 8255OUT 76H,AL; ;PA & PC Upper as Input &

PB & PC Lower as Output

CH1: MOV AL,00H ;Select Channel A0CALL ATD ;Send SOC and ALE

Pulse and Check for EOCCALL CLEAR ;Clear LCDMOV BL,80H ;SELECT LCD LOCATIONCALL ATDAT ;Send Data to LCD

CH2: MOV AL,01H ;Select Channel A1CALL ATDMOV BL,085H ;SELECT LCD LOCATIONCALL ATDAT

CH3: MOV AL,02H ;Select Channel A2CALL ATDMOV BL,8AH ;SELECT LCD LOCATIONCALL ATDAT

CH4: MOV AL,03H ;Select Channel A3CALL ATD

www.hik-consulting.pl

Page 69: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 69

MOV BL,8FH ;SELECT LCD LOCATIONCALL ATDAT

CH5: MOV AL,04H ;Select Channel A4CALL ATDMOV BL,0C0H ;SELECT LCD LOCATIONCALL ATDAT

CH6: MOV AL,05H ;Select Channel A5CALL ATDMOV BL,0C5H ;SELECT LCD LOCATIONCALL ATDAT

CH7: MOV AL,06H ;Select Channel A6CALL ATDMOV BL,0CAH ;SELECT LCD LOCATIONCALL ATDAT

CH8: MOV AL,07H ;Select Channel A7CALL ATDMOV BL,0CFH ;SELECT LCD LOCATIONCALL ATDATJMP CH1

PROG ENDPATD: OUT 72H,AL ;OUT AT PORT-B

MOV AL,00H ;GIVE SOC & ALE PULSE AS 0OUT 74H,AL ;OUT AT PORT-CMOV AL,03H ;GIVE SOC & ALE PULSE AS 1OUT 74H,AL ;OUT AT PORT-CMOV AL,00H ;GIVE SOC & ALE PULSE AS 0OUT 74H,AL ;OUT AT PORT-C

EOC1: IN AL,74H ;READ EOC FROM PORT-CAND AL,10H ;CHECK EOC AT PC4 BITJZ EOC1 ;JUMP TILL EOC=1MOV AL,04H ;GIVE OUTPUT ENABLE AS 1OUT 74H,AL ;OUT AT PORT-CIN AL,70H ;READ 8 BIT ADC DATA FROM

PORT-ARET

CLEAR: DB 9AH,7CH,0F0H,00H,0F0H ;CALL 0F000:F07C clear LCD

ScreenRET

ATDAT:MOVAH,00H ;Put 00 in AHDB 9AH,94H,0F0H,00H,0F0H ;CALL DISPLAY ROUTINE

CALL F000:F094MOV CX,0555H ;Give some time

LP1: DEC CXJNZ LP1RET

CODE ENDSEND

DAC-0800 (Analog Output):

A D/A converter chip DAC 0800 has been provided on the board of NV5585A to enable the user to have analogoutput. This can be used for generating various waveforms or for any closed loop applications. The chip has beeninterfaced with 8255-I internally and has an address of (00 to 04).

This chip has been designed to give an output of 0 to 8 Volts. The output of DAC 0800 is coming at Xout andYout terminal. After executing the below program “RAMP OUTPUT” is displayed in the CRO.

www.hik-consulting.pl

Page 70: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 70

Program:

The following program will generate a Ramp (a triangular waveform) output at Xout and Yout.

PROGRAM TO GIVE RAMP OUTPUT AT X-OUT & Y-OUT

Add. Opcodes Mnemonics Comments

0400 B0 80 MOV AL,80H

0402 BA FE FF MOV DX,0FFFEH ;INTIALISE 8255

0405 EE OUT DX,AL ;PA & PB AS OUTPUT

0406 B0 00 MOV AL,0H ;SELECT A AS DATA 00

0408 BA F8 FF START: MOV DX,0FFF8H

040B EE OUT DX,AL ;OUT AT X-OUT

040C BA FA FF MOV DX,0FFFAH

040F EE OUT DX,AL ;OUT AT Y-OUT

0410 FE C0 INC AL ;INCREMENT A

0412 EB F4 JMP START ;JUMP TO START

Program:

The following program will generate a Sine wave output at Xout and Yout.

For finding Sine wave Angles

Value=(5+(5* sinθ)) * 25.6

Where θ = 0 – 360

Here Samples are for 10 degree

Add. Code Labels Mnemonics Comments

0400 B0 80 MOV AL,80H ; using Port A, Bfor output

0402 E6 76 OUT 76H,AL ; setting CW

0404 BE 1604 Loop2: MOV SI,0416H ; place samplesin memory

0407 B1 24 MOV CL,24H0409 8A 04 Loop1: MOV AL,[SI] ; Get whatever

is at 0416040B E6 70 OUT 70H,AL ; Output DAC 1,

Port A,040D E6 72 OUT 72H,AL040F 46 INC SI ; Increase memory

location0410 FE C9 DEC CL ; Decrement Counter0412 75 F5 JNE LOOP10414 EB EE JMP LOOP2 ; keep on doing this

Put this data manually using D command at address 0000:04160416

80, 96, AC, C0, D2 , E2, EE, F8, FE, FF, FE, F8, EE, E2, D2, C0, AC, 96, 80

69, 54, 40, 2D, 1E, 11, 07, 02, 00, 02, 07, 11, 1E, 2D, 40, 54, 69, 80

www.hik-consulting.pl

Page 71: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 71

Parallel Commutation between two NV5586A Trainers using 8255 in i/o mode

Note-: Power on the supply of both trainers before connecting the 26 Pin FRC cable

Connect the 8255-1 of both trainers using 26 FRC cable

For transmit data fill the program given below in trainer

MemoryAddress

Opcode Mnemonics Comments

400 B0 82 MOV AL,82402 E6 76 OUT 76,AL404 B0 99 MOV AL,99 Data to transfer406 E6 70 OUT 70,AL Send data to

8255-1408 9A 7C F000

F0CALL F000:F07C

Call thedisplayfunction

40D B4 00 MOV AH,0040F B3 80 MOV BL ,80411 9A 94 F000

F0CALLF000:F094

416 E0 EB FF JMP 404 Jump to 404location

For receiver fill the program given below in second trainer

MemoryAddress

Opcode Menemonic Comments

400 B0 82 MOV AL,82 Set 8255-1 fori/o

402 E6 76 OUT 76,AL404 E4 70 IN AL,70 Read the port406 9A 7C F000 F0 CALL F000:F07C40B B4 00 MOV AH, 0040D B3 00 MOV BL, 0040F 9A 94 F000 F0 CALL F000:F094414 E9 ED FF JMP 404 Jump to

location 404

When both program entered then data entered at transmit trainer is displayed on receiving trainer. Forabove programs 99 are displayed on receiving trainer LCD.

www.hik-consulting.pl

Page 72: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 72

Serial Commutation between two NV5586A Trainers

For serial commutation between the two trainers connect the male to male RS232 cable provided withNV5586A trainers. And follow the procedure given below

1. On NV5586A, execute from F000:F003 using G command as follows:

2. Press Enter key and the following will come on the display:

For serial commutation one trainer transmits data and other receives the data:

Procedure for transmitter trainer:

1. For transmit data press F7 on trainer keyboard to come in the OUT mode.

2. 1st location indicates the starting address (F000:0400) and the 2nd location indicates the endaddress (0400) of the memory area to be transmitted on to the Serial Port. Change this to 0000:0400to 04FF as follows:

Then press the enter to transmit data

Procedure for receiver trainer:

1. On NV5586A, execute from F000:F003 using G command as follows:

2. Press Enter key and the following will come on the display:

Change the location from F000:0400 to 0000:0400. This is the 1st RAM location data will be received fromthe transmitter trainer and this address will keep on incrementing on receipt of each Data Byte.

3. Press enter button on trainer button & then press the enter button on transmitter trainer

Note: Please short the jumper JP4 of both trainer on pin 1 & 2 for clock settings.

www.hik-consulting.pl

Page 73: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 73

Connector/Jumper Detail

The details of the various connectors on the board of NV5586A are as follows:

Bus Connector 50 Pin:

Pin Signal

1 +5V2 +5V3 GND4 GND5 AD36 AD77 AD28 AD69 AD110 AD511 AD012 AD413 A814 A1615 A716 A1517 A618 A1419 A520 A1321 A422 A1223 A324 A1125 A2

Pin Signal

26 A1027 A128 A929 IOWR30 IORD31 S232 S233 MEMWR34 MEMRD35 ALE36 ALE37 S138 S039 HLDA40 HOLD41 INTA42 INTR43 READY44 NMI45 RESET OUT46 RESET IN47 CLK OUT48 I/O-CS49 MEM-CS50 MEM-CS

RS-232C Serial Connector:

Pin Signal

1 NC2 Rxd3 Txd4 DTR5 GND6 DSR7 RTS8 CTS9 NC

Power Supply Connector Left and Right side:

Pin Signal

1 +5V2 GND3 +12V4 -12V

www.hik-consulting.pl

Page 74: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 74

8255-II Connector:Pin Signal

1 P2C42 P2C53 P2C24 P2C35 P2C06 P2C17 P2B68 P2B79 P2B410 P2B511 P2B212 P2B313 P2B0

Pin Signal

14 P2B115 P2A616 P2A717 P2A418 P2A519 P2A220 P2A321 P2A022 P2A123 P2C624 P2C725 GND26 +5V (VCC)

8255-I Connector:

Pin Signal

1 P1C42 P1C53 P1C24 P1C35 P1C06 P1C17 P1B68 P1B79 P1B410 P1B511 P1B212 P1B313 P1B0

14 P1B115 P1A616 P1A717 P1A418 P1A519 P1A220 P1A321 P1A022 P1A123 P1C624 P1C725 GND26 +5V (VCC)

8255-III Connector:

Pin Signal

1 P3C42 P3C53 P3C24 P3C35 P3C06 P3C17 P3B68 P3B79 P3B410 P3B511 P3B212 P3B313 P3B0

14 P3B115 P3A616 P3A717 P3A418 P3A519 P3A220 P3A321 P3A022 P3A123 P3C624 P3C725 GND26 +5V(VCC)

www.hik-consulting.pl

Page 75: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 75

8259/8253 Connector:

Pin Signal

1 IR02 IR13 IR24 IR35 IR46 IR57 IR68 IR79 CLK010 OUT0

11 GATE012 OUT113 GATE114 CLK115 GATE216 OUT217 CLK218 NC19 GND20 +5V (VCC)

Mode Selection Rotary:

• Normal : NV5586A works in Normal Mode

• ADC : NV5586A works with inbuilt ADC support

• DAC : NV5586A works with inbuilt DAC support

POT P1: Variable input for Channel 0 of inbuilt ADC when Jumper JP3 pin 2 & 3 is shorted

ADC CHANNELS: Input channels A0 to A7 for inbuilt ADC

DAC Output: 2 Output channels of inbuilt DAC

RST: To Reset system.

www.hik-consulting.pl

Page 76: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 76

Jumper/Dip Switch Details

Short 1 & 2 for default RAM

Factory setting: Short 1 & 2

Short 1 & 2 for +5V to RAM

Short 2 & 3 for Battery Supply to RAM

Factory setting: Short 1 & 2

Short 1 & 2 for External ADC Input at Channel 0

Short 2 & 3 for Internal ADC Input at Channel0 from POT P1

Factory setting: Short 2 & 3

Short 1 & 2 for 2 MHz Clock to 8086 CPU

Short 2 & 3 for 1 MHz Clock to 8086 CPU

Factory setting: Short 2 & 3

Reserved for Future

SW1:

OFF- All switches from 1-4 by default

When running External 8259 Interrupt Controller please modify switch positions as defined

1. ON

2. OFF

3. OFF

4. OFF

www.hik-consulting.pl

Page 77: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 77

Block Diagram

www.hik-consulting.pl

Page 78: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 78

Warranty

1. We guarantee the instrument against all manufacturing defects during 24 months from the date of sale by usor through our dealers.

2. The guarantee covers manufacturing defects in respect of indigenous components and material limited tothe warranty extended to us by the original manufacturer, and defect will be rectified as far as lies withinour control.

3. The guarantee does not cover perishable item like cathode ray tubes, crystals, batteries, photocells etc. otherimported components.

4. The guarantee will become INVALID.

a) If the instrument is not operated as per instruction given in the learning material.b) If the agreed payment terms and other conditions of sale are not followed.c) If the customer resells the instrument to another party.d) Provided no attempt have been made to service and modify the instrument.

5. The non-working of the instrument is to be communicated to us immediately giving full details of thecomplaints and defects noticed specifically mentioning the type and sr. no. of the instrument, date ofpurchase etc.

6. The repair work will be carried out, provided the instrument is dispatched securely packed and insured withthe railways. To and fro charges will be to the account of the customer.

www.hik-consulting.pl

Page 79: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 79

List of Service Center

BarodaFlat No. A/1, Mudra Complex,Behind Sudha Hotel, Ellora Park,Baroda-390023 (Gujarat)Tel: +91-0265-3089505Fax : +91- 0265-3089506email : [email protected]

GuwahatiAvijit Roy Building, A.K. DevRoad, Fatashil Ambari, Nearjalaram Mandir,Guwahati-25 AssamMobile: 09435144068email: [email protected]

Indore94, Electronic Complex,Pardesipura, Indore-452 010Tel: 91-731-2570301/02,4211100,Fax: 91-731-2555643E-mail: [email protected]

New DelhiFirst Floor, C-19, F.I.E.,Patparganj Industrial Area,Delhi-110092 (INDIA)Ph: 011- 22157370, 22157371,Fax: +91-011-22157369email: [email protected]

Bangalore202/19, 4th Main Street,Ganganagar, Bangalore - 560032Ph.: +91-080-41285011T.Fax: +91-080-41285022email: [email protected]

KolkataAC-101, Prafullla Kanan, NearKestopur Bus Stop, Krishnapur,Kolkata- 700059 (West Bengal)Tel: +91 33-65266800Mob: 9433029888email: [email protected]

MumbaiE Type, Bldg No. 5/1/3, Sector1,Vashi, Navi Mumbai-400703Ph: +91-022-27826616,65266616email: [email protected]

JaipurFlat No. G-2, S-101, BhagatVatika North, Civil Lines,Jaipur - 302006 (Raj.)Mobile: 097998-10236email: [email protected]

LucknowFirst Floor, 279/54/20/A,Chuhar Singh Colony, Pan .Dariba, Lucknow (U.P.)Mobile: 09918670737email: [email protected]

HyderabadPlot No. 24, Flat no. 203, LaxmiResidency, ChandragiriHousing Society, TrimulgherrySecunderabad- 500015.Ph:040-27740147,9247712763email: [email protected]

Cochin/KochiC/o Pragalbha Valsan,Poriyamadathil house, ABMSLane, Asoka Road,Near Mathrubhumi, Kaloor,Kochi - 682 017Ph: 0484-2409441email: [email protected]

Chandigarh201, 2nd floor KMB Hosp-Itality Services, SCO 19, NearKabir Petrol Pump, Ambala-Zirakpur Highway Zirakpur,Mohali - 140603Ph.: 0172-6530329email: [email protected]

Pune105/106, 1st floor, Ajinkyatara,Ganesh Mala, Sinhgad Road,Pune - 411030Ph.: +91-020-24254244/55Fax: +91-020-24254244email: [email protected]

ChennaiFlat C, 1st Floor, Old No. 49New No. 64, Bajanai Koil Street,Sriram Nagar Extention,Pallipattu, Chennai-600113Tel: 044-43514212, 43514213email: [email protected]

OrissaPlot No-67 (1st Floor) Aerodrom Area,Vimpur mouzaNear Vimpur Primary SchoolBhubaneswar- 751020Mobile: 09238307873email: [email protected]

www.hik-consulting.pl

Page 80: Advanced 8086 Microprocessor Trainer · PDF fileAdvanced 8086 Microprocessor Trainer ... Block Diagram 77 17. W arranty 78 ... The 8086 and 8088 are designed to be used with the 8089

NV5586A

Nvis Technologies Pvt. Ltd. 80

List of Accessories1. Learning Material 1No.

2. 26 Pin FRC Cable 3 Nos.

3. 50 Pin FRC Cable 1 No.

4. RS232 Cable 1 No.

5. SMPS Supply 1 No.

6. Mains Cord 1 No.

6. Jumpers 4 Nos.

7. Phoenix Connector 1 No.

8. Keyboard 1 No.

9. Keyboard Adaptor 1 No

10. 20 Pin FRC Cable 1 No

www.hik-consulting.pl