Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. MICROFRIEND DYNA – 85 User’s Manual Kailas Vaibhav , G– Wing , 3rd Floor, Park Site, Vikhroli ( West ) , Mumbai – 400 079 . INDIA Tel . : 91 - 22 - 5181900 (16 Lines) Fax . : 91 - 22 - 5181930 / 5181940 s a l e s @ d y n a l o g i n d i a . c o m w w w . d y n a l o g i n d i a . c o m
  3. 3. PAGE NO. PAGE NO.CHAPTER 3 CHAPTER 5 OPERATING INSTRUCTION-KEYBOARD…………. 3-1 MACHINE LANGUAGE PROGRAMMING…………. 5-13.1 KEYBOARD OPERATION…………………………………. 3-1 5.1 MONITOR SUBROUTINES………………………………… 5-13.2 SET , INR , DCR KEYS…………………………………….. 3-2 1. MODIAD…………………………………………… 5-33.3 REG………………………………………………………….. 3-3 2. MODIDT…………………………………………… 5-43.4 GO / EXEC………………………………………………….. 3-6 3. RDKBD …………………………………………….. 5-4 4. DELAY…………………………………………….. 5-43.5 STEP………………………………………………………… 3-7 5. CLEAR ……………………………………………. 5-53.6 VI : VECTOR INTERRUPT……………………………….. 3-10 6. GTHEX……………………………………………….5-53.7 RES : RESET………………………………………………. 3-10 7. OUTPUT…………………………………………….. 5-53.8 CODE………………………………………………………. 3-10 5.2 SERIAL ROUTINES…………………………………………..5-73.9 USER KEYS U1 , U2 , U3 , U4……………………………. 3-11 1. CIN………………………………………………….. 5-83.10 SAVE……………………………………………………….. 3-12 2. COUT………………………………………………. 5-83.11 LOAD………………………………………………………. 3-12 3. CROUT……………………………………………… 5-8 4. NMOUT…………………………………………….. 5-8CHAPTER 4 5. GETHX …………………………………………….. 5-8 CODES………………………………………………….. 4-1 5.3 PROGRAMMING EXAMPLES…………………………….. 5-94.1 CODE 00 : MOVE BLOCK…………………………………. 4-1 EXAMPLE 1 : FAMILIARIZATION……………………….. 5-94.2 CODE 01 : FILL BLOCK…………………………………… 4-3 EXAMPLE 2 : RDKBD……………………………………… 5-114.3 CODE 02 : INSERT BLOCK………………………………. 4-3 EXAMPLE 3 : MODIDT……………………………………... 5-12 EXAMPLE 4 : RDKBD + MODIDT………………………… 5-124.4 CODE 03 : DELETE BLOCK………………………………. 4-3 EXAMPLE 5 : HEX ADDITION…………………………….. 5-124.5 CODE 04 : SEARCH BLOCK……………………………… 4-5 EXAMPLE 6 : 4 DIGIT HEX COUNTER…………………… 5-134.6 CODE 04 : HEX TO DECIMAL……………………………. 4-6 EXAMPLE 7 : 2 DIGIT DECIMAL COUNTER…………….. 5-144.7 CODE 06 : DECIMAL TO HEX……………………………. 4-7 EXAMPLE 8 : FLASHING DISPLAY………………………. 5-154.8 CODE 0E : COMPLEMENT BLOCK………………………. 4-7 EXAMPLE 9 : ROLLING DISPLAY………………………… 5-164.9 CODE OF : ROLLING DISPLAY…………………………… 4-8 TABLE 5.1 SCRATCH PAD LOCATION……………….. 5-2 ii TABLE 5.2 CHARACTER CODES………………………. 5-6 iii
  5. 5. INTRODUCTION INTRODUCTION TO MICROFRIEND DYNA-85What will I get DYNA-85 !Microfriend DYNA-85 is an introduction to a low cost trainer anddevelopment kit. It was developed to assist the novice to get familiarwith INTEL 8085 microprocessor in a user friendly environments.This user’s manual tells you about – Hardware of DYNA-85. Monitor commands to interact with DYNA-85. Memory & I/O details of Dyna-85. Working with hex keypad and display. Serial I/O and Audio cassette interface. Circuit diagram and connector details.Before you begin : 1) Study this manual carefully. 2) Write your own programs after studying the chapter on Machine Language programming and try them out. 3) Do not hesitate to experiment using the I/O lines for real world interfacing. 1
  6. 6. 1-1CHAPTER 1CONFIGURATION OF MICROFRIEND DYNA-85 1.1 SYSTEM OVERVIEWMICROFRIEND DYNA-85 is a single board computer based on 8085ACPU designed specially for training and development applications.It is equally useful for a novice as well as development engineers forstudying the 8085A CPU and developing various product based on the8085A.1.1.1 SYSTEM HARDWARE OVERVIEW CENTRAL PROCESSING UNIT MICROFRIEND DYNA - 85 I s based on the INTEL 8085A high performance CPU operating at 3 MHz. MEMORY Powerful system monitor has been provided on a 2732 EPROM covering 4K bytes.This monitor includes all standard commands, codes , functions and utility subroutines. A 6116 battery back up RAM ( 2K ) is provided on the board for inputting and executing programs. Three 28 pin sockets are provided for memory chips so that further expansion of RAM/EPROM is possible upto a maximum of 56K .
  7. 7. 1-2 1-3 HEX KEYPAD / DISPLAY INTERFACE aA Keypad with 21 keys and 6 digits LED seven segments display isprovided for interaction with the system using 8279 keyboard /display controller. This chip provides the following features. f b gSimultanous Keyboard & Display operation.Scanned Keyboard Model sensor Mode.2 Key locked / N Key roll over.Contact Debounce. e c16 DisplaysProgrammable scan timing. dThe hex keypad has the standard hexadecimal keys and many otherfunction and Code keys. 4 “User Definable” function keys are also Writing a 1 in the desired bit lights that particular segment.provided which can be defined by the user . All scan, return, shift and PARALLEL I/O INTERFACEcontrol lines of 8279 are brought on to connected J4. 46 parallel I/O lines are provided on board , 22 from 8155 and 24 from 8255 . These lines are brought on to connector J2 ( for 8155 ) and (for 8255).8279 DATA FORMAT : SERIAL I/O AUDIO CASSETTE INTERFACEThe data format for the character being displayed by the 8279 is one bit Serial I/O is available through RS232C compatible port. The SID & SODcorresponding to each segment of the seven segment display plus one lines are used under software control for serial operation . Baud rate isbit for the decimal point. The display bits are store in the 8279 in the adjustable.form of one byte digit of the display from RAM location 0 to 5 . Onboard Audio Cassette I / F is provided with file management , forThe byte format is as follows : storage and retrieval of data using a cassette recorder. A3 A2 A1 A0 B3 B2 B1 B0 TIMER c d b a e g f dp Three channels of 8253 chip , a 16 bit TIMER / COUNTER and one channel of 14 bit TIMER /COUNTER of 8155 are provided on board. All lines of 8253 are provided on connector J7 and 8155 are provided on J2.
  8. 8. 1-4 1-5 EXPANSION SLOT STEP : Allows the user to execute the program on single stepAll Address, Data, Control and Hardware Interrupt lines are brought on mode or break point mode.to a 50 pin FRC connector for system interfacing and expansion. These SAVE : Used for saving the contents of memory onto an audiolines are unbuffered so user has to take care while expanding their cassette.system. LOAD : Used for loading the program from audio cassette back1.1.2 SYSTEM COMMANDS OVERVIEW to the memory in RAM area.The HEX KEYPAD mode supports the following commands : U1..U4 : These keys are user definable functin keys. The function of these keys can be defined by the user , by loading theRESET : Provides hardware reset . Display shows “FrlEND” on appropriate memory locations with vectors pointing to pressing this key. user subroutines.VI : Vector interrupt key.Activate RST 7.5 vectored interrupt. 1.1.3 SYSTEM FIRMWARE OVERVIEWSET : Allows the user to examine & modify the contents of RAM and only examination of contents is possible in case of EPROM. The MICROFRIEND DYNA-85 has very powerful and user friendly FIRMWARE in the EPROM.INR : Increments memory address presently displayed un the address field of display. Complete listing of the Monitor FIRMWARE is given at the end of User can borrow any subroutine from the listing for his ownDCR : Decrements memory address presently displayed in the program development. address field od display. Various commands available through the keyboard and the codedREG : Allows the user to examine contents of CPU registers & subroutines are accessible through the CODE key and is already been modify them if necessary. listed in chapter.GO : Allows the user to load the program counter by the A point worth mentioning here about the FIRMWARE is the options of desired memory address which is the starting address of entry point to the Monitor. the program to be executed. There are two options available , one is the COLD START , other isEXEC : Used to start the execution of GO or CODE command. WARM START . In COLD START entry the system is completelyCODE : Used for selecting one of the coded subroutines in the reinitialized and no user program status is saved from the previous monitor. program executed. This is equivalent to the hardware reset.
  9. 9. 1-6 1-7COLD START entry can be performed through software by using the The areas of application on MICROFRIEND DYNA-85 are as follows :-RST 0 instruction. 1. Analog to Digital Converter Interface.In WARM START entry, the start of previously executed user program is 2. Digital to Analog Converter interface.fully saved before entering the monitor. WARM START entry is possible 3. Interfacing Hexadecimal Keyboad.through software by using th RST 1 instruction. 4. Simulation of an Elevator.In both cases, the sign on display is ‘FrlEND’ as in case of hardware 5. Temparature Controller Interface.reset through RESET Key. 6. Stepper motor Controller.CODE COMMANDS : 7. Traffic Light Control System. 8. DC Motor Controller.CODE 00 : Move a block of memory. 9. Thumbwheel Interface.CODE 01 : Fill a block with a data byte.CODE 02 : Insert a byte in a block. And many more experiment and application can be thought andCODE 03 : Delete a byte from a block. successfully developed on MICROFRIEND DYNA-85 system.CODE 04 : Search a given block for a given pattern.CODE 05 : Hex to Decimal conversion.CODE 06 : Decimal to Hex conversion.CODE 0E : Complement a block.CODE 0F : Rolling Display.1.1.3 APPLICATION OF MICROFRIEND DYNA-85MICROFRIEND DYNA-85 is the low cost learning and developmentsystem for beginners as well as development engineersThe powerful friendly FIRMWARE allows you to learn all application of8085A and its support chips like 8255 PPI. 8155 PPI and Timer . 8279prgrammable keyboard and display controller,8253 Programmable timerand counter etc.You can load,debug and finialize your program on theMICROFRIEND DYNA-85 and nce the development is finilize it canalso be used as an OEM board.
  10. 10. 2-1CHAPTER 2SYSTEM MEMORY & INPUT / OUTPUTMAPPING 2.1 MEMORY MAPPINGThe system memory is also as important as the CPU itself , because thisis where the system program resides and the CPU takes its instructionfrom the program. The memory is of two types ROM and RAM i.e.READ ONLY MEMORY & RANDOM ACCESS MEMORY.The MICROFRIEND DYNA-85 has a flexible memory map , and foryour convenience for program development, the RAM has useful featuresuch as battery back-up. FFFF USER RAM IC 6116 C000 BFFF EXPANSION EPROM/RAM 4000 3FFF MONITOR 0000 EPROM
  11. 11. 2-2 2-30000H TO 3FFFH : IC ADDRESS MODE I/O FUNCTIONMonitor EPROM socket.Monitor 2732 is located at 000H to 0FFFH andis mapped at 1000H-1FFFH,2000H-2FFFH and 3000-3FFFh also. 8255 10 R/W PORT A 11 R/W PORT BIt 2764 / 27128 are used , 1000H - 3FFFH can be used for further 12 R/W PORT Cexpansion. 13 WRITE CONTROL REGISTER4000H to BFFFH : 8253 18 R/W COUNTER 0 19 R/W COUNTER 1This Socket is used for user expansion of EPROM and RAM. 1A R/W COUNTER 2EPROMs like 2716 / 2732 / 2732 / 2764 / 27128 / 27256 or RAMs 1B WRITE CNTROL REGISTERlike 6116 / 6264 / 62256 can be installed by suitable strappings.C000H to FFFFH :User RAM socket.The 2K user RAM IC 6116 is located at F800H- 2.3 POWER SUPPLYFFFFH.This 2K memory is folded after every 2K bytes from C000H toFFFFH.In this socket 6264 can also be used.2.2 INPUT/ OUTPUT MAPPING Recommanded Power Supply for DYNA-85 kit DMS SMPS – 01IC ADDRESS MODE I/O FUNCTION Having following specification :8279 04 READ READ KEYBOARD FIFO WRITE WRITE DATA TO DISPLAY 05 READ READ STATUS WORD Voltage Current Rating WRITE WRITE COMMAND WORD +5V 1A8155 08 WRITE COMMAND/STATUS + 12 V 500 mA REGISTER 09 R/W PORT A - 12 V 250 mA 0A R/W PORT B + 30 V 100 mA 0B R/W PORT C 0C R/W TIMER LOW BYTE 0D R/W TIMER HIGH BYTE
  12. 12. 2-4 3-1 CHAPTER 3 OPERATING INSTRUCTION- KEYBOARDKEYPAD LAYOUT : 3.1 KEYBOARD OPERATIONRESET VI C D E F MICROFRIEND DYNA-85 has a built in keyboard ( KEYPAD).The layout U1 U2 U3 U4 of the keypad is given on the opposite page for ready reference. The system can also be operated through a console connected to the serial interface. While using the built in keyboard , we can work only in the Hexadecimal DCR 8 9 A B number system . There are 16 keys for entering Hex numbers from 0 GO/H LOAD SAVE to F. These are all dual meaning keys and the key designated depends L on when the key I s pressed. In addition to these 16 keys there is one vector Interrupt key, one RESET key and 3 function keys. When the system is switched on the display shows , sign – on message EXEC 4 5 6 7 ’F r l E n d’. This indicates that the system is reset and the monitor SPH SPL PCH PCL expects a command from you. At this moment any one of the command keys : SET , CODE , STEP, REG, GO, LOAD or SAVE can be pressed depending on the desired operation. In case any non command key is pressed, the display will show ‘FErr’ message, you can again press a valid command key or press RESET INR 0 1 2 3 and then press a valid command key. SET CODE STEP REG/I The various command and function keys are explained below :
  13. 13. 3-2 3-3 3.2 SET,INR,DCR KEYS EXAMPLE 1 : Key Pressed Address Field Data FieldYou can use the SET key to set the address of the memory location tobe accessed. On pressing SET key the display becomes blank and a dot RES F r I E n dappears in the Address field which is made up of the first four digit of thesix digit display . The remaining two digit of the six digit display are the SETdata field .The dot in the address field indicates that your next key will be F 0 0 0 Ftreated as an address entry (entry is from Right to Left and last 4 entries 0 0 0 F 0are retained). 0 0 F 0 0 0 F 0 0 0When you have entered the 4 digit hexadecimal address press the INRkey which will terminate the address entry and display the c ontents of INR F 0 0 0 X Xthat memory location as the two digits in the data field. 3 F 0 0 0 0 3 E F 0 0 0 3 ENow you can modify or retain the contents of the location. INR F 0 0 1 X X DCR F 0 0 0 3 EPressing INR key again will load the data field into the memory locationat the address shown in the address field . This key also increments the EXEC Faddress by 1 location and dispalys the contents of that new locaton withrequired data. Pressing EXEC key terminate the loading of memory and the monitorDCR key also works in a similar way but it decrements the address by 1 waits for next command.and points to the previous location.Trying to load data into a Monitor EPROM location using SET key 3.3 REGresults in ‘FErr’(error). This key allows you to examine and optionally modify the contents ofSET, INR, DCR, keys can also be used to verify the data loaded in RAM all 8085 internal registers.by displaying one location after another. Pressing REG key will blank the display and a dot appears in the Field. Next press a valid register name. The Register names appears on various hexadecimal number keys as follows :- 3 : I ( Interrupt Mask ) 4 : SPH ( Stack Pointer High ) 5 : SPL ( Stack Pointer Low )
  14. 14. 3-4 3-56 : PCH ( Program Counter High Format of the F register ( Flag Register ) is as follows :7 : PCL ( Program Counter Low )8 : H ( H Register )9 : L ( L Register ) S Z X AC X P X CA : A ( A Register )B : B ( B Register ) X : Don’t care.C : C ( C Register ) C : CarryD : D ( D Register ) P : ParityE : E ( E Register ) X : Don’t CareF : F ( Flag register ) AC : Auxillary Carry Z : ZeroPressing any one of these keys after pressing REG key will display the S : Signparticular register name in the address field and the contents of thatregister will be displayed in the data field. EXAMPLE 2 :Pressing INR key after this , will point to the next register and DCR willpoint to the previous register. Key Pressed Address Field Data FieldContents of the register can be modified at this point similar to loadingany other memory location. REG .Pressing INR and DCR keys after modifying the contents of that register A A X Xand ENTER terminates the command. Address field shows F in the left 0 A 0 0most digit , the monitor indicates as usual that the it is waiting for the 5 A 0 5next command. 0 0 5 0Format for the I register (Interrupt mask) is as follows : INR B X X I M M M DCR A 5 0 EXEC F 0 0 0 A E 7.5 6.5 5.5 I Interrupt enable Flag [ 1 is enabled, 0 is disabled ] M Interrupt Mask [1 is masked , 0 is unmasked ] NOTE : ONLY LAST TWO ENTRIES ARE RETAINED.
  15. 15. 3-6 3-7 3.4 GO/EXEC 3.5 STEPThis pairs of keys is used to execute a program from a desired location We have seen how a program can be executed by using GO andonwards. If the GO key is pressed, It displays the present address in the EXEC pair of keys.This method is useful only when the program isprogram counter and the contents of the memory location at address. A finalized, or when we have a ready program.dot appears in the address field indicating that you can enter a new In case a program is being developed , it is essential that we haveaddress in the address field. You can now modify the contents of the a ready program and it I s essential that we have a facility to check the execution of program stage by stage and see the results.program counter . After loading the desired starting address in theaddress field , press EXEC key to execute the program starting at the This can be achieved in two ways . One way is to insert the RST 1address .During execution of the program , the address field shows ‘E’ instruction ( CFH ) at every point where a break is desired to checkindicating that the user program or subroutine is being executed. status or result , which is possible only in case of short programs being run from the RAM.The Monitor Regains control either after pressing the RESET key Another way is to use the STEP key and step through the program.( Hardware Reset ) or after executing RST 0, RST 1, JMP 0000H or JMP Pressing the STEP key displays the contents of the program0008H instruction (Software Reset). counter , Which can be modified to set the starting address of theEXAMPLE 3 : program. Now press INR and the monitor will prompt for other parameters : Key Pressed Address Field Data Field br : Break Address GO P P P P X X Cn : N +1 , where N is the number of times the break should F 0 0 0 F occur. 0 0 0 F 0 0 0 F 0 0 In case ‘br’ and ‘Cn’ both are given a value of zero,the system goes into 0 F 0 0 0 single stepping mode. In single stepping mode, the program os executed EXEC F single instruction at a time . Execution stops after every instruction and a status check is possible. EXAMPLE 4 : NOTE : P P P P IS THE PRESENT CONTENTS OF PROGRAM Let us take a simple program to see how the STEP command COUNTER WHEN GO KEY WAS PRESSED. XX IS THE DATA IN works.Load MEMORY LOCATION P P P P. the following program starting at location F000H.
  16. 16. 3-8 3-9 Address Data Mnemonic Key Address Data Comments F000 3E 05 MVI A, 05h Pressed Field Field F002 3D DCR A F003 C202F0 JNZ F002h STEP PPPP XX PRESENT PC F006 76 HALT CONTENTSThis program first loads register A ( Accumulator ) with 05 , then F000 F000 STARTING ADDRESSdecrements the accumulator contents by 1 till the contents become zero INR . br BREAK POINT ? 0 0000 br IGNORE br.and halts at that point. INR Cn . Cn ?The JNZ loop will make use of ‘br’ and ‘Cn’. First let us execute the 0 0000 00 IGNORE Cn.program with STEP key and using ‘br’ and ‘Cn’ parameters. INR F002 3D FIRST INSTRUCTION EXECUTED PC POINTSKey Address Data Comments TO NEXT INSTR .Pressed Field Field EXEC F PROGRAM STOPS FOR REG . STATUS CHECK .STEP PPPP XX PRESENT PC CONTENTS A A 05 REG . A (Acc)F000 F000 STARTING ADDRESS CONTENS 05INR . br BREAK ADDRESS ? EXEC F NEXT COMMAND ?F002 F002 br BREAK AT F002 STEP F002 3D STEPINR Cn . Cn ? INR F003 C2 SECOND INSTR.04 Cn 04 Cn 4 N + 1 EXECUTEDINR F002 3D PROGRAM STOPS AFTER EXEC F PROGRAM STOP FOR BREAKPOINT OCCURRED 3 STATUS CHECKEXEC F TIMES REG . REGISTER A (Acc)REG . EXAMINE REG.A CONTENTS 04A A 02 A A 04 AFTER DECREMENTINGAs the program stopped after the breakpoint occurs 3 times, the original ONCEcontents of register A which were 05 have been decremented threetimes. The register A should now contain 02, which is displayed in the After counting this sequence till the contents of A become 00, thedata field. program comes out from the JNZ loop and the address field shows theThe same program can be executed in a single stepping mode. last address of the program , i.e. F006H. Contents of this location are displayed in the data field as 76 (HALT). If you press EXEC at this stage and examine the stage and examine the contents of register A using REG command , the result will be 00 as expected.
  17. 17. 3-10 3-11 3.6 VI : VECTOR INTERRUPT 3.9 USER KEYS U1,U2,U3,U4This key is used to interrupt the program execution and transfe r the There are 4 user definable keys on the MICROFRIEND DYNA-85. Eachcontrol to location 003CH in the monitor.This location has a jump to of these keys has a vector in the scratchpad RAM area . By loadinglocation FFCEH in the user RAM.By inserting another jump instruction at an appropriate jump instruction at these location, you can define the functon of keys U1, U2, U3, U4.FFCEH , we can transfer the control to an interrupt service routinelocated to another area in the memory. The vector location are as follows :For proper operation of this key, the user program must enable theinterrupt through the EI instruction and the RST 7.5 must be unmasked Key Memory Locationusing the SIM instruction.The exmple of a decimal counter included in the chapter on U1 FF9CH, FF9DH, FF9EHprogramming, will make the application of key will make it more clear. U2 FF9FH, FFA0H, FFA1H U3 FFA2H, FFA3H, FFA4H 3.7 RES : RESET U4 FFA5H, FFA6H, FFA7HPressing RES key causes a hardware RESET operation.The control is An example will illustrate how these keys can be used . There is atransferred to location 0000H in the monitor. The monitor program is subroutine in the monitor for a “ROLLING DISPLAY” at location 0E5BH.executed from 0000H onwards without saving the status resulting from Using the SET key load a jump instruction C3 5B 0E at location FF9CH,any user program executed before the ‘RESET’. The display shows FF9DH and FF9EH which are the U1 key vector location.Mow reset the‘F r l E N D’ as the sign-on message and the monitor waits for a valid system and then press U1 key, the display immediately blanks for acommand. moment and then a rolling message appears 3.8 CODE D Y n A L o G h E L P S Y o U L E A r n I n G U PThe code key allows you to access one of the coded subroutines in the By using the U1 key vector, ypu have efficiently transferred the control tomonitor firmware. All the user accessible coded subroutines are the rolling display subroutine.explained in Chapter 4.
  18. 18. 3-12 3-13 3.10 SAVE 2. Press LOAD key, enter the File Number Fn of the program to be loaded.( A hex number between 00 & FF ) 3. Turn CTR ON, keep it in PLAY mode.This command is used for saving your program on an audio cassette.The procedure for saving is as follows : 4. Immediately press EXED Key. L appears in the data field, indicating that the CPU is searching for the file with file number Fn.1. Command the MIC socket (on the top) of the MICROFRIEND DYNA – 85 to the MIC socket of the CTR. 5. Whenever the CPU comes across any File Number , it is displayed in the data field. Loading starts only when the specified File2. Press SAVE key, enter the following parameters number is found and displayed. SS : Source Start 6. The SS parameter of your program is already saved on the cassette SE : Source End tape, and when the program is being loaded back into RAM , it Fn : File Number – any hex number from 00 to FF. automatically gets loaded at the same address.3. Turn CTR ON and keep it in RECORD mode. 7. On completion of loading the program with File number Fn , SS parameter is displayed in the address field.4. Press the EXEC key, S appears in the data field indicates that your program is being saved on the audio cassette.5. On completion of SAVE operation, F r l E n d appears again on the NOTE : There shouldn’t be a gap of more than 10 sec. Between display. turning CTR ON and pressing EXEC key.6. Turn CTR OFF. 3.11 LOADThis command loads your program from the cassette to the RAM . Theprocedure for loading is described below : 1. Connect the EAR Socket of MICROFRIEND DYNA-85 to the EAR or external speaker socket of the CTR. (Select volume control setting by trial)
  19. 19. 4-1CHAPTER 4CODESAs we have seen in the previous chapter, the code key allows us to accessthe various coded subroutines from the monitor program. It is not essentialto remember the starting location addresses of all these subroutines, asthey have been coded to be used with the CODE key.A “Code Referance Chart” has been included in this chapter for quickreferance. Detailed explainaton of operation of all the coded are givenbelow.For executing any code,the ‘CODE’ key is pressed. A dot appesrs inthe data field,indicating that the code number should be entered and will bedisplayed in the data field. Now enter the code number and press INR key.The data field prompts for the data field or the address field will prompt forthe next parameter to be entered.After entering all the parameters,the code can be executed using the INR orEXEC key. 4.1 CODE 00Move a Block of MemoryThis code moves a block of memory from one place to other . Theparameters required to be entered are SS : Source Block starting address,SE : Source Block end address and dS : Destination Block start address.A point to remember here is that dS must always be a RAM address.Tryingto move a block to monitor EPROM results in an error. Please see Chapter 5for further explanation of this point.
  20. 20. 4-2 4-3Example : 1 4.2 CODE 01 Key Pressed Address Field Data Field Fill Block with a Data Byte CODE This code requires the following parameters : 0 0 0. INR . SS SS : Starting address of the block. 0 0 0 0 0. SS SE : End address of the block. INR . SE Sr. : Data byte to be filled in all the location from SS to SE 5 0 0 0 5. SE Sr. can be any hex number from 00 to FF must be within the RAM area. INR . dS F000 F 0 0 0. dS 4.3 CODE 02 EXEC FrIE nd Insert Byte in a Block ( SE, Sr,IA )This example program moves a block of memory between 0000H and In a given block of RAM it is sometimes necessary to insert a byte of data0005H to the RAM address F000H. which is missing. A given byte in Sr is inserted at a given insert address IA. The remaining block shifts down by one position, upto the address given byThis can be verified by using the SET key as follows : SE. No address relocation for jumps are done. Key Pressed Address Field Data Field 4.4 CODE 03 SET F 0 0 0. INR F000 3E Delete a Byte at a Given Address ( SE,DA ) INR F001 0 0. In a given block at a given address DA, a byte is deleted. The remaining INR F002 d 3. block till SE shifts up by one position. The above two INSERT and INR F003 0 5. DELETE commands are very useful in inserting or deleting a display INR F004 00 character in the VIDEO RAM at the given cursor position. INR F005 C3
  21. 21. 4-4 4-5 Ex : INSERT BYTE You can insert anything else. With the SET command verify that 3E,00,D3,05,32,FF,20,19,76 is Load the RAM location 1000H-1007H with the help of SET command. the data from location 1000H-1008H. The block has shifted down by 1 byte. 1000 3E After loading we notice that the instruction to 1 00 store accumulator STA 200FFH is incorrect.The The opposite of INSERT is DELETE and it works as follows : 2 D3 ‘OPCODE’ 32 is missing. It has to be inserted 3 05 before FF , 20 Key Pressed Address Field Data Field 4 FF 5 20 CODE 6 19 03 0 3. 7 76 EXEC . SE 8 XX 1008 1 0 0 8. SE If the block is small you an manually make 1004 as 32 and reload INR . DA theremaining by shifting one down. But if the block is very tedious. To 1004 1 0 0 4. DA Do this use INSERT byte command.IA (Insert Address ) is 1004. SE EXEC FriE N D. ( Block End ) is 1007 and Sr ( Insert byte ) is 32. With the SET command verify that 1000-1007 contents are same as Key Pressed Address Field Data Field before the INSERT command (i.e 1004 ; FF etc.) CODE 4.5 CODE 04 02 02 EXEC SE 1007 1 0 0 7. SE Search a Given Block for Given Pattern ( SS,SE,Sr ) INR IA The given block of memory (RAM or ROM ) between SS and SE is 1004 1 0 0 4. IA searched for a pattern o f byte given in Sr. Whenever the first match INR Sr is found, the address and bytes are displayed. Remaining mismatches 32 Sr 32 can be scanned with INR. EXEC FriE N D. LOAD the data in Ex.4.3 from 1000H.
  22. 22. 4-6 4-7 Ex : BLOCK SEARCH 4.7 CODE : 06 Key Pressed Address Field Data Field Decimal to Hex Conversion This code is useful for converting any Decimal number from 0000 to CODE 9999 into a Hex number equivalent. 04 0 4. EXEC . SS The parameter to be entered is dE, which is the decimal number we 1000 1 0 0 0. SS desire to convert into Hex format. INR SE Pressing EXEC after entering the decimal number displays the Hex 1008 1 0 0 8. SE equivalent. An important precaution to be taken is that , when you are INR Sr . entering the decimal number to be converted to Hex, do not press any 19 Sr 1 9. keys from A to F. There is no provision for detecting this error and the EXEC 1006 19 results of converting that number are unpredictable. INR FriE nd CODE 05 and CODE 06 are very useful in address conversions,relative jumps and total space calculations. 4.6 CODE : 05 4.8 CODE : 0EHex to Decimal Conversion Complement a block of memory This code complements all the data contained within a memory block :CODE 05 is a utility code for converting any Hex number from 0000 to The required parameters are :FFFF into a Decimal number. SS : Starting address of the block.The parameter to be entered is prompted in the data field as HE, and the SE : End address of the block.Hex number to be converted can now the directly entered in the Addressfield. Pressing EXEC displays the Decimal equivalent of the Hex number On executing this code, all the ‘0’ are replaced by ‘1’ by ‘0’ within theentered. specified block of memory. SS and SE must be in RAM area.
  23. 23. 4-8 5-1 CHAPTER 5 4.9 CODE : 0F MACHINE LANGUAGE PROGRAMMINGRolling Display 5.1 MONITOR SUBROUTINESThis is not a utility code but it is a demonstration code to illustration codeillustrate the powerof the display control. This section will cover the applications from the software point of view of MICROFRIEND DYNA - 85 . You are advised to get familiar with theOn executing 0F, the display starts rolling the message : assembly language of INTEL 8085 Microprocessor.You should get familiar d Y n A L o G h E L P S Y o U in L E A r n I n G UP. with the various mnemonics and their power.CODES REFERANCE CHART The 8085 microprocessor makes use of a 16 bit internal register called the stack register to point to a memory area called stack. The stack uses the Code Function Parameters LIFO ( Last In First Out ) type for storage during subroutine calls. User is advised to initialize the Stack Pointer with his stack area.The 00 Block Move SS,SE,dS suggested stack pointer location is FEFFH. Location beyond this should 01 Fill Block SS,SE,Sr not be utilized by the user as the monitor uses this area as the scratch-pad 02 Insert Byte SE,IA,Sr RAM. 03 Delete Byte SE,dA 04 Block Search SS,SE,Sr You may borrow several monitor routines to simplify your task of 05 Hex to Dec HE programming and to minimize RAM used. From the Firmware listing 06 Dec to Hex dE provided, take care of noting the parameters required by these routines, 0E Complement Block SS,SE as some of the routines destroy the contents of the Registers. 0F Rolling Display Also go through the manuals for the detailed operation of 8155, 8255 andSS : Statrting Address 8279 supporting chips.SE : End AddressdS : Destination The following is a list of scratch-pad RAM allocation to the MonitorIA : Insert Address program.DA : Delete AddressSr : Data Byte
  24. 24. 5-2 5-3 TABLE 5.1 Location (Hex) Used for Location (Hex) Used for FF9 A, B HALF BIT FFED Flags FF9 C, D, E U1 Key Jump FFEE A Register FF9 F, 0, 1 U2 Key Jump FFEF L Register FFA2, 3, 4 U3 Key Jump FFF0 H Register FFA5, 6, 7 U4 Key Jump FFF1 Interrupt Mask FFA8 P DATA FFF2 Prog. Cntr – Low Byte FFAA, B Unused FFF3 Prog. Cntr – Hi Byte FFAC, CnSave FFF4 Stack Ptr – Low Byte FFAD, E BrSave FFF5 Stack Ptr – Hi Byte FFA, F, 0 DESAVE FFF6 Current Address FB1 CARRYLOC FFF8 Current Data FFB2, 3 HESAVE FFF9-FFFC Output buffer & Temp Loc FFB4, 5 DASAVE FFFD Register Pointer FBB6, 7 IA SAVE FFFE Input Buffer FFBB, C SE SAVE FFFF 8155 command/status Register Image FFB9, A DS SAVE FFBD, E SS SAVE FFBF COPY TEST Important subroutines which can be borrowed from the Monitor FFC0, 1 BIT TIME FIRMWARE are listed below.These subroutines can be called in your FFB8 SR SAVE own programs by using the CALL Instruction and specifying the FFC2 User may place a JMP instr. to a RST 5 starting address of that particular subroutine.The starting addreses of routine in locs FFFC2H-FFFC4H all these subroutines are given in brackets along with their names. FFC5 JMP to RST 6 routine FFC8 JMP to RST 6.5 routine 1. Modiad (0362) – Modify address field of display (Hardwored user interrupt) FFCB JMP to RST 7 routine Inputs FFCE JMP to ‘VECT INTR’Key routine FFDI-FFE8 Monitor Stack B : Dot Flag- (temporary storage Used by Monitor 1 Put dot at right edge of the field. FFE9 E Register 0 No dot. FFEA D Register FFEB C Register HL : The character to be displayed.
  25. 25. 5-4 5-5The contents of HL Register pair are displayed in the address field.The 5. CLEAR (01D7)contents of all the CPU registers are affected Inputs : B : Dot falg – 2. MODIDT ( 036E ) 1 – Dot in address field 0 – No Dot Inputs B : Dot Flag- 1 : Put Dot at the right edge of the field This routines sends blank characters to both the address field and data 0 : No dot field of the display. If the dot flag is set then a Dot appears at the right edgeThe contents of the A register are displayed in hex notation in the data field of the address field.of display the contents of all the CPU registers and flags are affected. 6. GTHEX (022B) – Get Hex Digits 3. RDKBD (02E7) Inputs : B : Display Flag – Input : Nothing 0 – Use address field of display. 1 – Use data field of display. Output : A : character read from the keyboard Outputs : A : Last character read from keyboard. DE : Hex Digits from keyboard last four entered. Destroys : A, H, L, F/E’s. Carry : Set : At least one hex digit read, else it is reset. Destroys contents of all registers.This routine waits until a character is entered om the hex keypad and onreturn, places the value of the character in the A register. This routine accepts a string of hex digits from keyboard and displays them in address / data field as they are received. In either case a dot will be displayed in the right most field. It is not terminated by INR, DCR or EXECFor the RDKBD routine to work correctly, the user must unmask RST 5.5 keys, the received hex digits are invalid.hardware interrupt using the SIM instuction in Version 1. 7. OUTPUT (02B7) 4. DELAY (05F1) Inputs : A : Display Flag – 0 – To use address fieldThis routine takes the 16 bit contents of register pair and counts down 1 – Use data fieldto zero.Then returns to the calling program. The A,D & E register and flagsare affected.
  26. 26. 5-6 5-7 B : Dot Flag – Character Hex Code 1 - Dot at right edge 0 - No dot H 10 L 11 HL : Address of characters to be output. P 12Destroys all I 13 r 14Outputs two characters to data field or four to address field. The address of Blank 15the characters is received as an argument. The routines MODIDT and n 16MODIAD are useful whenever the user wants to display hexadecimal U 17information like messages. The userhas to use the output routine with the h 18following code assigned to the characters to be displayed. The display G 19technique on 7 segment LED is already explained. J 1A y 1B TABLE 5.2 O 1C Character Hex Code 5.2 SERIAL ROUTINES 0 00 1 01 The following are the routines you can borrow from the serial Monitor. 2 02 Whenever the user straps the SID to TTY ( 20 mA loop ) or CRT 3 03 (RS232C) the serial routine is invoked. The serial routine is AUTOBAUD 4 04 type i.e. on power up or RESET, the contents for HALFBIT and BITTIME 5 05 are undefined. After sending ASCII space character (20H) from a serial 6 06 device, and baud rate is calculated . A BRID routine and a sign on 7 07 message is transmitted at that baud rate. Thus user is advised to set the appropriate values in HALFBIT and BITTIME and then use CIN and 8 08 COUT routines for any other purpose of block transfer on serial link from 9 09 one system to another etc. Please refer to the chapter on serial I/O A 0A operation for details, before using any of the following routines which can b 0B be obtained from the serial monitor. C 0C d 0D E 0E F 0F
  27. 27. 5-8 5-9 1.CIN (07FD) – Console Input The following are the program examples . The user should load and execute these program to get familiar with the keyboard ofThis routine returns a character in ASCII code received from the serial MICROFRIEND DYNA-85.devices,to the A register. Condition flags are affected. 5.3 PROGRAMMING EXAMPLES 2.COUT (07FA) – Console Output Example 1 : FamiliarizatonThis routine transmit a character (in ASCII Code) passed from the program inC Register to the serial device. The A, C & F registers are affected. Let us start with a simple program to understnd exactly what happens inside a microprocessor when a program is run. 3.CROUT (05EB) – Carriage Return Line Feed First, load the following program using ‘SET’ and ‘INR’ keys.CROUT send CR and LF characters to console, A, B, C and F are destroyed. Address Data Mnemonic Comments 4.NMOUT (06C6) – Hex Number printingNMOUT converts the 8 bit unsigned integer in A register to 2 ASCII F000 31 FF FE LXI SP Define Stack Pointercharacters representing 2 hex digits and prints the two digits on console. F003 00 NOPContents of A,B, and C, F are destroyed. F004 00 NOP F005 00 NOP 5.GETHX (0626) F006 00 NOP F007 00 NOPOutputs : BC : 16 Bit Integer F008 00 NOP D : Character which terminated the integer. F009 CD 6E 03 CALL Display contents of A intoCarry : 1 – First character is not delimiter Data Field 0 – If first character is delimiter. F00C 76 HALT Stop ExecutingDestroys : A, B, C, D, E & F. Now to understand exactly how the program works, let us take threeGETHX accepts a string of hex digits from the input stream and returns a simple instructions.value, a 10 bit binary integer, taking only last four digits entered. MVI A, D8 MVI B, D8 ADD B RST 1
  28. 28. 5-10 5-11The RST 1 instruction will be used so that the register status is saved and Execute the program at F000H and examine registers A & B, thiswe can examine registers after executing the programs , using the ‘REG’ time the contents of register A are not 23 as before, but it is 34.key. This is the result of instructiona. Execute the program that has been entered at location F000H by ADD B, 80 using the ‘GO’ and ‘EXEC’ keys .‘E’ will appear in the address field Which contents of B are added to A, A become 34 (23+11). showing that the program is being executed. Press ‘RES’ to reset e. Now remove the CF from location F008 and replace it by 00 (NOP) and ‘FrlEnd’ will appear. again. Execute the program at F000H and observe the difference.b. Modify the initial contents of location , as follows : This time the data field shows 34.Instruction CALL MODIDT has F003 3E displayed the contents of register A in the data field.Execution of F004 23 program now select different sets of instruction and study the effect F005 CF of executing those instruction in the similar manner. Execute the program at F000H and examine the register A and B. In case of long programs, it is very inconvient to insert the CF and remove it for each step. Such programs can be studied by using Contents of A should be 23, because the instruction MVI A , 23 the ‘STEP’ key which is already explained. (3E 23 ) will load register A with 23. Example 2 : RDKBDc. Modify the locations again as follows : The following program illustrate the utility of the subroutine RDKBD. F005 06 Execute the following program and then examine register A . Register A F006 11 will contain the value of the key you has pressed. F007 CF Address Data Mnemonic Comments Execute the program at F000H and examine the registers A and B. F000 32 FF FE LXI SP, FEFF Define Stack Pointer F003 00 NOP Register A contain 23, and Register B will contain 11, because the F004 00 NOP instruction MVI B, 11 (06 11) has now loaded the register B with F005 00 NOP 11. F006 CD E7 02 CALL RDKBD Read Keyboard valued. Modify the location again as follows : Into A. F007 80 F009 CF RST 1 Save registers & return F008 CF to monitor
  29. 29. 5-12 5-13 Address Data Mnemonics CommentsExample 3 : MODIDT F000 31 FFFE LXI SP,FEFF Define stack pointerThis examples loads register A with a value and displays that value in the F003 00 NOPdata field of the display. F004 00 NOPAddress Data Mnemonic Comments F005 00 NOP F006 CD E702 CALL RDKBD Read Keyboard into AF000 31 FF FE LXI SP, FEFF Define stack F009 47 MOV B, A Transfer A to B Pointer F00A CD E702 CALL RDKBD Read next keyF003 3E 96 MVI A, 96 Load A with F00D 80 ADD B Add B to A Value 96 F00E CD 6E03 CALL MODIDT Display result in dataF005 CD 6E 03 CALL MODIDT Display contents fieldF008 76 HLT of A in the data F001 C3 06F0 JMP F006 Wait for Next cycle field Addition Suggestions :Example 4 : RDKBD + MODIDT 1. Modify this program using the DAA instruction to perform decimalThis example combines previous two programs and the Data field of display addition.the value of the key pressed. 2. Write a program for 2 digit decimal addition using DAA and RLC instructions.Address Data Mnemonics Comments Example 6 : 4 DIGIT HEX COUNTERF000 31 FFFE LXI, SP FEFF Define stack pointer This example program displays a 4 digit Hex count in the address field ofF003 00 NOP Unmak interrupt the display, from 000 to FFFF and again resets to 0000 before continuingF004 00 NOP further count. The HL register pair is used for counting and the MODIDTF005 00 NOP subroutine is used to obtain the display.F006 CD E702 CALL RKBD Read keyboard Into A Address Data Mnemonic CommentsF009 CD 6E03 CALL MODIDT Display A into data field F000 31 FFFE LXI SP,FEFF Define stack pointerF00C C3 06F0 JMP F006 Wait for next key F003 21 0000 LXI H, PUSH H Save HL on stack F007 CD 6203 CALL MODIAD Display count inExample 5 : HEX ADDITION address fieldThis program combines the RDKBD and MODIDT subroutines with the ADD F00A 11 0040 LXI D 4000 Set DelayB instruction.The RDLBD subroutine reads two successive key entries and F00D CD F105 CALL DELAY Wait out Delayadds them together in register A. The MODIDT subroutines then displays F010 EI POP H Restore HLthe result of this addition in the data field of the display. F011 23 INX H Increment count F012 C3 06F0 JMP F006 Continue in loop
  30. 30. 5-14 5-15Example 7 : 2 DIGIT DECIMAL COUNTER This program executedas GO F000 EXEC, and it can be stopped byThis program displays s decimal counter in the data field of display. The pressing the VI key.count can be stopped using the VI key and restarted by pressing any key,except the Reset key. The address field shows ‘E’ to indicate that user The count can be restarted by pressing any key other than Reset key.program is being executed.Address Data Mnemonics Comments 1. Change the speed of counter by modifying the contents of location F011H which decides the delay.F000 31 FFFE LXI SP,FEFF Define stack Pointer 2. Use the CPI instruction to compare the count with 60, & a conditionalF003 3E IB MVI A, IB Load A with 1B jump JNZ, converts this program to count only upto 59.Use the XRAF005 30 SIM Set interrupt mask instruction to reset the accumulator to 00 after counting upto 59.F006 FB EI Enable InterruptF007 06 00 MVI B, 00 Clear B Now set the delay in such a way that count advances by 1 perF009 78 MOV A, B Load A from B second . This program coverts your MICROFRIEND DYNA – 85 intoF00A 27 DAA Decimal adjust A digital stop watch.F00B 47 MOV B, A Load B from A 3. Write a program based on these basic ideas to display hours and minutes in the address field and seconds in the data field. You canF00C C5 PUSH B Save B on stack either have a 12 hour or 24 hour clock.F00D CD 6E03 CALL MODIDT Display countF010 16 18 MVI D, 18 Set Delay Example 8 : FLASHING DISPLAY ‘LErn’F012 CD F105 CALL DELAY Wait out delayF015 C1 POP B Restore count This program flashes the message ‘Lern’ in the address field of theF016 04 INR B Increment count dispay.F017 C3 09F0 JMP F009 ContinueF020 3E 1F MVI A, 1F Load A with 1 F Adderss Data Mnemonic CommentsF022 30 SIM Set interrupt maskF023 CD E702 CALL RDKBD Wait for a key to be F000 11 L Pressed F001 0E EF026 3E 1B MVI A, 1B Load a with 1B F002 14 rF028 30 SIM Set interrupt mask F003 16 nF029 FB EI Enable Interrupt F004 15 blankF02A C9 RET Return F005 15 blankFFCE C3 20F0 JMP F020 Jump to interrupt routine F006 15 blank
  31. 31. 5-16 5-17Address Data Mnemonics Comments Example 9 : ROLLING DISPLAYF010 31 FFFE LXI SP, FEFF Define stack pointer This program is included in the monitor FIRMWARE and it is accessibleF013 3E 01 MVI A, 01 Load A with 1 to use through code ‘0F’. On executing this code the display starts showing the Data field. rolling message “dYnALOG hELPS YoU In LEArning UP”.F015 06 00 MVI B, 00 No decimal pointF017 21 06F0 LXI, H F006 Get characters starting The rolling display is using the OUTPUT and DELAY subroutines. To at F006H simulate the effect of rolling, characters are taken one from a string ofF01A CD B702 CALL OUTPUT Display them in data characters and the position is shifted from right to left. fieldF01D 3E 00 MVI A, 00 Use address field When the first letter appears in the highermost position, remaining 5 digitsF01F 06 00 MVI B, 00 No Decimal point must be blank.F021 21 00F0 LXI H, F000 Get characters starting at F000 This string starts with 5 blank characters. The last character in the string isF024 CD B702 CALL OUTPUT Display them in address FFH, which is not used to display any letter but it is used only to detect the Field end of string , so that the rolling can once again start from the beginningF027 11 FFFF LXI D,FFFF Set Delay using a conditional jump instruction.F02A CD F105 CALL DELAY Wait out delayF02D 3E 00 MVI A, 00 The complete listing of this program is given in the FIRMWARE listing atF02F 06 00 MVI B, 00 address 0E5BH.F031 21 04F0 LXI H F004 Get blankF034 CD B702 CALL OUTPUT Blank display Transfer this program from EPROM to RAM using CODE 00. Then modifyF037 11 FFFF LXI D, FFFF all the address locations suitably so that the same program can beF03A CD F105 CALL DELAY executed form RAM.F03D C3 1DF0 JMP F01D Continue Flashing Now you can put any other message in the string and display thatAdditional Suggestion : message.1. Find out the location where the delay values are sorted. Change these delay values to change the rate of flashing.2. Select any other 4 character word and flash it on the display.3. Select a 2 character word and place it at F004H and F005H so that it flashes in between the flashing of 4 character word.
  32. 32. 6-1CHAPTER 6SERIAL I / O OPERATIONIn the serial I / O section we will discuss about the RS232Ã and AudioCassette Interface. Apart from the Keyboard Mode, the serial Mode can beselected with appropriate strapping. In the keyboard mode user cancommunicate with the system only in hexadecimal format . The serialmode is provided for the better interaction mode of communication usinga terminal. Normally the mode of cmmunation is ASCII ( AmericanStandard Code for Information Interchange).To Correct MICROFRIEND with a terminal strap SID, the appropriatesignals are provided 7 pin cable type connect . After appropriatelyconnecting the terminal the standard Baud Rate is 110 with two stop bits.When the system is powered on the in - built displays show SERIAL. Thisroutine expects a space character (20H in ASCII) from the terninal. Thesystem is claimed to be AUTO BAUD, that is after sensing the spacecharacter from the terminal it will adjust to the appropriate Baud Rate andhence forth communicate with this Baud Rate, until the next power ON orthe Reset key is pressed, the Baud Rate is unchanged.Thus on power ON or Reset you press a space bar on TTY and sign onmessage MICROFRIEND DYNA – 85 appears on the console . Theprocedure is similsr for CRT type of terminals where the communicationmode is RS232C. RS232C is a EIA approved standard for communation.For an active signal the channel will give -12V signal and for the inactivesignal the voltage will be +12V. This is to keep the long communicationline immune to noise and to connect a CRT terminal on RS232C link,strap the SID line to CRT. The communication format is fully duplex, 8 bitASCII data , no parity start bit and two stop bits. Full Duplex means thatwhatever character received from the terminal is echoed back.