Вы находитесь на странице: 1из 73

NV5585 8085 MICROPROCESSOR TRAINER

141-B, Electronic Complex, Pardeshipura, Indore- 452 010, India Tel.: 91-7314211500 Email: info@nvistech.com Toll free: 1800-103-5050

NV5585

NVIS Technologies

NV5585 NV5585 8085 BASED MICROPROCESSOR TRAINER TABLE OF CONTENTS

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22.

System Introduction System Specification System Capabilities System Installation Hardware Description Keyboard Description Command Description Serial Command Xassembler Memory/IO Mapping Subroutines Sample Programs Connectors Jumper Hardware Interrupt Software Interrupt 8085 Instruction Set 8085 Pin Details NV5585 Block Diagram Warranty List of Accessories List of Service Centers

4 5 6 7 8 10 14 25 34 40 43 51 61 63 64 66 66 70 71 72 73 74

NVIS Technologies

NV5585 SYSTEM INTRODUCTION General Description: NV5585 is a single board Microprocessor Training based on 8085 Microprocessor, which is widely used to train engineers to develop software/hardware for any industrial process & control. NV5585 provides powerful monitor EPROM & user's RAM. The trainer has 28 keys Hexadecimal Keyboard and six digit seven segment display for any data entry display. The trainer also has the capability of interacting with PC (COMPUTER) through RS-232C Serial Communication Link. The Input /Output structure of NV5585 provides 24 programmable I/O lines using 8255 and 22 Programmable I/O lines using 8155. It has got 16 bit 3 channel programmable Timer/Counter using 8253. . The on board residents system monitor software is very powerful and provides various software utilities like INSERT, DELETE, BLOCK MOVE, RELOCATE, FILL & MEMORY COMPARE etc. which are very helpful in debugging/developing the software. The bus of the CPU is available on 50 pin FRC connector which can be used to connect other systems through bus.

NVIS Technologies

NV5585 SYSTEM SPECIFICATION CPU Monitor EPROM RAM Timer I/O Keyboard : : : : : : 8 bit Microprocessor, the 8085. 8K bytes of monitor program. EPROM user's loaded RAM with using powerful 6264

8K bytes of expandable upto 64K. 24 I/O lines using 8255 22 I/O lines using 8155

16 bit programmable timer/counter using 8253.

28 Hex Key pad consist of 10 keys for command, 16 keys for hexadecimal data entry, 1 key for Reset & 1 key for RST 7.5 VCT. 6 Digit Seven Segment Displays (4 for address field & 2 for data field) All data, address and control signals (TTL compatible) available at 50 Pin FRC connector RS-232C serial interface through SID/SOD line. +5V/1A & 12V/250mA. 32.7cm x 25.33cm. 0 to 50C.

Display Bus Serial Interface Power Supply Physical Size Operating Temp.

: : : : : :

NVIS Technologies

NV5585 SYSTEM CAPABILITIES

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.


Note:

Examine the contents of any memory location. Examine/Modify the contents of any of the up internal register. Modify the contents of any of the RAM location. Move a block of data from one location to another location. Insert one or more instructions in the user program. Delete one or more instructions from the user program. Relocate a program written for some memory area to some other memory area. Fill a particular memory area with a constant. Compare two block of memory. Insert one or more data bytes in the users program/data area. Delete one or more data bytes from the users program/data area. Execute a program at full clock speed. Execute a program in single step i.e. instruction by instruction. All the above commands can be operated through Serial mode provided.

SYSTEM INSTALLATION

NVIS Technologies

NV5585 Keyboard mode : To install NV5585 in keyboard mode, the following additional things are required.

1. 2. 3. 4.

