680551 mikrodenetçisi için sistem geliştirme kiti ve geliştirme paketi
- Global styles
- Apa
- Bibtex
- Chicago Fullnote
- Help
Abstract
ÖZET Bu tez çalışmasında bir editör, bir birleştirici ve bir emülatörden oluşan bir program paketi hazırlanmıştır. Bu program paketiyle, 6805S1 mikrobilgisayarında yürütülecek simgesel dil programlarının yazılması ve düzeltilmesi, birleştirilmesi ve ayıklama işlemine uygun bir ortamda koşturulması veya adım adım yürütülebilmesi amaçlanmıştır. `VerYap` adlı birimde paketin veri yapısı ve paket içinde çeşitli yerlerde kullanılan altprogramlar yer almıştır. `AltProg` adlı birimde birleştiricinin kullandığı bazı altprogramlar bulunmaktadır. Bunlar, dosyadan ana belleğe yüklenen programın ana bellekte içinde bulunduğu liste yapısını kuran, programda geçen komutların, tiplendirilmiş sabit tanımlama bölümünde ilk değerleri atanmış komut dizisinin kaçıncı elemanı olduğunu ikili arama yöntemiyle (binary search) bulan ve test edilip hata varsa uygun mesajı veren, yoksa kullanılan adresleme yöntemine göre program sayacının değerini artıran al t programlar d ir. `Edt` adlı birimde editörün kullandığı tuş program lanan ve klavyeden okuma yapan altprogram bulunmaktadır. Bu altprogram çağrıldığında klavyede basılan tuş bir kontrol karakterine aitse ve bir iş için programlanmışsa o işi yapmakta, tuş ekranda değilse karakter ekrana basılmakta veya karakter kullanılan karakter kümesinin dışındaysa o zaman klavyeden yeni bir giriş yapılana kadar beklenmektedir. `Emül` adlı birim emülatörün kullandığı altprogramları ve veri yapısının bir bölümünü kapsamaktadır. `Birleş` adlı birimde birleştiricinin ana programı bulunmaktadır. Bu programın içinde birinci geçişi ve ikinci geçişi gerçekleştiren iki ayrı altprogram vardır. `Emulator` adlı birimde, emülatörün ana programı yer almıştır. iv SUMMARY A DEVELOPMENT KIT AND A SOFTWARE PACKET FOR 6805 In this project, a software packet consisting of an editor, an assembler and an emulator has been performed. The goal of this project is to design and implement a software packet which provides an environment in which the user is able to create, write edit, assemble, debug, trace, run and whenever ready download programs in the assembly language of 6805S1 microcomputer. This packet consists of three main parts. These are the editor, the assembler and the emulator. These parts are all written with version 4. 0 of Turbo Pascal and contained in six user-defined units and one program. The units and the program also takes advantage of some standard units built in the Turbo Pascal's unit library. One of the user-defined units called `VerYap`, con tains the data structure of the packet and some proce dures frequently used inside the packet. Another user-defined unit is known as `Alt` and this unit consists of procedures and functions which are used in the assembler part of the software packet. One of these procedures called `CreateLinkedList`, is used to build the linked list structure which holds the program to be assembled. Since reading a program from a hard disc or disc driver (secondary storage devices) and accessing them whenever necessary takes much more time than accessing them in main memory, allocating some memory space with the program and speeding up the process ie thought to be better when considering the trade-off between the time loss and the memory space loss. Thecause that adynamic structure is preferred to store the program in is that programs would be of very different sizes and the size of a static structure's size would be too large or small to store a program. All informa tion used in one program line is put in one node oi the linked list. Another procedure in that unit is called `BinSrch`. This procedure, using the array in which the mnemonics of the 6805S1 assembler are to be found, performs a binary search and finds out the index of the array in which the current mnemonic is contained. In that unit, there exists also a function known as `InstrBytes` which checks the program for any syntax er ror and if any found then it gives the corresponding er ror message and returns to main menu. Otherwise it increments the program counter by the corresponding value, considering the opcode and the addressing mode used. In another unit called `Edit` there exists the proce dure `Readlnput` which, in the editor program, reads the input from the keyboard and processes the screen and ar ray of character type which holds the editor program, ac cordingly. If the key pressed inputs a control character then it performs whatever this key is programmed to do. If the key pressed inputs an acceptable character (the decision whether or not a character is acceptable is done by using a character set) then it displays this character on the screen and puts it in the array. If an unaccep table character is input the program waits until an ac ceptable one is entered. When returned from this proce dure the editor program is saved either with the changes or the changes are ignored according to the key used to get off the editor. The unit `Emul` contains a part of the data structure and the procedures and functions of the emulator. Functions of some of these procrdures and functions are to convert a decimal number into a character string representing a hexadecimal number, to convert a string representing a number in hexadecimal number system into a decimal number, to update registers after an instruction has been executed. One procedure among these is of great importance for the emulator program. This procedure is called `Trace` and it is the part of the emulator which performs the emulation of 6805S1 microcomputer for each instruction code. The assembler is to be found in the user-defined unit `Birleş`. The main body of the assembler is contained in the procedure `Cross_AsBembler`. VIThie procedure has two other procedures in it. These procedures perforin the first pass and the second pass of the essetnbler. The procedure performing the first pass, creates a dynamic structure for the labels using `Rehashing` strategy and puts the labels one by one at corresponding places in this structure. Afterwards it calİB the func tion which looks for a syntax error in the program. If an error is found an error message is displayed on the is no error then the program counter is incremented by the corresponding value. After the first pass, if no error is found, the second pass begins. The first process performed in this proce dure is to check whether or not each operand not found in the structure of the labels in the first pass, exists among the labels. If one of them still does not exist then it gives an error message and turns back to the editor. Otherwise it prepares the machine codes of the source program and saves these in two files. In one of them the codes for the directives are stored and in the other file the machine codes for the instructions are stored. The assembler uses the procedures and functions in the unit `Alt` when performing all these tasks. Emulator is to be found in the emulator unit. This program making a decision by the input from the screen, is able to trace, handle memory, change and observe registers, run a program written in 6805S1 assembly lan guage, using the output files of the assembler as input files. Another ability of this program is downloading the machine code to the 6805S1 microcomputer. Using this software packet, one is able to develop any kind of special purpose software which in order to be used in MC6805 family of microcomputers or in MC146805- based microcomputer systems, locate in en on-chip ROM or in an EPROM respectively. After the object code of a syntax-error-free assembly language program is produced, the problem whether or not this software packet is going to accomplish its goal comes in question. At this point, the software packet provides the tes tability of this software without needing use of a system development kit as long as no additional hardware is in volved. The restriction to additional hardware usage besides softwares which are to be tested by the software packet results in making the designer think of designing and im plementing a MC146805-based system development kit. viiThus, in the last part of the project, an MC146805- based microcomputer system which is able to replace most members of the MC6805 microprocessor family, is designed and implemented. By way of its asynchronous serial communication in terface adapter this system is able to communicate with a PC. So, whenever neccessary ( i.e. whenever a software which requires some additional hardware is to be executed ), the software is assembled and the object code of it is downloaded and it is executed after the hardware necces sary is added to the system. This MC146805E2P-based microcomputer system contains the follwing chips. 1- MC146805E2P ( microprocessor ) 2- MC2716 ( 2 Kbytes x 8 EPROM ) 3- Two MC6116 < 2 KBytes x 8 RAM ) 4- KC6821 ( PIA ) 5- R6551 ( ACIA ) 6- 74LS373 < Latch ) 7- MC14028 ( 3 To 8 Decoder ) 8- 74LS139 ( 3 To 8 Decoder ) 9- Six 74LS164 ( Serial-In Parallel-Out Shift Register > 10-Two 74LS00 ( Ouad 2-Input NAND Gate ) 11-Two 74LS05 ( Hex Inverter with Open Collector Output ) 12-MC1488 ( Line Driver for Modem/Terminal Applications ) 13-MC14B9 ( Line Receiver for Modem/Terminal Applications ) 14-six HDSP5303 ( Seven Segment Display ) The hardware design and implementation of the microcomputer system is performed so that the monitor program CBUG05 which is located in EPROM MC2716 is able to function correctly on the system. The keyboard of the microcomputer system contains 24 keys < There is also a RESET key which is not included in the keyboard. The keys are so designed that they form a 6 x 4 matrice. In the lefthand side of the keyboard stand the keys for the digits of the hexadecimal system ( 0..9, A..F ) The keys standing in the righthand side of the keyboard are used to carry out some functions of the monitor program. Enter Key : This key stands in the first row on the lefthand side. After a hexadecimal digit is typed or after a function key is typed this key should be pressed in order that this key performs his function. viii% StBck Pointer Key : This key stands at the top on the righthand Bide. This key is used to see where the stack pointer points to. Memory Key : This key is to be found at the top second row on the righthand side. If this key is pressed immediately after the system power-on in the address part of the six digitdisplay `0000` is to observe. If it is pressed after a process is accomplished in the memory, then the last processed memory address can be observed. At this point any memory location is accessible by typing the address of it using the digit keys on the lefthand side. If the address typed in is not valid then the `Err` message is to ob serve at the display. If valid, then the information in the memory location can be seen by typing the Enter key at the top on the lefthand side. To change the informa tion the digit keys can be typed at this point. GO Key : This key stands at the bottom second row on the righ thand side. Pressing the key the address of the first memory location of the program to run is typed using the digit keys. Afterwards the Enter key is pressed and the program executes. At the end of the execution the address in the program counter is observed at the display. In order the program to end correctly the code of the software inter rupt instruction ( SWI ) should be written as the last instruction of the program. Cancel Key Cancel key stands at the bottom first row on the righthand side. After having pressed this key system prompt appears at first left display digit. IXMemory Key : This key is to be found at the top second row on the righthand side. If this key is pressed immediately after the system power-on in the address part of the six digitdisplay `0000` is to observe. If it is pressed after a process is accomplished in the memory, then the last processed memory address can be observed. At this point any memory location is accessible by typing the address of it using the digit keys on the lefthand side. If the address typed in is not valid then the `Err` message is to ob serve at the display. If valid, then the information in the memory location can be seen by typing the Enter key at the top on the lefthand side. To change the informa tion the digit keys can be typed at this point. GO Key : This key stands at the bottom second row on the righ thand side. Pressing the key the address of the first memory location of the program to run is typed using the digit keys. Afterwards the Enter key is pressed and the program executes. At the end of the execution the address in the program counter is observed at the display. In order the program to end correctly the code of the software inter rupt instruction ( SWI ) should be written as the last instruction of the program. Cancel Key Cancel key stands at the bottom first row on the righthand side. After having pressed this key system prompt appears at first left display digit.
Collections