Part Number Hot Search : 
40109 G2305 00140 9GL25 LTC1545C 1053QA5 P31430 TECB60A
Product Description
Full Text Search
 

To Download DEBUG186 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  9/11/95 page 1 debugging an am186em application on the sd186em demonstration board using microsoft?s c/c++ compiler and paradigm debug software my tran advanced micro devices, inc. overview this application note provides users with step-by-step instructions for building and debugging an am186em application program using microsoft?s c/c++ compiler with paradigm debug software. to debug an embedded program, the debugger must be able to communicate with the monitor on the target board. the sd186em board comes with the e86mon monitor. however, this monitor was not intended to function with the paradigm debug software; therefore, the paradigm remote rom monitor (pdrem) must be built and downloaded to the board before a debugging process can take place. the user needs to install the following tools on his/her pc (pc386 or better, with at least 4 mbyte of memory) in order to build and debug an am186em application using the microsoft c/c++ compiler with the paradigm debug software: - microsoft c/c++ compiler, version 1.5 1 - microsoft assembler, version 6.1 - paradigm locate, version 5.0 - paradigm pdrem, version 4.02 - paradigm debug/rt-186, version 4.0 - amd sd186em demonstration board the process of debugging an am186em application involves two basic steps: (1) building paradigm remote rom monitor (pdrem) and downloading it to the board; (2) building and debugging an am186em application program. other tools and utilities are important factors in building an embedded application; thus, this document is divided into five sections: 1. installing paradigm software 2. building and downloading pdrem 3. building an am186em application 4. optimizing the application program 5. building an am186em standalone program before installing the paradigm software, please review the section installing paradigm software below for specific information. this document assumes the software is installed on c:\ xxx , where xxx is the directory where the software resides. as such, the directory names used throughout this document have the following meanings: c:\msvc - microsoft c/c++ compiler directory c:\masm_61 - microsoft assembler directory c:\locate - paradigm locate directory c:\pdrem - paradigm pdrem directory c:\pd - paradigm debug/rt-186 directory if the user installs his/her software in a different directory or disk drive, please replace the string c:\xxx with the correct path names. 1 paradigm debug software supports different compilers from different vendors
9/11/95 page 2 installing paradigm software microsoft?s c/c++ compiler and assembler should be installed before installing the paradigm software. the paradigm software discussed in this document includes: paradigm locate, paradigm pdrem, and paradigm debug/rt-186. this software is distributed by paradigm systems. to obtain a copy of any of these, please contact paradigm systems at 1-800-582-0864. throughout this document, the terms ?paradigm debug/rt-186? and ?paradigm debug/rt? are used interchangeably. this section provides specific information for installing paradigm software to run on the sd186em board. users should follow the installation instructions of the appropriate manuals distributed by paradigm systems when installing paradigm software. 1. installing paradigm locate : paradigm locate serves as the locator. it takes input from a relocatable .exe file produced by the compiler/linker, and assigns memory addresses defined in the .cfg file to produce an absolute executable file (.axe) suitable for the embedded design. since it is the basic building block of the paradigm tools, it should be the first paradigm product to be installed. the paradigm locate installation program invokes microsoft?s c/c++ compiler to build the romable runtime libraries. be sure to include the bin directory of the microsoft compiler in the environment variable path (i.e., c:\msvc\bin) before installing paradigm locate. during the installation process, the user will be asked to choose a directory for the romable runtime libraries. the libraries in this directory will be searched during link time to build a rom object file. for this reason, the extension file produced by the compiler/linker is sometimes called .rom (versus .exe). paradigm locate accepts object files with the extension of either .rom or .exe (see figure 1). it is a good idea to include the directory of the romable libraries in the environment variable lib after the installation. for example, if the romable libraries are in the directory c:\msvc , then the environment variable lib should contain the string c:\msvc\lib . to run paradigm locate from a microsoft window?s dos box, insert the following line in the [386enh] section of the file c:\windows\system.ini . note: the windpmi.386 driver is not installed until the user exits, and re-enters windows. device=c:\locate\windpmi.386
9/11/95 page 3 figure 1 - debugging an am186em application program 2. installing paradigm pdrem : the installation program needs to know something about the software and hardware environment to retrieve correct source code for building pdrem. when installing pdrem, be sure to set the following parameters as indicated: - target processor: amd am186em - target math coprocessor: none - target uart: am186em/internal - system compiler: microsoft c/c++ 8.0 2 when the installation is finished, source files needed for building pdrem files for the sd186em board are copied to the hard drive. ?building and downloading pdrem? shows how to build the pdrem monitor and download it to the target board. 3. installing paradigm debug/rt-186 : the paradigm debug/rt-186 installation program will request information such as the serial communication port and baud rate. the specified baud rate defines the communication channel between paradigm debug/rt-186 ( pdrt186) and pdrem. though the e86mon which resides on the sd186em board is programmed to communicate with the host at the baud rate of 19200, pdrt186 may not communicate with the target at this baud rate; rather it communicates with the target at the baud rate defined in the dcomms.c file in the pdrem directory. make sure the baud rate being entered here matches the one defined in dcomms.c . figure 2 - setting the baud rate in the pdrem\dcomms.c file in general, the pdrem file ( pdrem.hex ) is downloaded to the board at a baud rate of 19200. afterward, the communication between paradigm debug/rt and the target is defined by pdrem, not by e86mon. the default baud rate defined in the dcomms.c file is 115200 . to change pdrem?s baud rate, simply change this number to a valid baud rate and rebuild pdrem. figure 2 shows a portion of the dcomms.c file; the line defining the baud rate is shown in boldface. 4. setting the path: after the paradigm software is installed, the user should set the path environment variable to include the directories of paradigm locate, paradigm debug/rt, and the bin directory of the microsoft c/c++ compiler and assembler. for instance, if paradigm locate is installed in the directory c:\locate , paradigm debug/rt is installed in the directory c:\pd , the microsoft c/c++ compiler is installed in the directory c:\msvc , and the microsoft assembler is installed in the directory c:\masm_61 , then the path environment variable should contain the string: 2 microsoft?s c compiler version 8.0 is the same as microsoft?s visual c++ version 1.5 ...... /* select xtal frequency and desired baud rate */ #define clk 40000000ul /* x1/x2 crystal input frequency */ #define baud 115200ul /* desired baud rate */ #define iob186em 0xff00 /* location of pcb */ #include /* enable/disable functions */ #include ?typedef.h? /* common definition and prototypes */ #include ?target.h? /* target system specific information */ #include ?helpers.h? /* pdremote/rom helper functions */ ......
9/11/95 page 4 c:\locate;c:\pd;c:\msvc\bin;c:\masm_61\bin building and downloading pdrem after installing the paradigm software, the user is ready to build and download the pdrem monitor to the sd186em board. figure 3 shows the process of building and downloading pdrem. figure 3 - building and downloading pdrem 1. building pdrem: building pdrem involves the following steps: ?cd? to pdrem directory (i.e., cd c:\pdrem ). edit the target.h file as shown in figure 4. edit the pdrem.cfg file as shown in figure 5. run nmake or nmaker (real-mode nmake). figure 4 - defining i/o interrupt vector building pdrem is mostly taken care of by the makefile created by the pdrem installation program. the makefile performs the necessary steps to produce the rom pdrem file called ....... #if 0 /* disabled: include if pdremote/rom ui is use d */ #include "kernel.h" /* application interface extensions */ #endif #if 1 /* 0 = no, 1=yes define if interrupt-driven serial i/o */ #define commint 0x14 /* change to desired interrupt vector */ #endif ........ change these 2 lines to enable i/o
9/11/95 page 5 pdrem.hex . however, before invoking nmake (or nmaker ), the user needs to be aware of the following items: though pdrem supports a virtual uart interface that the application can use to communicate with the remote console window of the paradigm debug/rt, the target.h file in the pdrem directory does not have the serial i/o interrupt vector set. to be able to send the string from a printf() statement of a c program to the remote console window, the user needs to change two lines of code in the target.h file as shown in figure 4. the information that needs to be changed is shown in boldface. figure 5 - pdrem.cfg file for sd186em board // // paradigm locate configuration file for building the pdremote/rom kernel. // copyright (c) 1993 paradigm systems. all rights reserved. // hexfile intel86 // intel hex output listfile segments // create a segment map map 0x00000 to 0x003ff as reserved // interrupt vector table map 0x00400 to 0x00fff as rdwr // pdremote/rom data area map 0x01000 to 0xdffff as reserved // reserved for applications map 0xe0000 to 0xfffff as rdonly // pdremote/rom kernel eprom cputype am186em // select the processor type initcode inbyte 0x1000 // inbyte is here to create ??locate class // chip select initialization not necessary (flash utility sets up // chip selects). however, there is a memory limitation on how many // initcode parameters can be used at address 0xf7ff0 (will run into // flash downloader). since the flash downloader will jump to address // 0xf7ff0, the initcode is used here to serve as a jump to pdremote's // code. the class, ??locate, will contain the jump automatically. // // umcs = 0xfe38 \ // lmcs = 0x0ff8 \ // mpcs = 0x80bf \ // pacs = 0x003f \ dup data romdata // make a copy of the initialized data class code = 0xe000 // modify to set the eprom address class data = 0x0040 // and the ram address class ?? locate = 0xf7ff // initialization code order data \ // fix the class ordering const \ bss bssend \ stack order code \ // code, initialized data in eprom romdata endromdata output code \ // write to the output file romdata endromdata \ ??locate these are commented out, e86mon has already set these up before jumping to pdrem
9/11/95 page 6 the pdrem.cfg file created by the installation is not customized for the sd186em board. the correct configuration for the sd186em board is shown in figure 5. the information that needs to be changed is shown in boldface. use nmaker (real-mode nmake) instead nmake to run the makefile in a microsoft windows dos box to avoid possible conflict between nmake and locate . the readme.txt file in the c:\locate directory explains this conflict in more detail. after nmake (or nmaker ) finishes, the rom file pdrem.hex in the pdrem directory is created and is ready to be downloaded to the sd186em board. 2. downloading pdrem to the sd186em board: the purpose of downloading pdrem to the sd186em board is to create a high level source and data debugging environment for the paradigm debug/rt. the pdrem file ( pdrem.hex ) can be downloaded to the target by any communication program, provided that the protocols are set up correctly. this section shows how to download the pdrem monitor to the target board using the windows terminal program available in microsoft windows. the process involves the following steps: a) invoke the terminal program by selecting the accessories icon from the program manager window; then double click on the terminal icon. b) when the terminal program starts up, click settings | communications to set the communication protocol as shown in figure 6a; where com2 displayed in connector should be replaced by the serial port which connects the sd186em board to the pc, then hit ok . as mentioned in the previous section, the baud rate defined on the target system at this point is controlled by e86mon and is programmed at 19200 (pdrem has not been downloaded yet). c) push the reset button on the board, the leds should flash off and on. press 3 on the keyboard to signal e86mon to begin operation. once communication is established, the e86 : prompt will appear on the screen. d) click settings|text transfer from the terminal program, and set the handshaking protocol as shown in figure 6b, then click ok . e) from the terminal program, type a p< cr > at the e86 : prompt to tell the monitor to receive a hex file and program it into the flash memory. the message ?begin file transfer...? appears on the screen. f) click transfer|send textfile... from the terminal program. as soon as the selection is made, a window with a list of file names pops up, select the pdrem.hex file in the pdrem directory. when the user clicks the ok button, e86mon starts programming the flash memory using data in the pdrem.hex file. during this time, the leds on the board flash randomly, and the terminal program reports the status of the process on the screen. 3 press ctrl key and break[pause] key at the same time.
9/11/95 page 7 g) wait until the e86: prompt shows up on the screen again, then reset the target, and wait for several more seconds before invoking paradigm debug/rt. figure 6a - setting communication protocol figure 6b - setting handshaking protocol the board is now ready to communicate with paradigm debug/rt pdrt186 . once pdrem is downloaded and programmed, it stays in the flash memory. unless there are changes in pdrem?s source file, or somehow the pdrem on the target board is contaminated, there is no need to download pdrem again regardless of how often the application program is compiled, loaded, and executed. building and debugging an am186em program is discussed in the next section. building an am186em application program the process of building and debugging an am186em application program is demonstrated in figure 1 on page 2; it is similar to the process of building the pdrem file. the source files are compiled and linked by microsoft tools to produce a rom relocatable object file (.rom). paradigm locate takes information defined in the .cfg file, and assigns code and data addresses to the .rom file to produce an absolute executable file (.axe). the .axe file is then loaded and debugged using paradigm debug/rt pdrt186 . besides building the romable runtime libraries as mentioned in the previous section, the paradigm locate installation program also installs other utilities needed for building an embedded program, such as startup code, library helpers, as well as examples showing how to build various application programs. each example has a readme.txt file containing useful information. the example directories are placed in the directory c:\locate\msc80\examples . unfortunately, these examples were configured to run on an in-circuit emulator. this section shows how to make the demo program in the examples directory work with the sd186em board. it is divided to four parts: 1. building the demo program 2. invoking paradigm debug/rt 3. a look at the makefile 4. running the standard i/o program - stdio.c 1. building the demo program: replace com2 with correct serial port
9/11/95 page 8 the demo program is located in the c:\locate\msc80\examples\demo directory, the name of the demo program is sieve.c . building the demo program to run on the sd186em board involves the following steps: ?cd? to the demo directory (i.e. cd \locate\msc80\examples\demo ). change the sieve.cfg configuration file as shown in figure 8. run nmake or nmaker (real-mode nmake). figure 7a - ram figure 7b - rom (flash) changing the configuration file : the configuration file is the place where target-specific information such as memory configuration is defined. figures 7a and 7b demonstrate the memory configuration for executing the sieve.c program. figure 8 shows the memory configuration file sieve.cfg based on the memory models shown in figures 7a and 7b. this file has been modified from the original version. the lines shown in boldface in figure 8 indicate information that has been changed. among the changes are: line 15: this line maps memory addresses 0x0 to 0xfff as reserved. this memory location contains interrupt vector table and pdrem kernel data. line 16: this line maps 24 kbyte of ram memory ranging from 0x1fff to 0x6fff to be rdonly (read only). it is used for storing the code section of the application. if the code section of the application program is bigger than 24 kbyte, the user should adjust the size of the region. the length of each segment of class code is listed in the .map file (generated by the compiler), or .loc file (generated by paradigm locate). the exact size of the code section can be obtained by tallying the lengths of the segments belong to class code. line 17: this line maps 24 kbyte of ram memory ranging from 0x7000 to 0xcfff to be readable and writeable (rdwr) for storing the data section of the application. if the data section is bigger than 24 kbyte, the user should adjust the size of this region. the length of each segment of class data is listed in the .map file (generated by the compiler), or .loc file (generated by paradigm locate). the exact size of the data section can be obtained by tallying the lengths of the segments belonging to class data.
9/11/95 page 9 line 18: this line maps memory addresses from 0x0d000 to 0xdffff as reserved. most memory space in this region is unused, protected (e86mon utility), or non-existant on the sd186em board. paradigm debug/rt will catch the error if an application program attempts to access the addresses defined as reserved. line 19: this line defines the pdrem and e86mon memory regions as read-only. as defined in the pdrem.cfg file, pdrem starts at address 0xe0000. figure 8 - sieve.cfg file for sd186em board lines 21 to 23 are commented out because the chip select registers have been set by the e86mon utility. 1 // 2 // configuration file for the microsoft c/c++ example from 3 // the paradigm locate manual. this is about as basic 4 // as an embedded application can get. check out the 5 // other examples for more sophisticated applications. 6 // 7 hexfile intel86 // intel extended hex for eproms 8 absfile axe86 // optional paradigm debug support 9 listfile segments // segment map for documentation 10 // 11 // define how the target system address space is 12 // partitioned. paradigm locate will check that this 13 // mapping is followed. 14 // 15 map 0x00000 to 0x00fff as reserved // pdremote and interrupt vector table 16 map 0x01000 to 0x06fff as rdonly // 24k bytes of code 17 map 0x07000 to 0x0cfff as rdwr // 24k bytes of data 18 map 0x0d000 to 0xdffff as reserved // inaccessible memory 19 map 0xe0000 to 0xfffff as rdonly // rom - eprem starts at 0xe000 20 cputype i80c186ea // target cpu is defined here 21 // initcode reset \ // reset vector 22 // umcs = 0xf838 \ // 32kb eprom 23 // lmcs = 0x0ff8 // 64kb ram 24 dup data romdata // dup initialized data 25 dup const romdata 26 dup msg romdata 27 class code = 0x0100 // code at 1000h 28 class data = 0x0700 // data at 7000h 29 // class ??locate = 0xfff0 // 80c186ea chip select code 30 order d ata const msg \ // ram class organization 31 bss \ 32 stack 33 order code \ // eprom class organization 34 romdata endromdata \ 35 output code \ // classes containing code/data 36 romdata endromdata \ 37 // ??locate
9/11/95 page 10 line 27 indicates that the code section starts at segment 0x100 (or at address 0x1000 4 ) as indicated in the map statement on line 16. line 28 indicates that the data section starts at segment 0x700 (or at address 0x7000 4 ) as indicated in the map statement on line 17. lines 29 and 37 are commented out because there is no code for chip select. running nmake or nmaker : to build the absolute executable file, simply invoke nmake from the demo directory (make sure the environment variable lib contains the directory of the run-time romable libraries as described in the section ?installing paradigm locate?). when nmake finishes, the absolute executable file sieve.axe is created and is ready for debugging. note: use nmaker instead of nmake in a microsoft windows dos box to avoid possible conflict between nmake and locate . though microsoft visual workbench (vwb) included in the microsoft c/c++ compiler is a powerful tool, it is incompatible for use in embedded applications. vwb does not support microsoft assembler masm directly, and it always assumes that the user wants to create a pc-type application. the user must take care of the extra steps such as including rom startup code and run-time libraries in a makefile. once the makefile is generated, it seems easier to invoke nmake from a dos shell rather than trying to include the external makefile in the vwb environment. page 118 of the paradigm locate reference manual explains in detail how to include an external makefile from the vwb environment. 2. invoking paradigm debug/rt - pdrt186 : pdrt186 to invoke paradigm debug/rt, and load the demo program from the command line, simply invoke the ? pdrt186 sieve ? command from a dos shell. the serial communication information such as the communication port and baud rate is defined in the pdrt186.ini file, which was created when paradigm debug/rt was installed. the baud rate defined in this file must match the baud rate defined in the dcomms.c file in the pdrem directory. information in the pdrt186.ini file can be changed at anytime; it resides in the paradigm debug/rt c:\pd directory. 3. a look at the makefile the makefile included in the demo directory is ready to build the sieve.c program. a closer look at the makefile reveals that there are two other files that are compiled and linked with the demo program to produce a romable object file; the files are: msc80.asm , and cinit.asm . these are two of the five startup files being distributed with the paradigm locate software. startup code takes care of necessary steps from the time the target is reset to the time the application program is executed. the source code of the startup files resides in the c:\locate\msc80 directory. startup code, if used, should always be linked first. the sieve.c demo program is a simple program, more sophisticated programs are demonstrated in other sub-directories of the examples directory. these programs are not only linked with the startup code, they are also linked with romable run-time library helpers. the sources of the library helpers reside in the c:\locate\msc80\helpers directory. library helpers define variables/symbols and interrupt handlers needed by the romable run-time libraries. when compiling the application program, if the linker generates some ?undefined symbols? messages, chances are those unfamiliar symbols are 4 physical address is calculated by shifting the segment value left 4 bits and adding the 16-bit offset value to yield a 20-bit physical address. the value of the 16-bit offset is 0 in this case.
9/11/95 page 11 defined in one of the library helper files. the user may want to search for the symbols in the library helper files to find the correct helpers to be included in the makefile. the paradigm locate reference manual explains the functions of these files in detail. the user should make use of the makefiles and configuration files in the examples sub-directories. the readme.txt file in each directory explains the purpose and features of each example. 4. running the standard i/o program - stdio.c an example program demonstrating the paradigm debug/rt?s ability to handle standard i/o is distributed in the paradigm locate software. this example is located in the c:\locate\msc80\examples\stdio directory, and the name of the program is stdio.c . building the stdio.c program to run on the sd186em board involves the following steps: ?cd? to the stdio directory (i.e., cd \locate\msc80\examples\stdio ). change the configuration file. change the value of the debug variable in the makefile to 2. run nmake or nmaker . there are two configuration files in the stdio directory, they are: stdio.rm , and stdio.rt . neither of these files was customized for the sd186em board; therefore, the memory mapping addresses and segment addresses for the class code and data must be changed. the code and data sections shown in figure 7a should be big enough to handle stdio.c. users should change the addresses of the map statements, and the segment addresses of the class statements of the selected configuration file to be the same as the corresponding statements shown in figure 8. the makefiles in this and in most other example directories are designed to build different object files, depending on the value of the debug variable in the makefile. if the value of debug=0, the configuration file stdio.rm will be chosen to build the standalone version; if the value of debug=1, the configuration file stdio.rm will be chosen to build the emulator version; if the value of debug=2, the configuration file stdio.rt will be chosen to build the pdrem version. to build a pdrem version of stdio.c , simply change the value of the debug variable in the makefile to 2 (see figure 9), then run nmake (or nmaker) . when nmake finishes, it creates the absolute executable file stdio.axe . from a dos shell, stdio.axe can be downloaded to the ram area of the sd186em board using the pdrt186 stdio command. figure 9 - makefile to build a debuggable program ...... fardata = 0 # 0 - none, 1 - normal, 2 - compressed debug = 2 # 0 - none, 1 - debug eprom, 2 - debug pdremote warnings = 2 # 0 - none, 1 - min, 2 - medium, 3 - max optimize = 0 # 0 - none, 1 - size, 2 - speed ......
9/11/95 page 12 the input and output of the stdio.c program delivered with paradigm locate reads input from and writes output to memory buffers defined in the console.c file. the interactive version of the stdio program and its related files is distributed with the pdrem software in the c:\pdrem\demo\console directory. instructions in the readme.txt file in this directory explain in detail how to make stdio.c work interactively.
9/11/95 page 13 optimizing the application program do not try to optimize an application program when it is in the debugging process, because optimization may move instructions around, and thus make it harder to debug. when the program is fully functional, optimization may be applied to improve the speed of the program and reduce the size of the code; these are two important factors in designing an embedded application. certain optimization options are turned on by default (/oc, /of, /oo, /ot, /ov). this section attempts to explain briefly other optimizations users might want to try to produce faster and smaller code. please review the microsoft c/c++ environment and tools manual for a complete listing. /g1 processor specific instructions use this option to produce 80186 instructions /gr register calling convention this option instructs the compiler to pass arguments between functions using registers as much as possible. thus it increases the speed. warning: using this option with inline assembly language may cause conflicts in the use of registers. /gs turn stack checking off use this option to eliminate the stack-probe routine being called at every function entry point, thus it enables the compiler to produce faster code. /gy eliminate dead-code at link time this option eliminates unintended functions at link time, thus it enables the linker to produce smaller code. /ob[0,1,2] control inline expansion inline expansion produces faster code because the overhead associated with function calls is eliminated, but it will increase the size of the code. /ob0: disable inline expansion (default with /od) /ob1: only expand functions marked as inline or __inline /ob2: expand functions marked as inline or __inline and any other functions the compiler chooses /oe global register allocation this option allows the compiler to store frequently used variables and expressions in registers, thus increases the speed and decreases the size of the code. this option should always be turned on. /og global-level common subexpression optimization when the same expression is repeated within a function, and the value has not changed, the compiler calculates the expression and stores it in a temporarily variable. thus this option decreases the size, and increases the speed. this option should always be turned on. /oi generate intrinsic functions this option instructs the compiler to replace the common string or memory functions such as memcpy, strcpy, etc. with their inline code. as with inline option /obn, intrinsic functions are faster, but they may be larger due to additional code generated. /ol enable loop optimization this option removes invariant code within a loop. any expression whose value is constant inside the loop will be moved outside when this option is turned on. thus it increases the speed of the program execution. /os minimize executable file size this option minimizes the size of the object file. though it produces smaller code, it may also slow the code. /ox maximize optimization this option is a short way to combine optimizing options to produce the fastest possible code. it is the combination of the following options: /oblcegilnot /gs. /oz turn on potential unsafe loop optimization this option works like /ol, only it is much more aggressive. warning: use of this option may generate unwanted ?features?. building an am186em standalone program
9/11/95 page 14 the main function of pdrem is to create an environment for high level debugging. once the debugging process is done, pdrem is no longer needed in memory. the debug information included in the object files such as symbol names only takes up space, and has very little use. therefore, to build a stand-alone program, users need to recompile the source code to discard the debug information, and add other optimizations to create more productive code. users should also re-locate the .rom file using a configuration file similar to the pdrem.cfg file to make use of the memory region previously occupied by pdrem. this section shows how to build the sieve.c demo program as a stand-alone program; it is divided into three parts: changing the makefile, changing the configuration file, and downloading a stand-alone program. 1. changing the makefile : the makefile of the sieve . c demo program is very simple; the user only needs to add the desired optimization options to the command cl in the makefile. as mentioned earlier, the standalone versions of stdio.c program and other examples are controlled by the value of the variable debug in the makefile. in these cases, simply add the desired optimization options and change the value of debug from 2 to 0 (figure 10). figure 10 - makefile to build a standalone program 2. changing the configuration file : the configuration file for building a standalone program should be similar to the pdrem.cfg configuration file shown in figure 5, except for the memory mapping statements. figure 11 shows the configuration file for building the sieve.c program as a standalone program. figure 11 - memory mapping for a standalone program ...... float = 0 # 0 - none, 1 - alternate, 2 - emulator, 3 - coprocessor fardata = 0 # 0 - none, 1 - normal, 2 - compressed debug = 0 # 0 - none, 1 - debug eprom, 2 - debug pdremote warnings = 2 # 0 - none, 1 - min, 2 - medium, 3 - max optimize = 0 # 0 - none, 1 - size, 2 - speed ...... ...... hexfile intel86 // intel extended hex output listfile segments // create a segment map map 0x00000 to 0x003ff as reserved // interrupt vector table map 0x00400 to 0x01fff as rdwr // data area map 0x02000 to 0xdffff as reserved map 0xe0000 to 0xfffff as rdonly // eprom cputype am186em // select the processor type initcode inbyte 0x1000 // reset vector .......
9/11/95 page 15 the user can use information in the .loc or the .map file to calculate the exact address range of the read-write data in the ram, and the read-only data in the rom. memory needed for ram is calculated by subtracting the stop address of class stack from the start address of the first data class. memory needed for rom is calculated by subtracting the stop address of the class endromdata from the start address of the class code . a portion of the sieve.loc file is shown in figure 12. according to this data, the minimum ram needed for this application alone is c0fh (100fh - 400h), and the minimum rom needed for this application alone is 17fh (e017fh - e0000h). figure 12 - sieve.loc file 3 . downloading a standalone program : downloading a standalone program is exactly the same as downloading pdrem. see the section ?downloading pdrem to sd186em the board? for detailed information. input file: sieve.rom configuration file: sieve.cfg created by paradigm locate 5.00b on sat jul 29 15:22:41 1995 command line options: c:\locate\locate.exe sieve memory address map for program sieve start stop length segment class 000400h 000401h 00002h _data data 000402h 000403h 00002h xiheap data ....... ....... 000404h 000c03h 00800h c_common bss 000c10h 00100fh 00400h _stack stack 0e0000h 0e0156h 00157h _text code 0e0160h 0e0160h 00000h _brd romdata ....... ....... 0e0164h 0e0164h 00000h hdr romdata 0e0170h 0e017fh 00010h _erd endromdata 0f7ff0h 0f7ff8h 00009h ??cpuinit ??locate entry point: f7ff:0000 initial stack: 00c1:0400


▲Up To Search▲   

 
Price & Availability of DEBUG186

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X