Connect the AC Power Supply through AC Power Chord provided to the NV5585 Trainer. Switch on the Power Supply from Rocker switch. A message 85 . NVS 85 will come on display (PRESS RESET if you do not get NVS

Now NV5585 trainer is ready for the user's experiments for Keyboard Mode commands.

Serial Mode : To install NV5585 in serial mode, the following additional things are required.

1. 2. 3. 4.

Steps 1, 2 and 3 will remain same for Serial Mode. Connect RS-232C Cable from PC Serial Port (Com-1 OR Com-2) to the connector CN5 of the NV5585 trainer. Switch ON the Hyper Terminal of Win95/98 and set the Baudrate at 4800bps. Press `SER' Key on NV5585 trainer and press `Enter' key on PC keyboard. A message `.*' will be displayed on the PC screen. It indicating that now the command can be entered from the PC terminal. Now NV5585 trainer is ready for the user's experiments for Serial Mode commands.

5.

NVIS Technologies

NV5585 HARDWARE DESCRIPTION CPU : The system has got 8085 as the Central Processing Unit. The clock frequency for the system is 3.07 MHz and is generated from a crystal of 6.14 MHz. 8085 has got 8 data lines and 16 address lines. The lower 8 address lines and 8 bit data lines are multiplexed. Since the lower 8 address bits appear on the bus during the first clock cycle of a machine cycle and the 8 bit data appears on the bus during the 2nd and 3rd clock cycle, it becomes necessary to latch the lower 8 address bits during the first clock cycle so that the 16 bit address remains available in subsequent cycles. This is achieved using a latch 74-LS-373. Memory : NV5585 provides 8K bytes of CMOS RAM using 6264 chip and 8K bytes of Powerful Monitor EPROM. This trainer has the facility for expanding RAM/ROM in the expansion socket. Total on board memory can be expanded up to 64K bytes. I/O Devices : The various I/O chips used in NV5585 are 8279, 8255, 8155 & 8253. The functional role of all these chips is given below: 8279 (Keyboard & Display Controller) : 8279 is a general purpose programmable keyboard and display I/O interface device designed for use with the 8085 microprocessor. It provides a scanned interface to 28 contact key matrix provided in NV5585 and scanned interface for the six seven segment displays. 8279 has got 16 x 8 display RAM which can be loaded or interrogated by the CPU. When a key is pressed, its corresponding code is entered in the FIFO queue of 8279 and can now be read by the microprocessor. 8279 also refreshes the display RAM automatically. 8255 (Programmable Peripheral Interface) : 8255 is a programmable peripheral interface (PPI) designed to use with 8085 Microprocessor. This basically acts as a general purpose I/O device to interface peripheral equipments to the system bus. It is not necessary to have an external logic to interface with peripheral devices since the functional configuration of 8255 is programmed by the system software. It has got three Input/Output ports of 8 lines each (PORT-A, PORT-B & PORT-C). Port C can be divided into two ports of 4 lines each named as Port C upper and Port C lower. Any Input/Output combination of Port A, Port B, Port C upper and lower can be defined using the appropriate software commands. 8155 (Programmable I/O Port & Timer Interface) : 8155 is a programmable I/O ports and timer interface designed to use with 8085 Microprocessor. The 8155 includes 256 bytes of R/W memory, three I/O ports and a Timer. This basically acts as a general purpose I/O device to interface peripheral equipments to the system bus. It is not necessary to have an external logic to interface with peripheral devices since the functional configuration of 8155 is programmed by the system software. It has got two 8-bit parallel I/O port ( Port-A, Port-B) and one 6-bit (Port-C). Ports A & B also can be programmed in the handshake mode, each port using three signals as handshake signals from Port-C. The timer is a 14 bit down counter and has four modes.

NVIS Technologies

NV5585 8253 (Programmable Internal Timer) : This chip is a programmable internal Timer/Counter and can be used for the generation of accurate time delays under software control. Various other functions that can be implemented with this chip are programmable rate generator, Even Counter, Binary rate Multiplier, Real Time Clock etc. This chip has got three in dependent 16 bit counters each having a count rate of up to 2KHz. The first Timer/Counter (i.e. Counter 0) is being used for Single Step operation. However, its connection are also brought at connector. For single step operation CLK0 signal of Counter 0 is getting a clock frequency of 1.535 MHz. Display : NV5585 provides six digits of seven segment display. Four digits are for displaying the address of any location or name of any register, whereas the rest of the two digits are meant for displaying the contents of a memory location or of a register. All the six digits of the display are in hexadecimal notation.

NVIS Technologies

NV5585 KEYBOARD DESCRIPTION NV5585 has 28 keys and six-seven segment display to communicate with the outside world. As NV5585 is switches on, a message NVS 85 is displayed on the display and all keys are in command mode. The key board is as shown below.

Reset the system.

Hardware interrupt via keyboard, RST 7.5. Provides a second level command to all keys. To execute the program.

To execute the program in single step mode.

NVIS Technologies

10

NV5585

Examine Register; allows user to examine and modify the contents of different registers.

Examine Memory; allows user to examine any memory location and modify any RAM location. Previous is used as an intermediate terminator in case of Examine Memory. It decrements the PC contents and writes the contents of data field to the address displayed in the address location.

Increment is used as a intermediate terminator in case of Examine Memory, Examine Register etc. It increments the PC Contents and writes the data lying in data field at the location displayed at address field. Terminator is used to terminate the command and write the data in data field at the location displayed in address field. Delete the part of program or data, with relocation by one or more bytes.

Inserts the part of the program or data with relocation, by one or more bytes. Allows user to move a block of memory to any RAM area. Allows user to fill RAM area with a constant. Relocates a program written for some memory area and to be transferred to other memory area. Inserts one or more data bytes in the users program/data area.

NVIS Technologies

11

NV5585 Deletes one or more data bytes from the users program/data area.

Not used Memory Compare: Compares two blocks of memory for equality. Hexadecimal Keys.

All commands are followed by a set of numeric parameters separated by PREV, NEXT & . (Execute) to work as delimiters. A on the MSD of address display indicates that system is waiting for a command. If, instead of a valid command, the user gives a data, the system will display Err. A dot on the LSD of address field indicates that the system expects an address. Whenever the data of any memory location is changed, a dot is displayed on the LSD of Data Field. The NV5585 accepts all data and address in hexadecimal form as given in the table 1. Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 LED Display

NVIS Technologies

12

NV5585 List of Commands :

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.

Reset Examine/Modify Register Examine/Modify Memory Go Single Instruction Block Move Delete Insert Relocate Fill

Memory compare Insert data Delete data

NVIS Technologies

13

NV5585 COMMAND DESCRIPTION Reset : This key initializes the NV5585 trainer and displays NVS 85 on the display. A on the left most end of display indicates that the system is expecting a valid command. Examine/Modify Register : This command is used to examine/modify any internal register of the CPU. If one wants to examine the contents of all the registers, one can start from `A' Reg. and examine all the registers by pressing next key. Whereas if some specific registers is to be examined, then the key for that register can be entered directly. The contents of any register can be changed. Exercise Examine the contents of A Reg. and B Reg. and change the contents of B Reg. to 02. Hex Key Pad Address Field Data Field

On pressing SHIFT and REG key, a dot is displayed in the address field. Enter the reg. identifier i.e. A. The contents of A reg. is displayed. Press NEXT to see the content of B Reg. E2 is displayed. Press 0 Key and 2 key and then NEXT to enter 02 in B Register. Terminate the command by pressing . key. Note: The data CC and E2 displayed for A and B Registers are just some arbitrary data and taken for example only. Examine/Modify Memory : This command is used to examine the contents of any memory location and modify the contents of the RAM area. On pressing this key, a dot is displayed in the end of address field. On can now enter the address of any location one wants to examine. Enter the desired address and press NEXT. The contents of this location is displayed in the data field. If one wants to examine the contents of next location, just press NEXT and the address in the address field will be incremented by one and its contents will be displayed in the data field. Same way if one wants to examine the content of previous location just press PRE key and the address in the address field will be decremented by one and its contents will be displayed in the data field. NVIS Technologies 14

NV5585 If one wants to modify the contents of any RAM location, then enter the data and press NEXT. The data field will be written in the address displayed in the address field and simultaneously the contents of next location will be displayed. Exercise Enter the following program: Address 2000 2001 2002 2003 Data AF C3 00 20 Comments XRA,A JMP 2000

NVIS Technologies

15

NV5585 Verify that the program using the same EXMEM Key so that data is entered properly. Note: Please note that data displayed on pressing NEXT i.e. 1A, 02, 50, 25 and C2 is some arbitrary data and need not be same, every time the process is repeated. GO : This command is used to execute the program in full clock speed. On pressing this key, the program counter contents are displayed in the address field with the data in the data field. A dot in the address field indicates that the address can be changed, if so desired. Enter the starting address of the program. On entering this address, the data field gets blanked out. Press Terminate (.) key. The CPU will start executing the program and E will be displayed in the address field. Exercise Execute the program entered earlier using examine memory command.

Single Instructions : This command is used to execute the program instruction by instruction. On pressing SI, the program counter content is displayed on the address field and its data in the data field. If one wants to modify the address, one can do that. After entering the address, press NEXT, the contents of the entered address is displayed. On pressing NEXT, one instruction will be executed and the address of the next instruction will be displayed with its data in the data field. Each time NEXT is pressed, one instruction is executed. If one wants to watch registers contents at any stage, one can do that using (.) key. On pressing (.) key, a - is displayed in the address field. One can now examine any internal register of CPU or any memory location and modify it if desired. Exercise Enter the following program than run in SI Mode and watch register contents. Address 2000 2002 2003 Data 3E 22 47 EF Mnemonic MVI A,22 MOV A,B RST 5 Comments Move 22 in a Register Move the Contents of A Software Breakpoint

Value into A Register Note : Enter the above program using examine memory command. The following is the procedure of executing in SI mode.

NVIS Technologies

16

NV5585

The first command is executed i.e. A Register has been loaded with 22. Let us examine the content of A Register. For this we will have to terminate the command here.

Terminate the command again.

To run the program further press SHIFT and SI.

The program came back at the same address where we left it.

The program after completing may jump to some other location as it may take next location data as a executing instruction. User have to remember end address of program. Block Move: This command allows the user to move the block of data from one memory location to another memory location. On pressing this key a dot is displayed at the end of address field. Enter the starting address of the block to be moved and press NEXT. Again a dot is displayed. Now enter the end address of the block and press NEXT. Again a dot is displayed. Now enter the destination address and press Terminate (.) key. A - is displayed in the display.

NVIS Technologies

17

NV5585 Exercise Block Move the program lying from 2000 to 2003 (in the earlier exercise) to 2100.

Verify that the program has moved to 2100 using examine memory command. Delete : This command allows the user to delete one or more instructions from the users program. In this command all the memory referenced instructions also get modified accordingly to keep the logic of the program same. The following information is to be entered:

1. 2. 3. 4.

Starting address of the user program. End address of the user program. Address of the location from where onwards the bytes are to be deleted. Address of the location till where the bytes are to be deleted.

Exercise Take the program of Sample program 9 i.e. flashing ABCDEF. In this program the word ABCDEF is displayed for 0.5 Sec., the display is cleared for 0.5 Sec. and the logic is repeated. In this program, if the clear routine is deleted, the word ABCDEF will remain permanently displayed. Enter this program from 2000 to 2029 using Examine/Modify memory command and delete the data from 201E to 2026. Run this program using GO command before deleting the data. You will see that ABCDEF is being flashed on the display. To delete the clear routine do the following: On pressing DEL DATA Key, some address is displayed. Enter the starting address of the program and press NEXT. Now enter the end address and press NEXT. A dot is displayed at the end of the Address field. Now enter the starting address from where the bytes are to be deleted and press NEXT. Again a dot is displayed at the end of address field. Enter the end address till where the bytes are to be deleted and press Terminator (.) key. A - will be displayed in the address field indicating that the system is ready to accept the new command.

NVIS Technologies

18

NV5585

Verify that the program from 201E to 2026 has been deleted. Execute the program and see that the word ABCDEF is displayed permanently. Insert : This command allows the user to insert one or more instructions in the users program with automatic modification of the memory referenced instructions. This following information is required to be entered.

1. 2. 3. 4. 5.

Starting address of the program. End address of the program. Address from where the bytes are to be entered. No. of bytes to be entered. Data.

Exercise Insert the bytes again, which are deleted in the above exercise of flashing ABCDEF. On pressing INS DATA Key, an address is displayed on the address field. Enter the starting address of the program and press NEXT. Again an address is displayed. Now enter the end address of the program and press NEXT. A dot is displayed at the end of the address field. Enter the address at which the bytes are to be entered and press NEXT. A dot is displayed again. Now enter the number of bytes to be entered and press NEXT. The system will display the address where you wish to enter the bytes with its current data in the data field. Enter the bytes you want to insert using NEXT key. When all the bytes are entered, a - will be displayed indicating that the system is ready to accept a new command.

NVIS Technologies

19

NV5585

Since we have just executed this program, the program address are not disturbed. So we directly press NEXT.

Our last address is also 2020, as in previous command in Delete we have deleted 9 bytes therefore End address become 2020 so we just press NEXT.

Since 9 bytes have to be entered,

the contents of 20 1E is displayed.

Verify that the bytes have been inserted and execute the program from 2000 to note the flashing ABCDEF on the display. Relocate : This command allows the user to relocate program written for some memory area, to some other memory area. The information required to be entered are:

1.

Starting address of the program. 20

NVIS Technologies

NV5585

2. 3.

End address of the program. Destination address where the program has to be relocated.

The relocate command can be best understood with the earlier example of flashing ABCDEF. This program is written for 2000 memory area. So that jump instruction for looping at the end is with reference to 2000 only. Suppose you want this program to be executable for 2100 area, then this can not be done by Block Move because when we Block Move the program from 2000-2029 to 2100, the contents of 2127 onwards will be 2127 - C3, 2128 - 06, 2129 - 20. Where as in order to execute this program from 2100, the content of 2129 should be 21. This can be done using Relocate command. On pressing SHIFT and RELocate, a dot is displayed in the address field. Enter the starting address of the program i.e. 2000 and press NEXT. A dot is displayed again. Now enter the end address of the program i.e. 2029 and press NEXT. Again a dot is displayed. Now enter the destination address i.e. 2100 and press (.).

Now verify that 2129 has got 21. Execute the program from 2100 and note that the ABCDEF' will be flashing on the display. Fill : This command allows the user to fill a memory area (RAM) with a constant. The following information is required to be entered.

1. 2. 3.

Starting address of the memory area from where the data should be stored. End address of the memory area till were the data should be stored. The constant with which the data should be done i.e. 22.

Exercise Fill the RAM area from 2000 to 2050 with 22. Press SHIFT and FILL. A dot will be displayed at the end of the address field. Enter the starting address and press NEXT. Again a dot will be displayed. Now enter the end address NVIS Technologies 21

NV5585 and press NEXT. The present contents of end address will be displayed. Enter the content and press (.).

05 is just some random data which was lying at 2000. Press 2 key twice and press Terminate (.) key.

Verify that 22 is filled from 2000 to 2050. Memory Compare : This command allows the user to compare two blocks of memory for equality. If they are not equal, the address of the first block at which there is a discrepancy will be displayed. The flowing information needs to be entered.

1. 2. 3.

Starting address of the first Block. End address of the first Block. Starting address of the second Block.

Exercise Enter the following Data using Examine Memory command: 2000 2001 2002 2003 2004 00 11 22 33 44 2005 2006 2007 2008 2009 55 66 77 88 99

Now Block Move this block to 2100 using B.M command. Now use Memory Compare command as follows: Press SHIFT and Memory Compare. A dot is displayed at the end of address field. Enter the starting address of the first block and press NEXT. Again a dot is displayed. Enter the end address of the first block and press NEXT. A dot is displayed. Now enter the starting address of the second block and press Terminate (.) key.

NVIS Technologies

22

NV5585

Since the two blocks are identical a - will be displayed. Now change the content of 2005 to 50 and that of 2008 to 68. Again use the Memory Compare command as mentioned above. You will see that an address 2005 will be displayed on the address field and its contents in the data field. Press NEXT and now 2008 will be displayed with the contents. On pressing NEXT, - will be displayed indicating that the two blocks are identical.

NVIS Technologies

23

NV5585 SERIAL COMMAND NV5585 provides on-board Serial interfaces using SID/SOD pin of 8085 CPU. The RS-232C interface provided by 8085 chip is a three line interface i.e. the handshake lines are not provided. The three signals namely GND, SID & SOD are brought out at Connector CN5. Through this RS-232 interface user can communicate with PC by selecting baudrate of 4800 bps. The user can communicate 8085 trainer with PC as below procedure mentioned.

1. 2. 3. 4.

Connect Serial cable at CN5 of the trainer to any COM-1 OR COM-2 of the PC. Run Windows Hyper Terminal Software using baudrate of 4800 bps. Press `SER' key on trainer keyboard. Now Press `ENTER' Key on PC keyboard you will see below character on the PC Screen.

5.

Now you can use all serial commands.

Using Hyper Terminal WIN98/2000/NT/XP With NV5585 TRAINER Introduction : HYPER TERMINAL is a simple terminal emulator Windows based software for IBM-PC/AT compatible computers to allows the user to communicate with the computer through serial port with the facility of downloading & uploading of the data between the computer and the other serial device. The various communication parameters like baud rate (speed), number of data bits, stop bits, parity etc. can be changed. The package communicates through COM1: as well as COM2: port of the IBM-PC Systems. Installation : If your computer doesnt have Hyper Terminal software please follow the below procedure.

1. 2. 3. 4. 5. 6. 7. 8. 9.

First go to Control Panel and Click Add/Remove Program. Click Windows Setup. Select Communication and Click Details. Select Hyper Terminal then press OK and Click Apply. Computer will ask for Window CD for Installing Hyper Terminal. After Installing Hyper Terminal Click cursor on <Start> <Programs> <Accessories> <Communications> <Hyper Terminal> then open it. Click on <Hypertrm> icon give ABC in name Block and Click OK. Select Communication Port either <Direct to COM1> or <Direct to COM2> and click OK. For connecting the trainer of 8085 SID/SOD at RS232 connector select following COM1/COM2 properties: Bits per second 4800

NVIS Technologies

24

NV5585 Data bits Parity Stop bit Flow Control 8 None 1 XON/XOFF

And configure ASCII setup as shown in figure

Press `SER' key on trainer keyboard. Press `ENTER' Key on the PC keyboard Now you will see Characters on the PC Screen

Now you can use all serial commands.

NVIS Technologies

25

NV5585 List of Serial Commands :

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.

LList a memory block M E R S G B I D,O N F H J Examine/Modify Memory Enter a memory block Examine/Modify Register Single Step Go Block Move Insert Delete Insert Data Fill Relocate Memory Compare

Command Description :

NVIS Technologies

26

NV5585 List A Memory Block L command outputs on the SIOD device a formatted listing of memory block. Format L <Low Address> , <High Address> $ Type L followed by the starting address of the memory block to be listed, followed by a comma (,) and then the end address of the memory block followed by $. The outputting format will be as given below: Example Suppose you want to list the data from 2000 to 2018. L 2000, 2018 $ 2000: AB AE CD BC AA BB BC AF CD DE 2001: AB CD DC DD EE AA BC AF BB AA 2014: BC CD AA AB FC $ Examine/Modify Memory The M command allows you to examine and modify memory locations individually. The command functions as follows: Format M <Address> , (Data) , ............... $

1. 2. 3.

Type M, followed by the hexadecimal address of the first memory location you wish to examine, followed by a space or comma. The contents of the location are displayed followed by a dash -. To modify the contents of the location displayed, type the new data, followed by a comma. If you do not wish to modify the location, type only the comma. The higher memory location will automatically be displayed as the step (s). A $ at any stage terminates the command. 2000, C3-00, 23-11, FC-22, 3E, 21-44 <$>

4.
M

Example The contents of 2000 to 2002 and 2004 are changed from C3 to 00, 23 to 11 and FC to 22 & 21 to 44, respectively whereas the data at 2003 remains as it is. Location 2000 2001 2002 2003 2004 Enter A Memory Block NVIS Technologies 27 Old Contents C3 23 FC 3E 21 New Contents 00 11 22 3E 44

NV5585 E command allows user to enter a program or a block of data in the RAM. Format: E <Address> : <data> , <data> , ............... $

1. 2. 3.

Type E followed by the starting address of the memory block to be entered, followed by a colon (:). Each byte followed by a comma as it is entered from the SIOD is deposited in the consecutive location in the memory. In case the terminator is colon (:) the proceeding parameter is taken as a fresh address and the subsequent data bytes are stored in memory location starting from the fresh address. A $ terminates the command. 2000: 3E, 11, 11, 08, FC $. 2000 3E, 11, 11, 08, FC.

4.
E

Example The memory contents as stored are shown below:

Examine/Modify Register Display & modification of CPU register is accomplished via R command. Format: R <Register identifier> , ............... $

1.

Type R followed by a single alphabet register identifier. The contents may now be changed if so desired. In case you do not want to modify the contents, just enter a comma. The contents of the next register will be printed. The register identifiers for various CPU registers are given below: Register Identifier A B C D E F Register Identifier I H L S P Register Register A Register B Register C Register D Register E Flag byte Register Interrupt Mask Register H Register L Stack Point MSB & LSB Program Counter MSB & LSB

NVIS Technologies

28

NV5585 Single Instructions This command allows to execute the program one instruction at a time. Format S <Starting Address> , ...... $

1.

Pressing of S key will list the PC and first byte of the program. In case one want to modify it, one has to enter the new address and then press comma. The new address will be entered and pressing of comma again will execute on instruction. The new PC and the next instruction will be listed. In this way one can execute the program in single instruction mode.

Example The following program is to be executed in single instruction mode: Address 2000 2003 2005 2008 Op Code 11 50 20 3E 27 21 70 20 77 Instruction LXI D, 2050 MVI A, 27 LXI H, 2070 MOV M, A

On executing S command S 2000 : 11/, 2003 : 3E/, 2005 : 21/. If one wants to execute further, one presses , otherwise one presses $. Go Command This command execute the program. Format The format for this command will be as follows: G <Starting address> $ Pressing of G key will display the PC content and the first byte of the instruction. To modify it, enter the desired address & then press comma, the PC will be modified with new contents & the corresponding data will be listed. When $ key is pressed, CPU starts executing the program. Suppose the program starts from 2000 then the format will be G 2000 $.

Block Move Command This command has the same functions as explained in BLOCK MOVE under keyboard description. Format B <Starting address of the source>, source> , <Starting address of the destination> $ Insert Command This command has the same functions as explained in INSERT under key board description. Format <End address of the

NVIS Technologies

29

NV5585 I , , <Starting address of the program> <No. of bytes> , , <End address of the program> $

<Address from where the byte or bytes are to be entered> <Data bytes separated by>

Delete Command This command has the same function as explained in DELETE under key board description. Format D <Starting address of the program> , <End address of the program> , <Starting address from where the bytes are to be deleted> , End address till where the bytes are to be deleted $1 Insert Data This command has the same function as explained in INSERT DATA under key board description. Format N <Starting address of the program/data area> , <Starting address at which the bytes are to be entered> bytes separated by> , Example Suppose the RAM area 2000 to 2007 has the following data. 2000 : AF 02 00 25 57 DE 47 BC and we need to insert AA BB at 2002 onwards then the format will be N XXXX-2000, XXXX-2007, 2002 ,2, 00-AA, 25-BB, On pressing the last , the command is executed and a prompt character again appear indicating that the new command can be entered. <End address of the program> , , <No. of bytes> , <Data

Delete Data This command has the same function as explained in DELETE DATA under key board description. Format O <Starting address of the program/Data area , <End address of the program/data area> , <Starting address from where the deletion should start> , <End address till where bytes are to be deleted> $p Suppose the bytes inserted in the above example are now to be deleted. Then the format will be: O XXXX - 2000, XXXX - 2009, 2002, 2003 $ One can verify that the bytes have been deleted.

Fill NVIS Technologies 30

NV5585 This command has the same function as explained for Trainer. Format F <Starting address of area> , <End address> , Data to be filled $ Example Suppose the RAM area, from 2000 to 2010 is to be filled with FF. The format will be: F 2000, 2010, XX - FF $ XX is some random data displayed at that stage. Relocate The command has the same function as explained for Trainer. Format H <Starting address of the program> <Destination address of the program> $ , <End address of the program> ,

Suppose the program relocated in Chapter-4 under RELOCATE is to be relocated in serial mode, the format for this will be: H 2000, 2029, 2100 $ Memory Compare Format J , <Starting Address of first block> <Starting address of second block> , $ <End address of first block>

If the example explained earlier in Chapter-4 for RELOCATE is to be executed in serial mode. The format will be: J 2000, 2009, 2100 $

Down Loading (T) : This command allows user to Download any .HEX file from PC to the trainer. Down Loading the .KIT or .TXT from PC to NV5585 LCD trainer. The following procedure is to be adopted for downloading the file from PC to Trainer . The T command loads the data from your diskette/PC to the memory of the trainer.

1. 2. 3.

Press T key of the PC keyboard. Select <Transfer> <Send Text File...> Choose File Name i.e. ABC.KIT or ABC.TXT and Click it. The program stored in the file will be loaded in memory of Trainer at the address specified in the program.

Note : If the file is not Downloading please Change the Line Delay & Character Delay in the Properties of the Hyper Terminal. To Change the Line Delay & Character Delay select <Properties><Setting><ASCII Setup>.

NVIS Technologies

31

NV5585 Uploading (L) : This command allows user to store any particular block of data from trainer to the PC. Uploading the ABC.HEX from NV5585 trainer to PC. The following procedure is to be adopted for uploading the file from Trainer to PC.

1. 2. 3.

Press L key of the PC keyboard Write Start Address and End Address in below mention format For e.g. L2000,20FF Then Go in Menu bar. Select <Transfer> <Capture Text...> from PC keyboard give any name with .KIT or .TXT Extension i. e. ABC.TXT (You can Browse where you want to save it) Click on <Start> Press $ Key on NV5585 trainer. Address and Data will see on PC Screen. Then again Go in Menu bar. Select <Transfer> <Capture Text> click on <Stop> Data captured will be stored in the file as defined by the file name.

4. 5. 6.

Downloading of Intel Hex File To down load HEX file created by CROSS ASSEMBLER, one has to first convert HEX file to Kit format for downloading. HEX Kit Software is used for converting HEX File to KIT format.

XASSEMBLER To use MASM Software and download generated file to Trainer please follow these steps Write any Program in following format for NV5585

;TEST PROGRAM FOR 8255 TO GENERATE SQUARE WAVE OUTPUT CPU 8085 ORG 2000h MVI A,80H OUT 03H LOOP: MVI A,55H OUT 01H OUT 00H OUT 02H NVIS Technologies 32

NV5585 CALL DELAY1 MVI A,0AAH OUT 01H OUT 00H OUT 02H CALL DELAY1 JMP LOOP DELAY1: LXI D,0100H CALL 03BCH RET END

NOTE:--Starting cpu 8085 & ORG 2000H in every program should be their along with end command also. 1. Write above program in any Word pad/Note pad/any editor.(DOS/WINDOW) Save this program suppose ABC.ASM 2. Extension .ASM should be their. 3.Open assembler file i.e. where assembler is saved. You will find file NVIS8085.COM 4.Open this file with command mode, to do this 5.save above file suppose file name ABC.ASM in same folder where the assembler is saved. 6.Now do the following steps

Open command prompt window by typing cmd in run command

a window appears as shown below

NVIS Technologies

33

NV5585

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

Run MASM file in below mention format

NVIS Technologies

34

NV5585

Then press ENTER key of PC keyboard. The PC screen will display

Now it is waiting for input file Note : The ASM file should be in same folder where MASM assembler is placed, while giving file name it should not be greater than 6 characters and at time of file name input while compiler is waiting never give extension .ASM on type file name as shown

NVIS Technologies

35

NV5585

Press enter it will display a message

NVIS Technologies

36

NV5585

Step4>Run NVISHEXKIT.exe as shown

it will display a window as shown

At right side it is showing all HEX files currently present in the directory of XAssembler select 8255 by up down arrow key and press Enter It will ask for displaying output on screen press y

NVIS Technologies

37

NV5585

It will generate kit file format which is supported by our Trainer Connect hyperterminal with kit then select transfer then send text file Our file will be down loaded into kit.

NVIS Technologies

38

NV5585 MEMORY / IO MAPPING Memory Mapping : NV5585 provides 8K byte of RAM and 8K byte of EPROM. ROM is dedicated for Monitor Program having 8K Bytes of Powerful Monitor Program is Embedded in the 27C512 EPROM. For the system operation the monitor should start from address 0000. The Memory address is from `0000 to 1FFF'. RAM is dedicated for user Memory of 8K bytes (6264). The address is from `2000 to 3FFF' for the user RAM. The monitor pogram uses certain portion of this RAM for temporary use i.e. scratch pad area. This area is from 2770 to 27FF. The user is advised not to use this area for storing program. The detail of Scratch Pad RAM area is given here. LocationContents 2770 277E 2780 27BD 27BA 27B7 27B4 27B1 27AE 27AB 27AA 27DA 27DB 27DC 27DD 27DE 27DF 27E0 27E1 27E2 27E3 27E4 27E5 27E6 27E7 NVIS Technologies 27BF 27BC 27B9 27B6 27B3 27B0 27AD 2781 277D For Kit Expansion SHIFT FLAG RST 7.5 RST 7 RST 6.5 RST 6 RST 4.0 RST 2.0 RST 1.0 Stack E Register D Register C Register B Register Flags A Register L Register H Register Interrupt Mask Program Counter LSB Program Counter MSB Stack Pointer LSB Stack Pointer MSB SP Shift 39

NV5585 27E8 27EA 27EC 27EE 27F0 27F2 27F4 27F6 27F7 27FB 27FC 27FD 27FF 27FE 27FA 27E9 27EB 27ED 27EF 27F1 27F3 27F5 No. of Bytes Source Address I Destination Address I Offset Address Lower Limit Higher Limit Current Address Current Data Output Buffer Input Buffer Temporary Location Half bit time System mode

NVIS Technologies

40

NV5585 I/O Mapping Various Chips used in I/O mapped mode in NV5585 are 8255, 8155, 8253 & 8279. The address for these I/O devices are given below:

Device / Model 8255

Active range

Port Numbers Port Addresses 00-07 00 and 04 01 and 05 02 and 06 03 and 07

Selected Device PPI Port A Port B Port C Control Word PPI & TIMER Control Word Port A Port B Port C LSB Timer MSB Timer PIT Counter 0 Counter 1 Counter 2 Control Word

8155

08-0F 08 09 0A 0B 0C 0D

8253

10-17 10 and 14 11 and 15 12 and 16 13 and 17

8279

18-1F 18 and 1C 19 and 1D

Keyboard/Display Controller Mode Selector Control Word

NVIS Technologies

41

NV5585 SUBROUTINES NV5585 monitor program needs various utility functions while using the onboard keyboard and display PC Terminals as a console. These utility functions (routines) resides in the 8K Bytes of Monitor and so can also be used by the user to simplify his programming task. Some of these utilities are given here. H,L & F/FS Address of routine 030B Label CH INP Description Character Input This routine takes one 8 bit byte from the serial I/o Port and return it to the calling routine in A register. The 16 bit number stored in 27FD (LSB) and 27FE (MSB) decides the baud rate. The number decides the half bit time and is the argument of subroutine DELAY. 032F CLEAR This routine is for keyboard only. Input: B-Dot,Flat = 1 for a dot 8 in address field. 0 for not dot. Output: None 033F CLEAR DISPLAY All This routine clears the display and terminate the command. The Inputs and outputs in this routine are none. This routine converts a hex nibble to ASCII. The various inputs and outputs in this routine are: Input: C-hexcode to be converted to ASCII. Output : C-ASCII Code 036E CNABN This routine converts an ASCII character to its Binary Value. The various Inputs and outputs required are Reg. A-7 Bit ASCII code with parity bit = 0, Output Reg. A : 4 Bit Hex Nibble when Input is any hex numeric 0-F. Reg. A: 10 when Input is $ A,B,C,D,E, H,L & F/FS Registers Affected A,B,C,D,E, H,L & F/FS

0366

CNASC

A,B,C,H&L

NVIS Technologies

42

NV5585 Address of routine Label Description Reg. A: 11 when Input is SP/ CR Reg A: 3A when Input is:, for any other Input it jumps to error. 038A CHOUT Character Output: This routine takes one byte (8 bit) passed on by the calling routine in register C on the serial I/O Port. The baud rate is decided by the 16 bit number stored in 27FD (LSB) and 27FE (MSB). The number determines the half bit time and is the argument of the subroutine DELAY. 03B0 DCRNB Decrements a Byte This routine decrements a Byte and if the decremented value is zero it sets the zero flag. Input : None Output : the zero flag gets set if the decremented value = 0 otherwise it is reset. 03BC DELAY This routine is used to provide delays. It stores the number in FS register pair D, counts it down to zero and comes back to the calling routine. Total time delay introduced by the routine is (24N + 17) x basic machine cycle. N # 0. 03C3 DISPLPC DISPLAY PC CONTENT: This routine displays the PC Content and the first byte of the instruction stored. The inputs and outputs in this case are none. 03E2 DMDT DISPLAY/MODIFY DATA: This routine display/modify the data. The Inputs and outputs in this routine are: Input: HL 1 If a memory address was received.- 0 If no data was received A - Termination Character DE -The data received HL - Same as Input A,B,C,D,E & F/FS All A,D,E & F/ A & F/FS Registers Affected

All A,B,C,D,E, H,L & F/FS

NVIS Technologies

43

NV5585 Address of routine 03FA Label ECHO This routine is used in SIOD mode, when the keyboard is inactive. This routine outputs a single character to the user on SIOD. The Inputs and Outputs are Reg. C. Character to ECHO to the terminal. Output: Reg. C: Same as Input. 0417 EMM (Common) This routine examine/modify a memory Block. The Inputs for this routine are HL-First memory location to be examined. Outputs: None. All This routine displays an error on the display if the system is in Key Board Mode. And if the system is in SIOD Mode, it lists a * and goes to command recognizer. The various Inputs and Outputs are: Input : None Output : None 0468 RECHEX Receive Hex Digits: If the system is in Keyboard mode, this routine accepts, a hexadecimal number from it, displays it on the display and returns it as a 16 bit number. The routine displays error in case of an invalid terminator. The valid terminators are EXECUTE, NEXT AND PREVIOUS. RST 5.5 should be unmasked first in this operation. The various Inputs and Outputs are Reg. Reg.B : 0 - Use address field. Reg.B : 1 - Use data field. Outputs : A - The last character received from the Keyboard. D,E - last 4 hex digits received from the keyboard. Carry - Set if at least one valid hex digit was received else reset. All A,B,C,H,L & F/FS Description Registers Affected A,B,D & E

0455

ERROR

NVIS Technologies

44

NV5585 Address of routine Label Description Registers Affected

If the system is in SIOD mode then the number is received from the appropriate SIOD and the number is displayed. Valid terminators are $, . space and :. 04C5 HILO (COMMON) DE = DE - HL: In this routine DE Reg. contents become equal to DE Reg. Content - HL Reg. Contents. CRY Set if DE was <HL and reset if DE was> HL. 04EE RCVCHR Receive a character from SIOD This routine waits for a character to be typed on the SIOD. When the character is typed, it sends it back to the SIOD and returns the ASCII code value to the calling routine in Register A. Selection of any of the device can be done by changing the content of the location - 27FF. 27FF 00 01 02 Mode Invalid TTY CRT A,B,C,D,E, H,L & F/FS A,D,E,F/ FS

If the MS bit of this code is set, ten there will not be any echo of the character, location 27FD stores half bit time for proper baud rate output - ASCII code received from SIOD. 0519 INSDG Insert Hex Digit: This routine allows to insert hex digit. The Inputs and Outputs in this routine are: Input: Reg. A - Hex digit to be Inserted. Reg. DE - Hex Value. Output: Reg. DE - Hex value with digit inserted. A,D,E,H,L & F/FS

NVIS Technologies

45

NV5585 Address of routine 0552 Label LSTBTE Description List a byte on SIOD This routine takes a byte from SIOD and converts it into two hexadecimal digits for listing on SIOD. The byte to be listed is stored in Reg. A and the SIOD is selected by changing the contents of the location 27FF. Contents of location (Mode) 27FF = 00 invalid 01 TTY 02 CRT Location 27FF stores half bit time for proper baud rate. 05AF New Ad Read New Address: This routine reads keyboard/SIOD to find out if there is a new address. If the terminator is EXEC, it jumps to clear display. In case of any terminator other than EXEC it gives error. The various Inputs and Outputs are: Input : H1 - Old address. Output CRY: 01 if no new value is received else CRY is resettled. HL: New value of address if received otherwise 00. 05D0 OUTPUT Display the Character This routine is used to display a character on the display. If the system is in SIOD Mode, the routine returns without any operation. The various inputs to this routine are given below: Reg.A : 0 - Use Address Field. 1-Use Data Field. Reg. B: 0 - No dot to be displayed 1 - Dot at the right edge of the field. Reg. H.L.- Starting address of the Character Code. A,B,C,D,E, F,L&F/FS All Registers Affected A,B,C,D,E & F/FS

NVIS Technologies

46

NV5585 Address of routine Label Description Character Displayed 0 1 2 3 4 5 6 7 8 9 A B C D E F H L P I R U BLANK 0629 RD KB Character Code 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 A,H,L & F/FS Registers Affected

Read the Keyboard This routine scans the key board for any key to be pressed. When a key is pressed, its value is returned to the calling routine in register A RST 5.5 should be first un-masked for the proper operation. Input : A - The byte to be searched. DE - No. of bytes is in each entry. HL - Starting address of the table. C - No. of entries in the table. Output : HL - address where the comparison was made. C - decremented value of the counter.

NVIS Technologies

47

NV5585 Address of routine 06E3 Label MOD AD Description Modify Address If the system is under the control of keyboard, it displays 16 bit number stored in 27F4 and 27F5. Input : Reg.B - 0 no dot. 1 dot at the right edge of the field. If the system is in SIOD mode, 4 hex digits are listed on SIOD. Modify Data If the system is under the control of keyboard, it displays 8 bit number stored in 27F6. Input: Reg.B - 0 no dot. 1 dot at the right edge of the field. If the system is in SIOD mode, 2 hex digits are listed on the SIOD. Read HI and LO This routine reads the lower limit and higher limit of addresses from the keyboard. If no new address are entered, then the lower and higher limit address are not disturbed. Input : None Output :None Relocate a Program This routine relocates a program written for one memory area to another memory area by adding a fixed 16 bit number to all the address references between and including (27EA, 27EB) and (27EC, 27ED). Lower Limit (27F0, 27F1) should point to the starting address of the routine to be relocated and the higher limit (27F2, 27F3) should point to the last location. Read two addresses This routine reads two addresses from key board or SIOD. The inputs and outputs are: Input : None Output : Reg.BC - Ist address Reg.DE - IInd address Reg.A - Terminator of the IInd address Search a Table This routine searches a table for a byte and if the search fails, it gives error. Registers Affected A,B,C,D,E, H,L & F/FS

06FA

MODDT

A,B,C,D,E,H,L & F/FS

0639

RD HILO

All

0653

REL

All

06CB

RD2AD

A,B,C,D,E,H,L & F/FS

06D0

TSRCH

C,H,L & F/ FS

NVIS Technologies

48

NV5585 Software Interrupt : During this process of debugging some time one might just like to examine the status of the program at a particular point. If this point is near the beginning of the program, one can reach this point by single instruction facility. But, if this point is quite far off from the beginning of the program, it is time saving to make use of break point facility. For this introduce a RST5 instruction (EF) at the point to be examined and run the program at full speed using GO Command. When, during the execution of the program, this instruction is encountered, the control of the processor is transferred to the monitor. The monitor saves the user registers and displays a sign NVS 85 on the display. Now one can examine the status of any memory location or any internal register. One can change the content of memory location or register if necessary. Note : While debugging the program dont press RESET Key.

NVIS Technologies

49

NV5585 SAMPLE PROGRAMS Program-1 : Hexadecimal additions of two numbers. The program takes the content of 2009, adds it to 200A and stores the result back at 200B. Steps

1. 2. 3. 4. 5.
Step-1 2000 Step-2 2003 Step-3 2004 Step-4 2005 2006 2007 Step-5 2008

Initialize HL Reg. pair with address where the first number is Store the number in accumulator. Get the second number. Add the two numbers and store the result in 200B. Go back to Monitor. Code Label Mnemonic LXI MOV INX ADD INX MOV RST Label Mnemonic Operand H,2009 A,M H M H M,A 5 Operand

lying.

Address

Comments Point to 1st no. Load the accumulator Advance pointer Add IInd number Advance pointer Store result

21 09 20 START 7E 23 86 23 77 EF Code DATA DATA RESULT Data 1A 18 32

Address Step-6 2009 200A 200B Example Address 2009 200A 200B

Comments 1st no. to be added 2nd no. to be added

Result

Data in Hex Number

Program-2 : The decimal addition of two decimal numbers. The result should not be greater than 99. The program will add two decimal numbers lying at 200A and 200B. The result will be stored (in decimal) at 200C. NVIS Technologies 50

NV5585 Steps

1. 2. 3. 4.
Step-1 2000 2003 Step-2 2004 2005 Step-3 2006 Step-4 2007 2008 2009

Load the contents of first location in Acc. Add it with the contents of second location. Adjust the decimal. Store the result and go back to monitor. Code 21 0A 20 7E 23 86 27 23 77 EF Label Mnemonic LXI MOV INX ADD DAA INX MOV RST H M,A 5 Operand H,200A A,M H M Comments Point to 1st no. Load it in to accumulator Point to 2nd no. Add the two nos. Convert to decimal Point to storage Store it

Address

Step-5 200A 200B 200C Example Address 200A 200B 200C Data 23 32 55

DATA DATA RESULT

Two decimal nos. to be added. Result

Data in decimal Data in decimal Answer in decimal

Program-3 : Add two sixteen bit numbers. This program will add two sixteen bit numbers lying at 200C, 200D, 200E and 200F. The result is stored at 2010 and 2011. Carry is neglected. Steps

1. 2.

Load the first number in HL. Load the second number.

NVIS Technologies

51

NV5585

3. 4.

Add the two and store result. Go back to monitor. Code Label Mnemonic LHLD XCHG Operand 200C Comments Load the HL Reg. with 1st number Exchange the HL and DE register. Load the HL Reg. with 2nd number. D 2010 5 1st sixteen bit number 2nd sixteen bit number Result of addition Add HL & DE Registers Store the result in 2010.

Address Step-1 2000 2003 Step-2 2004 Step-3 2007 2008 Step-4 200B Step-4 200C 200D 200E 200F 2010 2011 Example Address 200C 200D 200E 200F 2010 2011

2A 0C 20 START EB

2A 0E 20 LHLD 19 22 10 20 EF 1st no. 1st no. 2nd no. 2nd no. LSB MSB LSB MSB

200E DAD SHLD RST

RESULT LSB RESULT MSB

Data CA A7 6B B9 35 61 LSB1 MSB1 LSB2 MSB2 LSB1 + LSB2 (CA + 6B) MSB1 + MSB2 (A7 + B9)

Program-4 : Addition of a 8 bit number series neglecting the carry generated. This program adds N No. of hexadecimal numbers lying from 2101 onwards. The 2100 has the number of hexadecimal bytes to be added. The result is stored at 2100 location.

1. 2. 3. 4.

Steps Load the contents from 2100 location, give how many bytes are to be added. Initialize Acc. as the result will be stored in Acc. Let the memory to point the number of the bytes to be added into partial register Acc. 52

NVIS Technologies

NV5585

5. 6. 7. 8.

Decrement the counter having no. of bytes. Check if zero - No. repeat from point 3. Store the result at 2100 location. Go back to monitor. Code Label Mnemonic LXI MOV XRA Label LOOP Mnemonic INX ADD DCR JNZ STA RST Operand H,2100 B,M A Operand H M B LOOP 2100 5 Comments Point to first no. Load count into B Reg. Clear A Register Comments Point to the 1st number Add memory to total Substract from count Test to see if done Save the result

Address Step-1 2000 2003 Step-2 2004 Address Step-3 2005 2006 Step-4 2007 Step-5 2008 Step-6 200B Step-7 200E Example Address 2100 2101 2102 2103 2104 2100

21 00 21 START 46 AF Code 23 86 05 C2 05 20 32 00 21 EF Data 04 10 02 08 04 1E

The no. of hexadecimal no. to be added First Hex No. Second Hex No. Third Hex No. Fourth Hex No. Answer is in Hexadecimal.

After the program executes the answer will be stored in 2100.

NVIS Technologies

53

NV5585 Program-5 : Separation of hexadecimal number into two digits. This program breaks the byte of data stored at 2100 into two nibbles. The MS nibble and LS nibble are stored at 2102 and 2101 location respectively. Steps

1. 2. 3. 4. 5.

Load the byte into Acc. Clear the MS nibble and store it at 2101. Load the byte from 2100. Clear the LS nibble and store it at 2102. GO BACK TO Monitor.

Address Step-1 2000 Step-2 2003 2005 Step-3 2008 Step-4 200B 200D Step-5 2010 Example Address 2100 2101 2102 2100 2101 2102

Code

Label

Mnemonic LDA ANI STA LDA ANI STA RST

Operand 2100 0F 2101 2100 F0 2102 5

Comments Get the number Mask off the first four bits Store result 1 Get the number again Mask off the last four bits Store result 2

3A 00 21 START E6 0F 32 01 21 3A 00 21 E6 F0 32 02 21 EF

Data AF 00 00 AF 0F A0 Number stored Memory before program execution Memory before program execution Number stored LSB separated from AF MSB separated from AF 54

After the program executes:

NVIS Technologies

NV5585 Program-6 : Combination of two hex nibbles to from one byte number. The program takes two nibbles from 2100, 2101 and combines to form a byte. The nibbles from 2100 is taken as MS nibble of the byte to be formed. Steps

1. 2. 3. 4. 5.

Initialize memory pointer with 2100 and load MS nibble into Acc. Shift the four bits towards the left, the shifted information is stored in Acc. Point to next location 2101 and OR its contents with the contents of Acc. Increment the memory pointer to store the result at 2102. Go back to Monitor. Code Label Mnemonic LXI MOV RLC RLC RLC RLC INX ORA H M Point to next number OR the two numbers together Move it to MSB Operand H,2100 A,M Comments Point to 1st number Get it

Address Step-1 2000 2003 Step-2 2004 2005 2006 2007 Step-3 2008 2009 Step-4 200A 200B Step-5 200C Example Address 2100 2101 2102 2100 2101 2102

21 00 21 START 7E 07 07 07 07 23 B6

23 77 EF

INX MOV RST

H M,A 5 Store the result

Data 04 05 00 04 05 45 MSB LSB Memory before program execution MSB LSB Memory after program execution

After the program execution:

NVIS Technologies

55

NV5585 Program-7 : Hex number stored in location for odd or even parity. This program checks the hex number stored in location 2010 for odd or even parity. If the parity is odd, 00 will be stored in location 2011. Otherwise EE is stored in 2011. Steps

1. 2. 3. 4.

Set the memory counter (Register pair HL) to the data location 2010 and bring its contents to Acc. OR the contents of Accumulator with itself. Check the parity register for odd or even parity and store 00 or EE in location 2011 depending upon whether it is odd or even parity. Go back to Monitor. Code 21 10 20 7E B7 E2 0C 20 JPO 2C 36 EE EF 2C 36 00 EF Data Result ODD: Label Mnemonic LXI MOV ORA ODD INR MVI RST INR MVI RST Operand H,2010 A,M A Comments Set the memory counter Get the first no. in Acc. Set the flag. ODD.

Address Step-1 2000 2003 Step-2 2004 Step-3 2005 2008 2009 200B 200C 200D Step-4 200F 2010 2011 Example Address 2010 2010

If the parity is odd, jump to L M,EE 5 L M,00 5

Point to memory location for result Store EE in 2011 Go to Monitor Point to memory location for result Store 00 in 2011 Go to Monitor

Data 10 30 Before execution 2011-00 After execution 2011-EE

NVIS Technologies

56

NV5585 Program-8 : Multiplication by two, employing bit rotation. The program multiplies a hex number stored in location 200A with two and stores the result in location 200B. It uses the bit rotation technique. Steps

1. 2. 3. 4. 5.

Load the data of location 200A in the Acc. Set the carry flag to zero. Rotate the Acc. through carry. Store the contents of Acc. in 200B. Go back to monitor. Code Label Mnemonic LDA Operand 200A Comments Load the number in Acc. Set the carry flag to 1 Complement the carry (Store 0 in the carry flag). Rotate Acc. to left, through Carry (Multiply by 2). 200B RST 5 Store the result in 200B. Go to Monitor

Address Step-1 2000 Step-2 2003 2004 Step-3 2005

3A 0A 20 START 37 3F STC CMC

17

RAL

Step-4 2006 Step-5 2009 200A 200B Example Address Data Before execution 200A 200B 1A 34 After execution Program-9 : Display flashing ABCDEF This program will display a flashing ABCDEF in address and data field. The flashing rate is 0.5 sec. Steps EF Data Result 32 0B 20 STA

1. 2.

Initialize the stack pointer. Clear the display.

NVIS Technologies

57

NV5585

3. 4. 5. 6.

Point to the data of ABCDEF and display ABCD in the address field and EF in the data field. Wait for 0.5 Sec. Clear the display and wait for 0.5 sec. Jump to START. Code 31 FF 20 CD 47 03 CALL AF START Label Mnemonic LXI CLEAR XRA A Operand SP,20FF Comments Initialize stack pointer Clear the display A is 00 to display character in the address field. No dot to be displayed in the data field. Starting address where the display is to be started. Display routine to display characters in address field. Initialize A,B for data to be displayed in data field. HL points the address where the data to be displayed is lying. Display last two characters of ABCDEF in data field. Display ABCDEF for about 0.5 seconds

Address Step-1 2000 Step-2 2003 Step-3 2006

2007 2008

47

MOV

B,A H,2050

21 50 20 LXI

200B

CD D0 05 CALL OUTPUT

200E 2010 2012

3E 01 06 00 21 54 20 LXI

MVI MVI H,2054

A,01 B,00

2015

CD D0 05 CALL

OUTPUT

2018 201B Step-5 201E 2021 2024 Step-6 2027 Step-7

11 00 00 LXI CD BC 03 CALL CD 47 03 CALL 11 00 00 LXI CD BC 03 CALL C3 06 20 JMP

D,0000 DELAY CLEAR D,0000 DELAY START

Clear the display Clear display for 0.5 sec.

NVIS Technologies

58

NV5585 2050 2053 0A 0B 0C 0D 0E 0F Data for display `ABCDEF'

NVIS Technologies

59

NV5585 CONNECTORS The pin details of the various connectors are given here for your reference. Bus Connector-CN1 (for Model : NV5585) Pin 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 Pin 1 3 5 7 Signals Vcc GND AD3 AD2 AD1 AD0 A7 A6 A5 A4 A3 A2 A1 A0 WR IORQ RST 6.5 ALE S1 BUSACK INTA READY RESET OUT CLK OUT CS-MEM Signals CLK2 CLK1 GATE1 OUT1 Pin 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 Pin 2 4 6 8 Signals Vcc GND AD7 AD6 AD5 AD4 A15 A14 A13 A12 A11 A10 A9 A8 RD MEMRQ RST 6.5 ALE S0 BUSRQ INTR NMI RESET IN CS-I/O CS-MEM Signals OUT2 GATE2 CLK0 OUT0 GATE0 Signals

8253 Connector-CN2 (for Model : NV5585)

9 GND 10 8255 Connector-CN3 (for Model : NV5585) Pin Signals Pin

NVIS Technologies

60

NV5585 1 2 3 4 5 6 7 8 9 10 11 12 13 P1C4 P1C5 P1C2 P1C3 P1C0 P1C1 P1B6 P1B7 P1B4 P1B5 P1B2 P1B3 P1B0 14 15 16 17 18 19 20 21 22 23 24 25 26 P1B1 P1A6 P1A7 P1A4 P1A5 P1A2 P1A3 P1A0 P1A1 P1C6 P1C7 GND VCC

Power Supply Connector for Interfacing Modules (Right Side Bottom near Mains Socket):-

Gnd

+5V

+12V

-12V

1
Pin 1 3 5

3
Signals Gnd Blank -12V

4
Pin 2 4

5
Signals +5V +12V

Serial (RS-232C) Connector-CN5 (for Model : NV5585) Pin 1 3 Pin 1 2 3 4 5 Signals RX GND Signals PC4 PC5 PC2 PC3 PC0 Pin 14 15 16 17 18 Signals PB1 PA6 PA7 PA4 PA5 Pin 2 Signals TX

8155 Connector-CN4 (for Model : NV5585)

NVIS Technologies

61

NV5585 6 7 8 9 10 11 12 13 PC1 PB6 PB7 PB4 PB5 PB2 PB3 PB0 19 20 21 22 23 24 25 26 PA2 PA3 PA0 PA1 TIMER IN TIMER OUT GND VCC

JUMPER DETAILS For NV5585:

JP 1 Short 1 & 2 for Vcc to RAM Short 2 & 3 for Battery Supply to RAM Factory Setting Short 1& 2

NVIS Technologies

62

NV5585 HARDWARE INTERRUPTS Interrupts In NV5585 Trainer : The 8085 has 5 interrupt inputs: INTR, RST 5.5, RST 6.5, RST 7.5, and TRAP. Each of three RESTART inputs, 5.5, 6.5, 7.5, has a programmable mask. TRAP is also a RESTART interrupt except it is non-maskable. The three RESTART interrupts cause the internal execution of RST (saving the program counter in the stack and branching to the RESTART address) if the interrupts are enabled and if the interrupt mask is not set. The nonmaskable TRAP causes the internal execution of a RST independent of the state of the interrupt enable or masks.

Name TRAP RST 5.5 RST 6.5 RST 7.5

Restart Address (Hex) 2416 (used in 8253 timer for Single Step Instruction execution) 2C16 (used in keyboard controller 8279) 3416 (Free for the user and its address is in RAM location is 27B7 to 27B9) 3C16 (used in keyboard and address is 27BD to 27BF)

There are two different types of inputs in the restart interrupts. RST 5.5 and RST 6.5 are high level-sensitive like INTR (and INT on the 8080) and are recognized with the same timing as INTR.RST 7.5 is rising edge-sensitive. For RST 7.5, only a pulse is required to set an internal flip flop which generates the internal interrupt request. The RST 7.5 request flip flop remains set until the request is serviced. Then it is reset automatically. The status of the three RST interrupt masks can only be affected by the SIM instruction and RESET IN. The interrupts are arranged in a fixed priority that determines which interrupt is to be recognized if more than one is pending as follows: TRAP - highest priority. RST 7.5, RST 6.5, RST 5.5, INTR - lowest priority. This priority scheme does not take into account the priority of a routine that was started by a higher priority interrupt RST 5.5 can interrupt a RST 7.5 routine if the interrupts were re-enabled before the end of the RST 7.5 routine. The TRAP interrupt is useful for catastrophic errors such as power failure or bus error. The TRAP input is recognized just as any other interrupt but has the highest priority. It is not affected by any flag or mask. The TRAP input is both edge and level sensitive. The TRAP input must go high and remain high to be acknowledged, but will not be recognized again until it goes low, then high again. This avoids any false triggering due to noise or logic glitches. Example-1 The following examples illustrate the use of RST 5.5 used in keyboard controller 8279 to get the scan code and display in the data field.

NVIS Technologies

63

NV5585 Address 2000 2002 2003 2004 2007 200A 200D Code 3E 0E 30 FB CD 29 06 32 F6 27 CD FA 06 C3 00 20 Label Mnemonic MVI SIM EI CALL STA CALL JMP RD KB 27F6 MODDT 2000 Operand A,0E Comments Initialize RST 5.5 Set interrupt mask Enable interrupt Read keyboard Store current data Display the scan code on data field Loop

Execute from 2000 location. Whenever any key is pressed, it displays the scan code of that particular key. Example-2 The following program will be demonstrate the use of RST 7.5 as VEC INT key on the keyboard. The program will display Err whenever the vector interrupt key is pressed. Address 2000 2002 2003 2004 2100 2103 27BD Code 3E 0B 30 FB C3 04 20 CD 55 04 CALL 76 C3 00 21 JMP Label Mnemonic MVI SIM EI JMP Err HLT 2100 Jump to interrupt service routine. 2004 Operand A,0B Comments Initialize RST 7.5 Set interrupt mask Enable interrupt Loop

Now write the program for interrupt service routine at 2100 location This displays Err on the display field

Now enter the jump address of interrupt service routine at 27BD.

Execute the program from 2000 and press vector interrupt (VEC INT) key and displays the service routine Err.

NVIS Technologies

64

NV5585 SOFTWARE INTERRUPT During this process of debugging some time one might just like to examine the status of the program at a particular point. If this point is near the beginning of the program, one can reach this point by single instruction facility. But, if this point is quite far off from the beginning of the program, it is time saving to make use of break point facility. For this introduce a RST5 instruction (EF) at the point to be examined and run the program at full speed using GO Command. When, during the execution of the program, this instruction is encountered, the control of the processor is transferred to the monitor. The monitor saves the user registers and displays a sign NVS 85 on the display. Now one can examine the status of any memory location or any internal register. One can change the content of memory location or register if necessary. Note : While debugging the program dont press RESET Key. 8085 INSTRUCTION SET Hex 52 53 54 55 56 5F 58 59 5A 5B 5C 5D 5E 67 60 61 62 63 64 65 66 6F Hex 68 69 Mnemonic MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV D,D D,E D,H D,L D,M E,A E,B E,C E,D E,E E,H E,L E,M H,A H,B H,C H,D H,E H,H H,L H,M L,A L,B L,C Hex 71 72 73 74 75 3E 06 0E 16 1E 26 2E 36 00 B7 B0 B1 B2 B3 B4 B5 B6 Hex F6 D3 Mnemonic MOV M,C MOV M,D MOV M,E MOV M,H MOV M,L MVI MVI MVI MVI MVI MVI MVI MVI NOP ORA ORA ORA ORA ORA ORA ORA ORA ORI OUT A, 8-Bit B, 8-Bit C, 8-Bit D, 8-Bit E, 8-Bit H, 8-Bit L, 8-Bit M, 8-Bit A B C D E H L M 8-Bit 8-Bit

Mnemonic

Mnemonic

NVIS Technologies

65

NV5585 6A 6B 6C 6D 6E 77 70 E5 F5 17 1F D8 C9 20 07 F8 D0 C0 F0 E8 E0 0F C7 CF D7 DF E7 EF F7 FF C8 9F 98 Hex 99 9A 9B 9C MOV MOV MOV MOV MOV MOV MOV L,D L,E L,H L,L L,M M,A M,B E9 C1 D1 E1 F1 C5 D5 9D 9E DE 22 30 F9 32 02 12 37 97 90 91 92 93 0 1 2 3 4 5 6 7 A B C D E H 94 95 96 D6 EB AF A8 A9 AA AB AC Hex AD AE EE E3 PCHL POP POP POP POP B D H PSW

PUSH B PUSH D SBB SBB SBI SIM SPHL STA 16-Bit STAX B STAX D STC SUB SUB SUB SUB SUB SUB SUB SUB SUI XCHG XRA XRA XRA XRA XRA XRA XRA XRA XRI XTHL 66 A B C D E H L M 8-Bit A B C D E H L M 8-Bit L M 8-Bit

PUSH H PUSH PSW RAL RAR RC RET RIM RLC RM RNC RNZ RP RPE RPO RRC RST RST RST RST RST RST RST RST RZ SBB SBB SBB SBB SBB SBB

SHLD 16-Bit

Mnemonic

Mnemonic

NVIS Technologies

NV5585 CE 8F 88 89 8A 8B 8C 8D 8E 87 80 81 82 83 84 85 86 C6 A7 A0 A1 A2 A3 A4 A5 A6 E6 CD DC FC 2F Hex 2B 3B F3 FB 76 DB ACI ADC ADC ADC ADC ADC ADC ADC ADC ADD ADD ADD ADD ADD ADD ADD ADD ADI ANA ANA ANA ANA ANA ANA ANA ANA ANI 8-Bit A B C D E H L M A B C D E H L M 8-Bit A B C D E H L M 8-Bit 3F BF B8 B9 BA BB BC BD BE D4 C4 F4 EC FE E4 CC 27 09 19 29 39 3D 05 0D 15 1D 25 2D 35 0B 1B Hex 01 11 21 31 7F 8-Bit 78 H SP CMC CMP CMP CMP CMP CMP CMP CMP CMP CNC CNZ CP CPE CPI CPO CZ DAA DAD DAD DAD DAD DCR DCR DCR DCR DCR DCR DCR DCR DCX DCX LXI LXI LXI LXI B D H SP A B C D E H L M B D B, 16-Bit D, 16-Bit H, 16-Bit SP, 16-Bit A B C D E H L M 16-Bit 16-Bit 16-Bit 16-Bit 8-Bit 16-Bit 16-Bit

CALL 16-Bit CC 16-Bit CM CMA Mnemonic DCX DCX DI EI HLT IN 16-Bit

Mnemonic

MOV A,A MOV A,B 67

NVIS Technologies

NV5585 3C 04 0C 14 1C 24 2C 34 03 13 23 33 DA FA C3 D2 C2 F2 EA E2 CA 3A 0A 1A 2A Note: INR INR INR INR INR INR INR INR INX INX INX INX JC JM JMP JNC JNZ JP JPE JPO JZ LDA A B C D E H L M B D H SP 16-Bit 16-Bit 16-Bit 16-Bit 16-Bit 16-Bit 16-Bit 16-Bit 16-Bit 16-Bit 79 7A 7B 7C 7D 7E 47 40 41 42 43 44 45 46 4F 48 49 4A 4B 4C 4D 4E 57 50 51 MOV A,C MOV A,D MOV A,E MOV A,H MOV A,L MOV A,M MOV B,A MOV B,B MOV B,C MOV B,D MOV B,E MOV B,H MOV B,L MOV B,M MOV C,A MOV C,B MOV C,C MOV C,D MOV C,E MOV C,H MOV C,L MOV C,M MOV D,A MOV D,B MOV D,C

LDAX B LDAX D LHLD 16-Bit

1. 2. 3.

Byte Instructions: Operand R,M or implicit Byte Instructions: Operand 8-Bit Byte Instructions: Operand 16-Bit

NVIS Technologies

68

NV5585 8085 PIN DETAILS

NVIS Technologies

69

NV5585 NV5585 BLOCK DIAGRAM

NVIS Technologies

70

NV5585 WARRANTY 1) 2) We guarantee the instrument against all manufacturing defects during 24 months from the date of sale by us or through our dealers. The guarantee covers manufacturing defects in respect of indigenous components and material limited to the warranty extended to us by the original manufacturer and defect will be rectified as far as lies within our control. The guarantee will become INVALID. a) b) c) d) 4) If the instrument is not operated as per instruction given in the instruction manual. If the agreed payment terms and other conditions of sale are not followed. If the customer resells the instrument to another party. Provided no attempt have been made to service and modify the instrument.

3)

The non-working of the instrument is to be communicated to us immediately giving full details of the complaints and defects noticed specifically mentioning the type and sr. no. of the instrument, date of purchase etc. The repair work will be carried out, provided the instrument is dispatched securely packed and insured with the railways. To and fro charges will be to the account of the customer. DISPATCH PROCEDURE FOR SERVICE

5)

Should it become necessary to send back the instrument to factory please observe the following procedure: 1) 2) Before dispatching the instrument please write to us giving full details of the fault noticed. After receipt of your letter our repairs dept. will advise you whether it is necessary to send the instrument back to us for repairs or the adjustment is possible in your premises.

Dispatch the instrument (only on the receipt of our advice) securely packed in original packing duly insured and freight paid along with accessories and a copy of the details noticed to us at our factory address.

NVIS Technologies

71

NV5585

List of Accessories 1. e-Manual CD 2. 26 Pin FRC Cable 3. 50 Pin FRC Cable 4. 10 Pin FRC Cable 5. RS232 Cable 6. Power cable 7. Jumper 8. Phoenix Cable 1No. 2No. 1No. 1No. 1 No. 1No. 1No. 1No

NVIS Technologies

72

NV5585 LIST OF SERVICE CENTERS 1. Scientech Technologies P. Ltd. 90, Electronic Complex Pardesipura, INDORE 452010 2. Scientech Technologies P. Ltd. First Floor, 14, Uday Park, NEW DELHI 110049 3. Scientech Technologies P. Ltd. New no.2, Old no.10, 4th street Venkateswara nagar, Adyar CHENNAI 600025 4. Scientech Technologies P. Ltd. 202/19, 4th main street Ganganagar, BANGALORE- 560032 Ph: (0731) 5202959 Email: info@scientech.bz

Ph.: (011) 26513912, 26864943 Fax: (011) 26864943. Email: ndel@scientech.bz

Ph.: (044) 52187548, 52187549 Fax: (044) 52187549 Email: chennai@scientech.bz

Ph.: (080) 51285011 Fax: (080) 51285022 Email: bangalore@scientech.bz

5. Scientech Technologies P. Ltd. 8,1st floor, 123-Hariram Mansion, Ph.: (022) 56299457 Dada Saheb Phalke Road Fax: (022) 24168767 Dadar (East) Email: stplmum@vsnl.net MUMBAI 400014 6. Scientech Technologies P. Ltd. 988, Sadashiv Peth, Gyan Prabodhini Lane, PUNE 411030 7. Scientech Technologies P. Ltd SPS apartment, 1st floor, 2, Ahmed Maooji Street, Behind jaiswal hospital Liluah, Howrah- 711204 W.B.

Ph.: (020) 24461673 Fax: (020) 24482403 Email: pune@scientech.bz Ph. +913355266800 Email: kolkata@scientech.bz

NVIS Technologies

73

Вам также может понравиться