| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Custom Builder M3T-PD38SIM User's Manual Rev. 1.00 2003 REJ1
Top Searches for this datasheetCB38SIM V.1.01 Custom Builder M3T-PD38SIM User's Manual Rev. 1.00 2003 REJ10J0056-0100Z Microsoft, MS-DOS, Windows, Windows registered trademarks Microsoft Corporation U.S. other countries. registered trademarks International Business Machines Corporation. Intel Pentium registered trademarks Intel Corporation. Adobe, Acrobat, Acrobat Reader trademarks Adobe Systems Incorporated. other brand product names trademarks, registered trademarks service marks their respective holders. Keep safety first your circuit designs! Renesas Technology Corporation Renesas Solutions Corporation maximum effort into making semiconductor products better more reliable, there always possibility that trouble occur with them. Trouble with semiconductors lead personal injury, fire property damage. Remember give consideration safety when making your circuit designs, with appropriate measures such placement substitutive, auxiliary circuits, (ii) nonflammable material (iii) prevention against malfunction mishap. Notes regarding these materials These materials intended reference assist customers selection Renesas Technology product best suited customer's application; they convey license under intellectual property rights, other rights, belonging Renesas Technology Corporation, Renesas Solutions Corporation third party. Renesas Technology Corporation Renesas Solutions Corporation assume responsibility damage, infringement third-party's rights, originating product data, diagrams, charts, programs, algorithms, circuit application examples contained these materials. information contained these materials, including product data, diagrams, charts, programs algorithms represents information products time publication these materials, subject change Renesas Technology Corporation Renesas Solutions Corporation without notice product improvements other reasons. therefore recommended that customers contact Renesas Technology Corporation, Renesas Solutions Corporation authorized Renesas Technology product distributor latest product information before purchasing product listed herein. information described here contain technical inaccuracies typographical errors. Renesas Technology Corporation Renesas Solutions Corporation assume responsibility damage, liability, other loss rising from these inaccuracies errors. Please also attention information published Renesas Technology Corporation Renesas Solutions Corporation various means, including Renesas home page (http://www.renesas.com). When using information contained these materials, including product data, diagrams, charts, programs, algorithms, please sure evaluate information total system before making final decision applicability information products. Renesas Technology Corporation Renesas Solutions Corporation assume responsibility damage, liability other loss resulting from information contained herein. Renesas Technology semiconductors designed manufactured device system that used under circumstances which human life potentially stake. Please contact Renesas Technology Corporation, Renesas Solutions Corporation authorized Renesas Technology product distributor when considering product contained herein specific purposes, such apparatus systems transportation, vehicular, medical, aerospace, nuclear, undersea repeater use. prior written approval Renesas Technology Corporation Renesas Solutions Corporation necessary reprint reproduce whole part these materials. these products technologies subject Japanese export control restrictions, they must exported under license from Japanese government cannot imported into country other than approved destination. diversion reexport contrary export control laws regulations Japan and/or country destination prohibited. Please contact Renesas Technology Corporation Renesas Solutions Corporation further details these materials products contained therein. inquiries about contents this document product, fill text file installer generates following directory email your local distributor. Renesas Tools Homepage http://www.renesas.com/en/tools Overview Setting CB38SIM Features CB38SIM Same user interface available with PD38SIM Development environment where programming, building, debugging integrated Creation custom command custom window programs. PD38SIM's Register, Memory, Dump, Script Windows Function Each Window CB38SIM Window 2.1.1 Menu Bar.3 2.1.2 Tool Bar.4 Project Window 2.2.1 Menu Bar.5 Message Window 2.3.1 Menu Bar.5 Editor Window 2.4.1 Menu Bar.6 Local Window 2.5.1 Menu Bar.6 Global Window 2.6.1 Menu Bar.6 Method Creating Program Creating Custom Command Program 3.1.1 Creating Project Custom Command Program.7 3.1.2 Creating Source File.9 3.1.3 Source File Project.11 3.1.4 Building Project.11 3.1.5 Execution Example Custom Command Program.13 Creating Custom Window Program 3.2.1 Creating Project Custom Window Program.14 3.2.2 Editing Automatically Created Framework Source File.16 3.2.3 Execution Example Custom Window Program.17 Using Setup Dialog 3.3.1 Project Setup Area.18 3.3.2 Source File Setup Area.19 3.3.3 Include File Library File Search Path Setup Area.20 3.3.4 Library Setup Area.21 Using Breakpoint Dialog 3.4.1 File name setup/display area.23 3.4.2 Line number setup/display area.23 3.4.3 Breakpoint list area.23 3.4.4 Enter button.23 3.4.5 Cancel button.23 3.4.6 button.23 3.4.7 Delete button.23 3.4.8 Enable button.24 3.4.9 Disable button.24 3.4.10 Jump button.24 Programming Language Specifications Reference Standard Functions (stdlib.lib) 5.1.1 malloc: Allocate memory from heap area.26 5.1.2 free: Release area allocated malloc() function.26 5.1.3 strlen: length character string.27 5.1.4 strcat: Concatenate character strings.27 5.1.5 strcmp: Compare character strings.27 5.1.6 strcpy: Copy character string.27 5.1.7 strtoi: Convert character string into value.28 5.1.8 gets: Input character string (from Script Window).28 5.1.9 exit: Terminate program execution.28 5.1.10 fopen: Open file.29 5.1.11 fclose: Close file.29 5.1.12 fseek: Move file pointer.29 5.1.13 fgetc: Input character (from file).29 5.1.14 fputc: Output character file).29 5.1.15 fgets: Input character string (from file).30 5.1.16 fputs: Output character string file).30 5.1.17 printf: Output characters with format Script Window).30 5.1.18 sprintf: Output characters with format memory).30 5.1.19 fprintf: Output characters with format file).31 System Call Functions Debugger Operation (system.lib) 5.2.1 _cpu_go: Execute program free-run mode.34 5.2.2 _cpu_gb: Execute program with break.34 5.2.3 _cpu_stop: Stop program execution.34 5.2.4 _cpu_reset: Reset target CPU.35 5.2.5 _cpu_src_step: Execute program source line time.35 5.2.6 _cpu_step: Execute program instruction time.35 5.2.7 _cpu_src_over: Execute program source line time including subroutines.35 5.2.8 _cpu_over: Execute program instruction time including subroutines.36 5.2.9 _cpu_src_return: Return from current calling routine source line time.36 5.2.10 _cpu_return: Return from current calling routine instruction time.36 5.2.11 _cpu_wait: Wait until program execution stops.36 5.2.12 _reg_get_reg: register value.37 5.2.13 _reg_put_reg: register value.37 5.2.14 _reg_get_pc: program counter value.37 5.2.15 _reg_put_pc: program counter value.38 5.2.16 _reg_clear_cache: Clear register cache.38 5.2.17 _mem_get: memory value.38 5.2.18 _mem_put: memory value.38 5.2.19 _mem_get_endian: memory value with endian attached.39 5.2.20 _mem_put_endian: memory value with endian attached.39 5.2.21 _mem_fill: Fill memory.40 5.2.22 _mem_move: Transfer memory block.40 5.2.23 _mem_clear_cache: Clear memory cache.40 5.2.24 _break_set: Set/enable software break.41 5.2.25 _break_get: settings software breaks.41 5.2.26 _break_reset: Clear software break.41 5.2.27 _break_reset_all: Clear software breaks.42 5.2.28 _break_disable: Disable software break.42 5.2.29 _break_disable_all: Disable software breaks.42 5.2.30 _break_enable_all: Enable software breaks.42 5.2.31 _break_search: attribute software break settings.43 5.2.32 _rram_clear: Clear monitor memory.43 5.2.33 _rram_get_area: monitor area.43 5.2.34 _rram_set_area: monitor area.43 5.2.35 _rram_get_size: size monitor area.44 5.2.36 _rram_get_data: monitor data.44 5.2.37 _info_check_run: Check execution status.44 5.2.38 _info_service: information service contents.45 5.2.39 _info_cpu: information.45 5.2.40 _info_get_map: information.46 5.2.41 _info_check_map: Check mapped area.46 5.2.42 _info_get_suffix: load file extension.46 5.2.43 _info_set_suffix: load file extension.47 5.2.44 _scope_set_obj: scope object file name.47 5.2.45 _scope_set_addr: scope address.47 5.2.46 _sym_add_sym: Enter symbols.48 5.2.47 _sym_val2sym: symbol value.48 5.2.48 _sym_sym2val: value symbol.49 5.2.49 _sym_add_bit: Enter symbols.49 5.2.50 _sym_val2bit: symbol address number.49 5.2.51 _sym_bit2val: address number symbol.50 5.2.52 _line_addr2line: source line address.50 5.2.53 _line_line2addr: address source line.50 5.2.54 _src_get_name: list source file names.51 5.2.55 _obj_get_name: list object file names.51 5.2.56 _obj_addr2obj: object file name address.51 5.2.57 _func_get_name: list function names.52 5.2.58 _exp_eval: Evaluate assembler expression.53 5.2.59 _scri_echo_on: Turn output script window.53 5.2.60 _scri_echo_off: Turn output script window.53 5.2.61 _c_exp_eval: Evaluate C-language expression.54 5.2.62 _get_shared_mem: shared variable.55 5.2.63 _set_shared_mem: shared variable.56 5.2.64 _delete_shared_mem: Delete shared variable.56 5.2.65 _get_err_msg: PD38SIM's error message statement.56 5.2.66 _get_tick_count: elapsed time since Windows startup.56 5.2.67 _get_time: current system date time.57 5.2.68 _disp_src_line: Change contents displayed program window.57 5.2.69 _cv_get_data: coverage data.58 5.2.70 _cv_set_data: coverage data.58 5.2.71 _cv_clear_data: Clear coverage data.59 5.2.72 _cv_clear_cache: Clear coverage cache.59 5.2.73 _syscom: Execute PD38SIM's script command.60 5.2.74 _doscom: Execute command.60 5.2.75 List Simulator Errors.61 System Call Functions Window Operation (winlib.lib) 5.3.1 _win_printf: Output text with format included.63 5.3.2 _win_puts: Output character string custom window.63 5.3.3 _win_set_cursor: cursor position.63 5.3.4 _win_set_color: text color.64 5.3.5 _win_set_bkcolor: background color.65 5.3.6 _win_column2dot: Convert cursor coordinates into pixel coordinates.65 5.3.7 _draw_text_out: Output character string custom window.66 5.3.8 _draw_set_color: text color.66 5.3.9 _draw_set_bkcolor: background color.67 5.3.10 _draw_set_bkmode: background mode.67 5.3.11 _draw_set_font: font.68 5.3.12 _draw_get_char_size: font size.68 5.3.13 _draw_line: Draw line.69 5.3.14 _draw_fill_rect: Fill rectangle.70 5.3.15 _draw_frame_rect: Draw rectangle.71 5.3.16 _draw_invert_rect: Reverse rectangle color.71 5.3.17 _draw_arc: Draw ellipse.72 5.3.18 _draw_pie: Draw sector.73 5.3.19 _win_redraw: Redraw custom window.74 5.3.20 _win_redraw_clear: Redraw custom window.74 5.3.21 _win_redraw_item: Redraw control item.74 5.3.22 _win_show_window: Show/hide control item.74 5.3.23 _win_set_window_title: title custom window.74 5.3.24 _win_enable_window: Enable/disable control item.74 5.3.25 _win_button_create: Create button.75 5.3.26 _win_button_set_text: Change button text.75 5.3.27 _win_hscroll_range: scroll range horizontal scroll bar.75 5.3.28 _win_hscroll_pos: position horizontal scroll box.75 5.3.29 _win_vscroll_range: scroll range vertical scroll bar.76 5.3.30 _win_vscroll_pos: position vertical scroll box.76 5.3.31 _win_statusbar_create: Create status bar.76 5.3.32 _win_statusbar_set_pane: items status bar.77 5.3.33 _win_statusbar_set_text: text status bar.77 5.3.34 _win_dialog: Create input dialog box.77 5.3.35 _win_message_box: Create message box.78 5.3.36 _win_filedialog: Create file selection dialog box.79 5.3.37 _win_set_window_pos: position custom window.81 5.3.38 _win_set_window_size: size custom window.81 5.3.39 _win_timer_set: system timer.82 5.3.40 _win_timer_kill: Reset system timer.82 Handle Functions Custom Window 5.4.1 Specifications Data Passed Handle Functions.84 5.4.2 OnChar Handle Function.84 5.4.3 OnCommand Handle Function.85 5.4.4 OnCreate Handle Function.85 5.4.5 OnDestroy Handle Function.85 5.4.6 OnDraw Handle Function.85 5.4.7 OnEvent Handle Function.86 5.4.8 OnHScroll Handle Function.87 5.4.9 OnKeyDown Handle Function.88 5.4.10 OnKeyUp Handle Function.91 5.4.11 OnLButtonDblClk Handle Function.92 5.4.12 OnLButtonDown Handle Function.92 5.4.13 OnLButtonUp Handle Function.93 5.4.14 OnMouseMove Handle Function.93 5.4.15 OnRButtonDblClk Handle Function.94 5.4.16 OnRButtonDown Handle Function.94 5.4.17 OnRButtonUp Handle Function.95 5.4.18 OnSize Handle Function.96 5.4.19 OnTimer Handle Function.96 5.4.20 OnVScroll Handle Function.97 Overview Setting CB38SIM CB38SIM same PD38SIM. procedure setting PD38SIM detailed "Setup/Functional Outline" part PD38SIM V.1.00 User's Manual. Features CB38SIM CB38SIM provides environment using PD38SIM's customize function create exclusive script commands (hereafter called "custom command program") exclusive windows (hereafter called "custom window program"). custom command custom window programs thus created CB38SIM entered PD38SIM expand functions. following shows features CB38SIM: same user interface available with PD38SIM supported. development environment where programming, building, debugging integrated provided. Creation custom command custom window programs supported. PD38SIM's Register, Memory, Dump, Script Windows supported. Each feature detailed sections below. Same user interface available with PD38SIM CB38SIM uses same graphical interface design PD38SIM, making possible CB38SIM easily same PD38SIM. Development environment where programming, building, debugging integrated CB38SIM allows control series operations from creating source files building debugging them. windows supported CB38SIM include Project, Message, Editor, Local, Global Windows. Each these windows allows manage projects, display build result other status, edit source file, display local global symbols. Creation custom command custom window programs CB38SIM allows type program going create specified from dialog that opened when creating project. this select custom command custom window program created. PD38SIM Register, Memory, Dump, Script Windows Among windows available with PD38SIM, CB38SIM supports Register, Memory, Dump, Script Windows. These windows used when creating custom command custom window programs. Note: macro script commands cannot used Script Window. Function Each Window Figure shows window structure CB38SIM. CBxx Window Project Window Local Window Message Window Editor Window Figure Window structure CB38SIM Global Window outline features functions each window CB38SIM explained below. CB38SIM Window CB38SIM Window main window CB38SIM. This what opens first when start CB38SIM. 2.1.1 Menu Tables below show menu structure CB38SIM Window. Table Structure Menu (CB38SIM Window) (1/2) Items pull-down menu Function [N]ew [S]ource/Header. Create source/header file. [P]roject. Create project. [O]pen. Open source/project. [S]ave Save source file. Save [A]s. Save file after assigning name. [C]lose Close source file. E[x]it Terminate CB38SIM. C[u]t Delete specified range. [C]opy Copy specified range clipboard. [P]aste Paste text from clipboard into position. [F]ind Search specified character string. [I]nit. Open Init dialog box. [P]ath. Open Path dialog box. [G]o Execute command. [C]ome Execute Come command. [S]tep Execute Step command. [O]ver Execute Over command. Retur[n] Execute Return command. [A]nimate Execute Animate command. [B]reak Point. Open Break dialog box. Break Point [S]et clear breakpoint. [L]ist. Open Break dialog box. [R]eset Reset program. [S]top Stop program execution. B[u]ild Built current project. R[e]Build Rebuild current project. Changed window that focus. (Refer sections that follow.) Menu item [F]ile [E]dit [E]nviron [D]ebug [O]ption Menu item [W]indow [H]elp Table Structure Menu (CB38SIM Window) (2/2) Items pull-down menu Function [C]ascade Display windows another. [T]ile Display windows side side. [A]rrange Icon Line icons. [R]egister Window Open PD38SIM's Register Window. M[e]mory Window Open PD38SIM's Memory Window. [D]ump Window Open PD38SIM's Dump Window. Scr[i]pt Window Open PD38SIM's Script Window. [I]ndex Open table contents online help. [A]bout. Display version CB38SIM. 2.1.2 Tool Table shows tool structure CB38SIM Window. Table Structure Tool (CB38SIM Window) Function Corresponding menu Execute command [Debug]->[Go] Execute Come command Execute Step command Execute Over command Execute Return command Stop program execution Set/clear breakpoint Reset program Open Break dialog Build project Rebuild project [Debug] ->[Come] [Debug] ->[Step] [Debug] ->[Over] [Debug] ->[Return] [Debug] [Stop] [Debug] [Break Point] [Set] [Debug] [Reset] [Debug] [Break Point.] [Debug] [Build] [Debug] [ReBuild] Button Project Window This window used manage source files custom command custom window programs created CB38SIM. source file displayed this window opened Editor Window example, double-clicking mouse button. 2.2.1 Menu Table shows menu structure Option menu Project Window. Table Menu Structure Option Menu (Project Window) Items pull-down menu Function [S]et Open Setup dialog box. [A]dd File. source file project. [D]el File Delete source file from project. Menu item [O]ption Message Window This window used display compile link error when building project other messages during debugging. These messages initialized when start building project. When compile error displayed, point line error double- singleclick mouse button select Then choose [Option] [Jump] from menu display corresponding source file Editor Window, with cursor moved line error. 2.3.1 Menu Table shows menu structure Option menu Message Window. Table Menu Structure Option Menu (Message Window) Items pull-down menu Function [J]ump Display lines error. Menu item [O]ption Editor Window This window used edit source file. Multiple instances this window opened time, with source file name displayed title each window. Editor Window provides versatile editing functions, allowing input delete characters, paste from clipboard, load save file. During debugging, furthermore, breakpoint line shown next execution line shown blue. breakpoint line next execution line overlap, they displayed yellow. 2.4.1 Menu Option menu Editor Window does have submenu. Local Window This window used display local variables their values function that corresponds program counter during debugging. This window opened when start debugging program closed when finish debugging. 2.5.1 Menu Option menu Local Window does have submenu. Global Window This window used display global variables their values during debugging. This window opened when start debugging program closed when finish debugging. 2.6.1 Menu Option menu Global Window does have submenu. Method Creating Program This section explains CB38SIM create custom command custom window program using simple program example. Creating Custom Command Program following shows procedure creating custom command program using CB38SIM. Create project custom command program. Write source file. source file project. Build project. Debug correct source file necessary. Repeat steps until program operates properly. table below shows specifications custom command program created this section. Program name Parameter Function m_reset None Display program counter value before reset. Reset target MCU. Display program counter value after reset. 3.1.1 Creating Project Custom Command Program Choose [File]->[New]->[Project.] from CB38SIM Window menu. dialog shown below will appear. Figure Target Select dialog Choose "Custom Command" press "OK" button. file selection dialog will open, input project name press "Save" button. file name extension omitted.) diagram below shows example where "m_reset" input name sample custom command program created this section. Figure Dialog selecting project name created Project Window showing created project file name project setup dialog opened. Figure Setup dialog Figure Project Window Setup dialog opened from Option menu Project Window change settings time want. this example, only press "Cancel" button Setup dialog leave intact. details Setup dialog box, refer Section 3.3, "Using Setup Dialog Box" page Thus, with above, project file named "m_reset.prj" created. 3.1.2 Creating Source File Choose [File]->[New]->[Source/Header.] from CB38SIM Window menu. Editor Window shown below will appear. Figure Blank Editor Window Move focus this Editor Window choose [File]->[Save As.] from CB38SIM Window menu bring Save dialog box. When this dialog opens, input file name press "Save" button. Specify ".m" source file name extension. Figure Save dialog name have input Save dialog displayed title Editor Window. Figure Editor Window with name shown title Write custom command source program this Editor Window. Figure Editor Window with source program written details about programming language specifications, refer Section "Programming Language Specifications" page details about library function specifications, refer Section "Reference" page asterisk file name title indicates that changes have been made this file. Thus, with above, custom command source file named "m_reset.m" created. 3.1.3 Source File Project build source file created preceding section, need project. Choose [Option]->[Add File.] from Project Window menu bring "Add source" dialog box. When this dialog opens, choose file name want added project press "Open" button. source file name thus added displayed Project Window. Figure "Add Source" dialog Figure Project Window with source file added Thus, with above, source file "m_reset.m" added project. also source files project using Setup dialog box. details Setup dialog box, refer Section 3.3, "Using Setup Dialog Box" page 3.1.4 Building Project operation create custom command program custom window program file processing source files added project referred "build" "rebuild." difference between "build" "rebuild" that among source files added project, only those which have been modified since program file created previously processed former, whereas source files added project processed latter. execute Build, choose [Debug]->[Build] from Window menu press Build button tool bar. execute Rebuild, choose [Debug]->[ReBuild] from Window menu press Rebuild button tool bar. Figure Message Window when succeeded building Thus, with above, custom command program file generated CB38SIM providing that error found source program settings Setup dialog box. this example, include file library file search paths remain default value (current directory) because only pressed "Cancel" button Setup dialog that opened when creating project. Therefore, project built following process described above, message will displayed Message Window indicating that include files cannot opened. Figure Message Window when error occurred when building this case, click error message line displayed Message Window then choose [Option]->[Jump] double-click error message line. corresponding source line will displayed Editor Window, with cursor moved that line. example here, Build operation successfully executed setting include file library file search paths properly. details Setup dialog box, refer Section 3.3, "Using Setup Dialog Box" page 3.1.5 Execution Example Custom Command Program following shows execution example m_reset command program that created example above. execute command program, press button CB38SIM Window tool bar. Figure Execution example custom command program "m_reset.p" this example, will that address before reset EAEAH address after reset E000H. Output from custom command programs into Script Window. Therefore, Script Window open, there means verifying output from custom command programs. Creating Custom Window Program following shows procedure creating custom window program using CB38SIM. Create project custom window program. Edit framework source file generated CB38SIM. Build project. Debug correct source file necessary. Repeat steps until program operates properly. table below shows specifications custom window program created this section. Program name dump1000 Function Dump bytes beginning with address 1000H. 3.2.1 Creating Project Custom Window Program Choose [File]->[New]->[Project.] from CB38SIM Window menu. dialog shown below will appear. Figure Target Select dialog Choose "Custom Window" press "OK" button. file selection dialog will open, input project name press "Save" button. file name extension omitted.) diagram below shows example where "dump1000" input name sample custom window program created this section. Figure Dialog selecting project name created When dialog prompting your confirmation whether create framework shown below appears, enter "Yes". Figure Dialog confirmation framework generation enter "No" here, CB38SIM does automatically create framework. Project Window showing created project file name project setup dialog opened. Figure Setup dialog Figure Project Window Setup dialog opened from Option menu Project Window change settings time want. this example, only press "Cancel" button Setup dialog leave intact. details Setup dialog box, refer Section 3.3, "Using Setup Dialog Box" page When creating project custom window program, framework source file automatically generated CB38SIM. this example, file "dump1000.m" automatically generated. Programming custom window program accomplished editing this framework source file. Thus, with above, project file "dump1000.prj" framework source file "dump1000.m" created. 3.2.2 Editing Automatically Created Framework Source File framework source file automatically created CB38SIM contains description handle functions that correspond window events. details about handle functions, refer Section 5.4, "Handle Functions Custom Window" page handle functions treated example here: OnDraw OnEvent. OnDraw function called when area hidden some other window need displayed. OnEvent function called when change debugger status required such when target's memory value been modified. When OnDraw function called, dump1000 gets bytes memory values starting from address 1000H convert them into character strings display window. write this series processing, edit internal statements OnDraw function. Furthermore, when OnEvent function called, dump1000 calls OnDraw function update window display. Note: delete functions written framework source file. Loss function this file makes impossible build project correctly. There limit functions that added file. diagram below shows Editor Window displaying OnDraw function that been edited "dump1000" custom window program. Figure Editor Window displaying OnDraw function dump1000 method building project custom window program same used custom command programs. Refer Section 3.1.4, "Building Project" page 3.2.3 Execution Example Custom Window Program following shows execution example dump1000 window program that created example above. execute window program, press button CB38SIM Window tool bar. Figure Execution example custom window program "dump1000.p" this example, will that bytes beginning with address 1000H displayed dump form. When area hidden some other window need displayed, custom window program calls OnDraw function; when debugger status need updated such when target memory contents have been changed, calls OnEvent function. Therefore, dump1000 custom window program display automatically updated when hidden part displayed target memory contents changed. Using Setup Dialog Setup dialog provided setting project. This dialog opened choosing [Option]->[Set up.] from CB38SIM Window menu double-clicking project file name displayed Project Window. Project setup area Library setup area Source file setup area Include file library file search path setup area Figure Structure Setup dialog 3.3.1 Project Setup Area This area comprised following three fields: Project type setup/display field Target file name setup/display field Runtime parameter setup/display field Figure Structure project setup field 3.3.1.1 Project Type Setup/Display Field following project types here. Custom Command Create custom command program. Custom Window Create custom window program project type have displayed this field startup routines libraries that will combined during building selected depending project type choose program created. change project type only affects selection startup routines libraries that will combined during building. 3.3.1.2 Target File Name Setup/Display Field program file name here that want created when building. file name have displayed this field. 3.3.1.3 Runtime Parameter Setup/Display Field This field appears when specified "Custom Command" project type. parameters this field that want passed when debugging custom command program. parameters here passed arguments "argc" "argv" main() function following manner: argc Number parameters argv Pointer array address that contains pointers areas where character strings specified parameters stored parameters have displayed this field. 3.3.2 Source File Setup Area This area comprised following five fields: File name setup/display field Refer button file display/delete file select field button Delete button Figure Structure source file setup area 3.3.2.1 File Name Setup/Display Field source file name this field that want added project. source file here added project press "Add" button source file name displayed file display/delete file select field. source file names added project listed press "Add" button. 3.3.2.2 File Display/Delete File Select Field source file names added project listed this field. unnecessary source file deleted from project selecting file name this field clicking with mouse pressing "Delete" button. 3.3.2.3 Refer Button source file names added project listed this field. unnecessary source file deleted from project selecting file name this field clicking with mouse pressing "Delete" button. 3.3.2.4 Button This button adds source file that entered file name setup/display field project. When source file, CB38SIM checks file exists. specified source file does exist already been added project, file added. 3.3.2.5 Delete Button This button deletes source file from project that have selected clicking with mouse file display/delete file select field. file deleted unless there source file selected. 3.3.3 Include File Library File Search Path Setup Area This area comprised following four fields: Include file search path setup/display field Default include path setup button Library file search path setup/display field Default library path setup button Figure Structure include file library file search path setup area 3.3.3.1 Include File Search Path Setup/Display Field directory this field that want searched file when inclusion file specified #include <filename> source file. Normally, specify directory where system include files stored. system include files installed "include" directory that located below directory where CB38SIM installed. include file search path have displayed this field. 3.3.3.2 Default Include Path Setup Button This button sets directory that include file search path setup/display field default path used CB38SIM when creating project. When create project with CB38SIM after setting default path with this button, directory have used include file search path. 3.3.3.3 Library File Search Path Setup/Display Field directory this field that want searched library file linked when building project. Normally, specify directory where system library files stored. system library files installed "lib" directory that located below directory where CB38SIM installed. library file search path have displayed this field. 3.3.3.4 Default Library Path Setup Button This button sets directory that library file search path setup/display field default path used CB38SIM when creating project. When create project with CB38SIM after setting default path with this button, directory have used library file search path. 3.3.4 Library Setup Area This area comprised following five fields: Library name setup/display field Refer button library display/delete library select field button Delete button Figure Structure library setup area 3.3.4.1 Library Name Setup/Display Field this field, library file name that added project system library that want linked when building project. library file here added project press "Add" button library file name displayed library display/delete library select field. library file names added project listed press "Add" button. 3.3.4.2 Library Display/Delete Library Select Field library file names added project listed this field. unnecessary library file deleted from project selecting file name this field clicking with mouse pressing "Delete" button. 3.3.4.3 Refer Button This button allows library file project without having input file name from keyboard. When press "Refer" button, file selection dialog opens. library file name choose this dialog input library name setup/display field. proceed press "Add" button project. 3.3.4.4 Button This button adds library file that entered library name setup/display field project. When library file, CB38SIM checks file exists. specified library file does exist already been added project (including system libraries), file added. 3.3.4.5 Delete Button This button deletes library file from project that have selected clicking with mouse library display/delete library select field. file deleted unless there library file selected. 3.4. Using Breakpoint Dialog breakpoint dialog allows make various breakpoint settings. Choose CB77SIM menus [Debug] [Break Point.] press break dialog open button tool bar. File name setup/display area Line number setup/display area Enter button Cancel button button Delete button Enable button Disable button Breakpoint list display area Jump button Figure Structure breakpoint dialog 3.4.1. File name setup/display area Specify file name which want breakpoints full path. 3.4.2. Line number setup/display area Specify line number file where want breakpoint. 3.4.3. Breakpoint list area This area lists breakpoints that currently set. When choose breakpoint listed this area, file name selected breakpoint file name setup/display area, line number line number setup/display area. symbols list area indicate whether breakpoints enabled disabled, which followed display line numbers then file names. 3.4.4. Enter button When press this button, breakpoint information you've changed from breakpoint dialog registered system before closing dialog box. 3.4.5. Cancel button When press this button, breakpoint information you've changed from breakpoint dialog canceled dialog closed without saving anything. 3.4.6. button this button register breakpoint shown file name setup/display line number setup/display areas breakpoint list area. 3.4.7. Delete button This button deletes breakpoint you've selected breakpoint list area. button when want delete breakpoints collectively. 3.4.8 Enable button This button enables breakpoint you've selected breakpoint list area. button when want enable breakpoints collectively. 3.4.9 Disable button This button disables breakpoint you've selected breakpoint list area. button when want disable breakpoints collectively. 3.4.10 Jump button This button moves editor window cursor position indicated breakpoint you've selected breakpoint list area. Programming Language Specifications programming language which programs written CB38SIM subset language, subject following restrictions compared general language. Types struct, union, enum nonexistent. Variables that involve initialization cannot declared. Example: static storage class nonexistent. storage class specifier that used extern only. types that used char, int, pointer, array only. Example: char 1Byte 4Byte char*str;/* 4Byte 4Byte Types char signed types signed unsigned specifiers cannot used). Parameter lists cannot written prototype declaration functions. Example: foo(int); Error foo2(char *str); Error Arguments function definitions written manner similar ANSI standards. Example: func( Although parameter types checked when calling function, type function's return value checked. Variables cannot declared intra-function local block. Example: func() Error preprocessor cannot expand macros accompanied parameters. define expressions. Example: #define FUNC(A) Error #define label Error preprocessor pseudo-instruction allows only specified operand. Reference Standard Functions (stdlib.lib) stdlib.lib provides standard functions that used custom command custom window programs. prototype declaration each function written stdlib.h. Function name Description malloc Allocate memory from heap area. free Release area allocated malloc. strlen length character string. strcat Concatenate character strings. strcmp Compare character strings. strcpy Copy character string. strtoi Convert character string into value. gets Input character string (from Script Window). exit Terminate program execution. fopen Open file. fclose Close file. fseek Move file pointer. fgetc Input character (from file). fputc Output character file). fgets Input character string (from file). fputs Output character string file). printf Output characters with format Script Window). sprintf Output characters with format memory). fprintf Output characters with format file). 5.1.1 malloc: Allocate memory from heap area Function name: char *malloc(int size) Parameter: size Number allocated bytes Returned value: char Allocated area NULL Error Description: This function allocates area "size" bytes from heap area returns beginning address area. returns NULL there area that allocated. 5.1.2 free: Release area allocated malloc() function Function name: free(char Parameter: char Area released Returned value: Succeeded Error Description: This function releases area allocated malloc() function. 5.1.3 strlen: length character string Function name: strlen(char Parameter: char Character string Returned value: Character string length character string Description: This function returns length 5.1.4 strcat: Concatenate character strings Function name: char *strcat(char *s1, char *s2) Parameter: char Character string which added char Character string added Returned value: char Character string which added Description: This function concatenates character string returns 5.1.5 strcmp: Compare character strings Function name: strcmp(char *s1, char *s2) Parameter: char Character string char Character string Returned value: Positive number Negative number Description: This function compares character string character string returns positive number negative number 5.1.6 strcpy: Copy character string Function name: char *strcpy(char *s1, char *s2) Parameter: char Destination char Source Returned value: char Destination Description: This function copies character string including returns 5.1.7 strtoi: Convert character string into value Function name: strtoi(char *str, radix, *value) Parameter: char *str Character string radix Conversion radix *value Converted value Returned value: TURE Succeeded FALSE Error Description: This function converts character string specified into numeric value value whose radix specified "radix". conversion succeeded, converted value stored *value. values listed below specified "radix". Value radix Description begins with converted hexadecimal value; begins with converted octal value. Otherwise, converted decimal value. converted octal value. converted decimal value. converted hexadecimal value. 5.1.8 gets: Input character string (from Script Window) Function name: char *gets(char Parameter: char Destination which stored Returned value: char Destination which stored NULL Error Description: This function reads line from input area Script Window stores new-line character line replaced with return value stored NULL returned error occurred. 5.1.9 exit: Terminate program execution Function name: exit(int stat) Parameter: stat Program's return value Returned value: Always Description: This function terminates program execution returns control PD38SIM. stat operation assumed have been processed normally. stat error assumed error message bearing number that macro_err displayed Script Window. 5.1.10 fopen: Open file Function name: fopen(char *filename, char *attr) Parameter: char *filename File name char *attr Open mode Returned value: File descpritor NULL Error Description: This function opens file specified filename mode specified attr. succeeded, return value file descpriptor. 5.1.11 fclose: Close file Function name: fclose(int Parameter: File descriptor Returned value: TRUE Succeeded FALSE Error Description: This function closes file specified 5.1.12 fseek: Move file pointer Function name: fseek(int pos, org) Parameter: File descriptor Distance file pointer moved Base point Returned value: TRUE Succeeded FALSE Error Description: This function moves current position file specified which file written read. distance movement specified offset from base point Beginning file; Current position; file). 5.1.13 fgetc: Input character (from file) Function name: fgetc(int Parameter: File descriptor Returned value: read value FALSE Error Description: This function reads byte from file pointer's current position file specified 5.1.14 fputc: Output character file) Function name: fputc(char Parameter: char Output character File descriptor Returned value: TURE Succeeded FALSE Error Description: This function outputs byte specified file pointer's current position file specified 5.1.15 fgets: Input character string (from file) Function name: fgets (char *str, Parameter: char *str Area which store input character string Maximum number characters input File descriptor Returned value: char Area which store input character string NULL Error Description: This function reads line from file pointer's current position file specified stores area specified str. 5.1.16 fputs: Output character string file) Function name: fputs (char *str, Parameter: char *str Area which store output character string File descriptor Returned value: TURE Succeeded FALSE Error Description: This function outputs character string stored area specified file pointer's current position file specified 5.1.17 printf: Output characters with format Script Window) Function name: printf(char *format, Parameter: char *format Format Variable parameter Returned value: Positive number Number characters output Negative number Error Description: This function outputs characters Script Window after converting them under control "format". return value indicates number characters written window. negative number returned error occurred. 5.1.18 sprintf: Output characters with format memory) Function name: sprintf(char char *format, Parameter: char Output address char *format Format Variable parameter Returned value: Positive number Number characters output Negative number Error Description: This function outputs characters address specified after converting them under control "format". added output. return value indicates number characters written memory (not including negative number returned error occurred. 5.1.19 fprintf: Output characters with format file) Function name: fprintf(int char *format, Parameter: File descriptor char *format Format Variable parameter Returned value: Positive number Number characters output Negative number Error Description: This function outputs characters file specified after converting them under control "format". return value indicates number characters written file. negative number returned error occurred. System Call Functions Debugger Operation (system.lib) "system.lib" provides system call functions that used custom command custom window programs. prototype declaration each function written "system.h". Function name Description _cpu_go Execute program free-run mode _cpu_gb Execute program with break _cpu_stop Stop program execution _cpu_reset Reset target _cpu_src_step Execute program source line time _cpu_step Execute program instruction time _cpu_src_over Execute program source line time including subroutines _cpu_over Execute program instruction time including subroutines _cpu_src_return Return from current calling routine source line time _cpu_return Return from current calling routine instruction time _cpu_wait Wait until program execution stops _reg_get_reg register value _reg_put_reg register value _reg_get_pc program counter value _reg_put_pc program counter value _reg_clear_cache Clear register cache _mem_get memory value _mem_put memory value _mem_get_endian memory value with endian attached _mem_put_endian memory value with endian attached _mem_fill Fill memory _mem_move Transfer memory block _mem_clear_cache Clear memory cache _break_set Set/enable software break _break_get settings software breaks _break_reset Clear software break _break_reset_all Clear software breaks _break_disable Disable software break _break_disable_all Disable software breaks _break_enable_all Enable software breaks _break_search attribute software break settings _rram_clear Clear monitor memory _rram_get_area monitor area _rram_set_area monitor area _rram_get_size size monitor area _rram_get_data monitor data _info_check_run Check execution status Function name _info_service _info_cpu _info_get_map _info_check_map _info_get_suffix _info_set_suffix _scope_set_obj _scope_set_addr _sym_add_sym _sym_val2sym _sym_sym2val _sym_add_bit _sym_val2bit _sym_bit2val _line_addr2line _line_line2addr _src_get_name _obj_get_name _obj_addr2obj _func_get_name _exp_eval _scri_echo_on _scri_echo_off _c_exp_eval _get_shared_mem _set_shared_mem _delete_shared_mem _get_err_msg _get_tick_count _get_time _disp_src_line _cv_get_data _cv_set_data _cv_clear_data _cv_clear_cache _syscom _doscom Description information service contents information information Check mapped area load file extension load file extension scope object file name scope address Enter symbols symbol value value symbol Enter symbols symbol address number address number symbol source line address address source line list source file names list object file names object file name address list function names Evaluate assembler expression Turn output script window Turn output script window Evaluate C-language expression shared variable shared variable Delete shared variable PD38SIM's error message statement elapsed time since Windows startup current system date time Change contents displayed program window coverage data coverage data Clear coverage data Clear coverage cache Execute PD38SIM's script command Execute command error occurs, error number written "Error" item global variable "macro_err". details about Simulator errors, refer Section 5.2.75, "List Simulator Errors". custom command programs, FALSE returned from main() function, error message corresponding error number that "macro_err" displayed Script Window (for PD38SIM) Error dialog (for CB38SIM). 5.2.1 _cpu_go: Execute program free-run mode Function name: _cpu_go() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program from current free-run mode. Error: Simulator error 5.2.2 _cpu_gb: Execute program with break Function name: _cpu_gb() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program from current with breaks included. Error: Simulator error 5.2.3 _cpu_stop: Stop program execution Function name: _cpu_stop() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function stops execution target program. Error: Simulator error 5.2.4 _cpu_reset: Reset target Function name: _cpu_reset() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function reset target CPU. Error: ER_IN1_RUNNING Cannot reset because executing program. Other Simulator error 5.2.5 _cpu_src_step: Execute program source line time Function name: _cpu_src_step() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program, source line time, beginning with current Error: Simulator error 5.2.6 _cpu_step: Execute program instruction time Function name: _cpu_step() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program, instruction time, beginning with current Error: Simulator error 5.2.7 _cpu_src_over: Execute program source line time including subroutines Function name: _cpu_src_over() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program, source line time including subroutines, beginning with current Error: Simulator error 5.2.8 _cpu_over: Execute program instruction time including subroutines Function name: _cpu_over() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function starts executing target program, instuction time including subroutines, beginning with current Error: Simulator error 5.2.9 _cpu_src_return: Return from current calling routine source line time Function name: _cpu_src_return() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function causes program execution return from current calling routine, source line time. Error: Simulator error 5.2.10 _cpu_return: Return from current calling routine instruction time Function name: _cpu_return() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function causes program execution return from current calling routine, instruction time. Error: Simulator error 5.2.11 _cpu_wait: Wait until program execution stops Function name: _cpu_wait() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function stops execution custom command custom window program until target program stops. Error: Simulator error 5.2.12 _reg_get_reg: register value Function name: _reg_get_reg(int *reg, regno) Parameter: *reg Register value regno Register number Returned value: TRUE Succeeded FALSE Error Description: This function gets value register specified "regno". CB38SIM, "regno" defined follows: regno Register IN1_REG_A register IN1_REG_X register IN1_REG_Y register IN1_REG_S register IN1_REG_F register IN1_REG_PC Program counter) Error: Simulator error 5.2.13 _reg_put_reg: register value Function name: _reg_put_reg(int reg, regno) Parameter: Register value regno Register number Returned value: TRUE Succeeded FALSE Error Description: This function sets value register specified "regno". definition "regno" here same _reg_get_reg() function. Error: ER_IN1_DATA_OUTRANGE Data range invalid. Other Simulator error 5.2.14 _reg_get_pc: Function name: Parameter: Returned value: Description: Error: program counter value _reg_get_pc(int *pc) Program counter TRUE Succeeded FALSE Error This function gets program counter value. Simulator error 5.2.15 _reg_put_pc: Function name: Parameter: Returned value: Description: Error: program counter value _reg_put_pc(int Program counter TRUE Succeeded FALSE Error This function sets program counter value. ER_IN1_ADDR_OUTRANGE Address range invalid Other Simulator error Clear register cache _reg_clear_cache() None TRUE Return value always TRUE. This function clears register cache. 5.2.16 _reg_clear_cache: Function name: Parameter: Returned value: Description: 5.2.17 _mem_get: memory value Function name: _mem_get(int addr, size, char *data) Parameter: addr Address size Number bytes obtained char *data Location where obtained data stored Returned value: TRUE Succeeded FALSE Error Description: This function stores "size" bytes "data" from addr into "data". Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 5.2.18 _mem_put: memory value Function name: _mem_put(int addr, size, char *data) Parameter: addr Address size Number bytes char *data data Returned value: TRUE Succeeded FALSE Error Description: This function sets data "data" from "addr" into "size" bytes memory. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 5.2.19 _mem_get_endian: memory value with endian attached Function name: _mem_get_endian(int addr, num, size, *data) Parameter: addr Address Number data entries size Size data entry *data Location where obtained data stored Returned value: TRUE Succeeded FALSE Error Description: This function stores "num" entries data data size "size" bytes from "addr" into data[] according endian. Numerals specified "size". Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_DATA_RANGE size Other Simulator error 5.2.20 _mem_put_endian: memory value with endian attached Function name: _mem_put_endian(int addr, num, size, *data) Parameter: addr Address Number data entries size Size data entry *data data Returned value: TRUE Succeeded FALSE Error Description: This function sets "num" entries data data size "size" bytes from data[] into memory locations beginning with "addr" according endian Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_DATA_RANGE size Other Simulator error 5.2.21 _mem_fill: Fill memory Function name: _mem_fill(int start, end, data, size) Parameter: start Start address address data Filled data size Size data entry Returned value: TRUE Succeeded FALSE Error Description: This function fills memory area from "start" "end" with data "data" data size "size" bytes. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_DATA_RANGE "size" Other Simulator error 5.2.22 _mem_move: Transfer memory block Function name: _mem_move(int start, end, top) Parameter: start Start address address Beginning address destination transfer Returned value: TRUE Succeeded FALSE Error Description: This function transfers data addresses from "start" "end" area beginning with "top". Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_RUNNING Cannot transferred because program executing. Other Simulator error 5.2.23 _mem_clear_cache: Clear memory cache Function name: _mem_clear_cache() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function clears cache buffer module that gets cached memory. 5.2.24 _break_set: Set/enable software break Function name: _break_set(int addr) Parameter: addr address Returned value: TRUE Succeeded FALSE Error Description: This function sets software breakpoint "addr". This function also used re-enable breakpoint that been disabled _break_disable() _break_disable_all() Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_BP_FULL Breakpoints full. Other Simulator error 5.2.25 _break_get: settings software breaks Function name: _break_get(int *addr, *attr, mode) Parameter: *addr Address *attr Setup attribute mode Search start mode IN1_FIRST First breakpoint IN1_NEXT Second following breakpoints Returned value: TRUE Succeeded FALSE Error Description: This function stores breakpoint address *addr. breakpoint setup attributes shown below stored *attr. IN1_ENABLE_SBRK Enabled IN1_DISABLE_SBRK Disabled Error: ER_IN1_BP_NOTFOUND breakpoint found. Other Simulator error 5.2.26 _break_reset: Clear software break Function name: _break_reset(int addr) Parameter: addr Address Returned value: TRUE Succeeded FALSE Error Description: This function clears breakpoint "addr". Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_BP_NOTFOUND breakpoint found. Other Simulator error 5.2.27 _break_reset_all: Function name: Parameter: Returned value: Description: Error: Clear software breaks _break_reset_all() None TRUE Succeeded FALSE Error This function clears breakpoints. Other Simulator error 5.2.28 _break_disable: Disable software break Function name: _break_disable(int addr) Parameter: addr Address Returned value: TRUE Succeeded FALSE Error Description: This function disables breakpoint "addr". Error: ER_IN1_ADDR_OUTRANGE Address range invalid. ER_IN1_BP_NOTFOUND breakpoint found. Other Simulator error 5.2.29 _break_disable_all: Disable software breaks Function name: _break_disable_all() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function disables breakpoints set. Error: Other Simulator error 5.2.30 _break_enable_all: Enable software breaks Function name: _break_enable_all() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function enables breakpoints set. Error: Other Simulator error 5.2.31 _break_search: attribute software break settings Function name: _break_search(int addr, *attr) Parameter: addr Address *attr Setup attribute Returned value: TRUE Succeeded FALSE Error Description: This function gets setup attribute breakpoint "addr". following breakpoint setup attributes stored *attr. IN1_ENABLE_SBRK Enabled IN1_DISABLE_SBRK Disabled Error: ER_IN1_BP_NOTFOUND breakpoint found. Other Simulator error 5.2.32 _rram_clear: Clear monitor memory Function name: _rram_clear() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function initializes access states monitor memory. Error: ER_IN1_RUNNING Cannot cleard because program executing. Other Simulator error 5.2.33 _rram_get_area: monitor area Function name: _rram_get_area(int *addr) Parameter: *addr Beginning address Returned value: TRUE Succeeded FALSE Error Description: This function stores beginning address monitor memory *addr. Error: Simulator error 5.2.34 _rram_set_area: monitor area Function name: _rram_set_area(int addr) Parameter: addr Beginning address Returned value: TRUE Succeeded FALSE Error Description: This function sets beginning address monitor area "addr". Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 5.2.35 _rram_get_size: size monitor area Function name: _rram_get_size(int *size) Parameter: *size size monitor area Returned value: TRUE Return value always TRUE. Description: This function sets size monitor area *size. 5.2.36 _rram_get_data: monitor data Function name: _rram_get_data(int addr, size, char *data, char *attr) Parameter: addr Beginning address size Number bytes char *data Data char *attr Access state Returned value: TRUE Succeeded FALSE Error Description: This function gets "size" bytes data (*data) beginning with "addr" access state (*attr) from monitor. access states shown below stored *attr. IN1_RRAM_READ Read IN1_RRAM_WRITE Write IN1_RRAM_NONE access Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 5.2.37 _info_check_run: Function name: Parameter: Returned value: Description: Check execution status _info_check_run(int *status) *status Execution state TRUE Succeeded FALSE Error This function stores execution state target program *status. following execution status stored *status. IN1_RUN_CPU Under execution IN1_STOP_CPU Idle Simulator error Error: 5.2.38 _info_service: information service contents Function name: _info_service(int flag, *status) Parameter: flag Service content *status Availability support TRUE Supported FALSE supported Returned value: TRUE Return value always TRUE. Description: This function gets information service contents supported PD38SIM. "flag", specify following service contents. IN1_SUPPORT_BITSYM Support symbol IN1_SUPPORT_C Support C-language debugging IN1_SUPPORT_RAMMONITOR Support real-time monitor function IN1_SUPPORT_RTT Support real-time trace IN1_SUPPORT_CV Support coverage measurement IN1_SUPPORT_PROTCT Support protected break IN1_SUPPORT_EVENT Support hardware event 5.2.39 _info_cpu: information Function name: _info_cpu(int flag, *status) Parameter: flag Content information *status information IN1_BIG_ENDIAN endian IN1_LITTLE_ENDIAN Little endian Other Value corresponding flag Returned value: TRUE Return value always TRUE. Description: This function gets information target CPU. "flag", specify following information. IN1_ADDRSIZE Number bytes required storing address value IN1_MAXADDR Maximum value address IN1_ADDRCOLM Number digits with which address values displayed hexadecimal IN1_ENDIAN Endian target IN1_HWORD_SIZE Length bytes half-word IN1_WORD_SIZE Length bytes word IN1_DWORD_SIZE Length bytes double-word IN1_LWORD_SIZE Length bytes long-word IN1_MAXDATA Maximum value data IN1_MAXSTACK Maximum value stack IN1_MAX_OBJ Maximum length bytes instruction 5.2.40 _info_get_map: information Function name: _info_get_map(int *start, *end, mode) Parameter: *start Start address *end address mode Search start mode IN1_FIRST First IN1_NEXT Second following maps Returned value: TRUE Succeeded FALSE Error Description: This function gets information. start addresses mapped area stored *start *end, respectively. Error: IN1_MAP_END more 5.2.41 _info_check_map: Check mapped area Function name: _info_check_map(int start, end, *status, *erradr) Parameter: start Start address address *status Check result *erraddr Error address Returned value: TRUE Succeeded FALSE Error Description: This function checks address range from "start" "end" mapped area. address range from "start" "end" entirely mapped area, TRUE stored *status. address range from "start" "end" contains unmapped area, FALSE stored *status address first unmapped area found searching from "start" stored erraddr. Error: ER_IN1_ADDR_OUTRANGE Address range invalid. Other Simulator error 5.2.42 _info_get_suffix: load file extension Function name: _info_get_suffix(char *suffix, mode) Parameter: char *suffix Obtained extension mode Mode Returned value: TRUE Return value always TRUE. Description: This function gets file suffix that added file selection dialog when downloading target program mode specified "mode". "mode", specify following attributes. IN1_LOAD Symbol program files IN1_SYM Symbol file IN1_ROM Program file 5.2.43 _info_set_suffix: load file extension Function name: _info_set_suffix(char *suffix, mode) Parameter: char *suffix Extension mode Mode Returned value: TRUE Return value always TRUE. Description: This function sets file suffix that added file selection dialog when downloading target program mode specified "mode". "mode", specify following attributes. IN1_LOAD Symbol program files IN1_SYM Symbol file IN1_ROM Program file 5.2.44 _scope_set_obj: scope object file name Function name: _scope_set_obj(char *name) Parameter: char *name Object file name Returned value: TRUE Succeeded FALSE Error Description: This function sets current scope object file name. Error: ER_SCOPE_NOTFOUND scope found that corresponds specified object file name. 5.2.45 _scope_set_addr: Function name: Parameter: Returned value: Description: Error: scope address _scope_set_addr(int addr) addr Address TRUE Succeeded FALSE Error This function sets current scope address. ER_IN1_ADDR_OUTRANGE Address range invalid. 5.2.46 _sym_add_sym: Enter symbols Function name: _sym_add_sym(int mode, char *name, value) Parameter: mode Search mode char *name Symbol value Value Returned value: TRUE Succeeded FALSE Error Description: This function enters symbol label) "name" global symbol label). "mode", specify following types. LOAD_SYMBOL Symbol first LOAD_LABEL Label first Error: ER_LOAD_ILLEGAL_CHAR Character string contains character that cannot used symbol label. ER_LOAD_MULTIDEFINE global symbol label) same name already exists. 5.2.47 _sym_val2sym: symbol value Function name: _sym_val2sym(int mode, value, char *symbol) Parameter: mode Search mode value Value char *symbol Area which symbol stored Returned value: TRUE Succeeded FALSE Corresponding symbol could found. Description: This function searches symbol character string that corresponds value "value" stores "symbol". "mode", specify priorities search shown below. LOAD_SYMBOL Symbol first LOAD_LABEL Label first table below shows priorities search each mode. Searched symbol first Searched label first Local symbol Local label (within scope) (within scope) Global symbol Global label Local label Local symbol (within scope) (within scope) Global label Global symbol Local symbol Local label (outside scope) (outside scope) Local label Local symbol (outside scope) (outside scope) 5.2.48 _sym_sym2val: value symbol Function name: _sym_sym2val(int mode, char *symbol, *value) Parameter: mode Search mode char *symbol Symbol *value Value Returned value: TRUE Succeeded FALSE Symbol could found. Description: This function searches value that corresponds symbol character string "symbol" stores *value. specified "mode" here same _sym_val2sym(). Error: ER_LOAD_SYMBOL_NOTFOUND Symbol cannot found. 5.2.49 _sym_add_bit: Enter symbols Function name: _sym_add_bit(char *bitsym, addr, bit) Parameter: char *bitsym Symbol addr Address number Returned value: TRUE Succeeded FALSE Error Description: This function enters symbol "bitsym" global symbol. Error: ER_LOAD_ILLEGAL_CHAR Character string contains character that cannot used symbol. ER_LOAD_MULTIDEFINE global symbol same name already exists. ER_LOAD_ADDR_OUTRANGE Address range invalid. ER_LOAD_BIT_OUTRANGE number range invalid. 5.2.50 _sym_val2 bit: symbol address number Function name: _sym_val2bit(int addr, bit, char *bitsym) Parameter: addr Address number char *bitsym Area which symbol stored Returned value: TRUE Succeeded FALSE Corresponding symbol could found. Description: This function searches symbol character string that corresponds "address" "bit" stores *bitsym. 5.2.51 _sym_bit2val: address number symbol Function name: _sym_bit2val(char *bitsym, *addr, *bit) Parameter: char *bitsym symbol *addr Address *bit number Returned value: TRUE Succeeded FALSE symbol could found. Description: This function searches address number that corresponds symbol character string "bitsym" stores *addr *bit. Error: ER_LOAD_SYMBOL_NOTFOUND symbol cannot found. 5.2.52 _line_addr2line: source line address Function name: _line_addr2line(int addr, *line, char *filename) Parameter: addr Address *line Line number char *filename Area where file name stored Returned value: TRUE Succeeded FALSE Source line information cannot found. Description: This function gets line number (*line) that corresponds address "addr" file name (filename). Error: ER_LOAD_FILE_NOTFOUND File cannot found. ER_LOAD_SRCINF_NOTFOUND Source information cannot found. 5.2.53 _line_line2addr: address source line Function name: _line_line2addr(char *filename, line, *addr) Parameter: char *filename File name line Line number *addr Address Returned value: TRUE Succeeded FALSE Source line information cannot found. Description: This function gets address (*addr) that corresponds line (line) file (filename). Error: ER_LOAD_LINE_NOTFOUND Line information cannot found. 5.2.54 _src_get_name: list source file names Function name: _src_get_name(char *objname, char *srcname, mode) Parameter: char *objname Object file name char *srcname Area where source file name stored mode Search start mode LOAD_FIRST First source file name LOAD_NEXT Second following source file names Returned value: TRUE Succeeded FALSE Source file name cannot found. Description: This function gets list source file names object file "objname". NULL specified "objname", list source file names object files obtained. 5.2.55 _obj_get_name: list object file names Function name: _obj_get_name(char *objname, mode) Parameter: char *objname Area where object file name stored mode Search start mode LOAD_FIRST First source file name LOAD_NEXT Second following source file names Returned value: TRUE Succeeded FALSE Object file name cannot found. Description: This function gets list object file names. 5.2.56 _obj_addr2obj: object file name address Function name: _obj_addr2obj(int addr, char *objname) Parameter: addr Address char *objname Area where object file name stored Returned value: TRUE Succeeded FALSE Corresponding object file name cannot found. Description: This function gets object file name "objname" that contains address "addr". 5.2.57 _func_get_name: list function names Function name: _func_get_name(char *objname, char *funcname, mode) Parameter: char *objname Object file name char *funcname Area where function name stored mode Search start mode LOAD_FIRST First function name LOAD_NEXT Second following function names Returned value: TRUE Succeeded FALSE Function name cannot found. Description: This function gets list function names object file "objname". NULL specified "objname", FALSE returned. 5.2.58 _exp_eval: Evaluate assembler expression Function name: _exp_eval(char *exp, radix, mode, *value) Parameter: char *exp Assembler expression radix Radix mode Priorities which symbols (labels) evaluated *value Area where analysis result stored Returned value: TRUE Succeeded FALSE Error Description: This function evaluates assembler expression (exp) stores evaluation result *value. "radix", specify radices constants shown below. EXP_DEC Decimal EXP_HEX Hexadecimal EXP_DEFAULT Value RADIX command used mode, specify priorities symbol (label) evaluation shown below. EXP_SYMBOL Symbol first EXP_LABEL Label first Error: ER_EXP_SYNTAX Syntax error ER_EXP_ZERO Divide-by-0 error ER_EXP_LPAR Left parenthesis missing ER_EXP_SIZE Incorrect size specifier ER_EXP_STRING Character string terminated ER_EXP_LINE Incorrect line number specified ER_EXP_VALUE Incorrect constant value specified ER_EXP_UNDEF_SYMBOL Symbol defined ER_EXP_PREFIX Incorrect radix constant specified ER_EXP_OVER Constant value range ER_EXP_UNDEF_MACRO Macro constant defined ER_EXP_ILLEGAL_MACRO Register name used macro variable name ER_EXP_OUTOF_MACRO Limit number macro constants exceeded 5.2.59 _scri_echo_on: Turn output script window Function name: _scri_echo_on() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function turns output Script Window default, Script Window enabled output. 5.2.60 _scri_echo_off: Turn output script window Function name: _scri_echo_off() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function turns output Script Window off. 5.2.61 _c_exp_eval: Evaluate C-language expression Function name: _c_exp_eval(char *exp, *value1, *value2, char *type, char *str, char *misc) Parameter: char *exp C-language expression *value1 Analysis result *value2 Analysis result char *type Character string showing type analysis result char *str Character string showing analysis result char *misc Character string showing added information analysis result Returned value: TRUE Succeeded FALSE Error Description: This function analyzes C-language expression specified "exp" current scope. analysis result 64-bit value, with low-order bits stored *value1 highorder bits stored *value2. type name analysis result stored "type" analysis result stored "str" after being converted into character string. analysis result that indicates ordinary value such function, addition information stored "misc". information stored "type", "str", "misc" output display using printf() function same possible with script command "print". Error: ER_CEXP_NOT_FOUND Symbol cannot found. ER_CEXP_SYNTAX_ERROR Syntax error. ER_CEXP_NO_SCOPE Scope cannot found. ER_CEXP_NO_SYMBOL Symbol cannot found. ER_CEXP_NO_FUNC Function cannot found. ER_CEXP_RIGHT_WRONG Right-side expression inappropriate. ER_CEXP_DEF_TYPE Copying different type structure (union) inhibited. ER_CEXP_CANT_ASSIGNCannot substituted. ER_CEXP_NO_TYPE Type cannot found. ER_CEXP_CANT_FLOAT Floating-point operation supported. ER_CEXP_CANT_P_TO_P Specified operation cannot performed between pointer types. ER_CEXP_CANT_SUB_P Specified operation cannot performed pointer type. ER_CEXP_CANT_P Subtraction pointer variable cannot performed. ER_CEXP_0_DIV Divide-by-0 attempted. ER_CEXP_UNKNOWN_OP Invalid operator used. ER_CEXP_BROKEN_TYPE Type information broken. ER_CEXP_LEFT_POINT Left-side value must pointer variable. ER_CEXP_LEFT_STRUCT Left-side value must structure (union) type. ER_CEXP_NO_MEMBER Member cannot found. ER_CEXP_LEFT_STRUCT_REF Left-side value must refarence structure (union) type. ER_CEXP_LEFT_WRONG Left-side value inappropriate. ER_CEXP_VAL_NUM Operand must numeric value. ER_CEXP_CANT_MIN Specified operand cannot signinverted. ER_CEXP_CANT_REF Address value cannot obtained. ER_CEXP_LEFT_ARRAY Array variable inappropriate. ER_CEXP_RIGHT_NUM Element numbers array inappropriate. ER_CEXP_NOT_POINT Operand address. ER_CEXP_CANT_CAST_REG Cast operation variables supported. ER_CEXP_CANT_CAST Specified type cast inappropriate. ER_CEXP_CAST_NOT_SUPPORT Cast operation specified type supported. 5.2.62 _get_shared_mem: shared variable Function name: _get_shared_mem(char *name, char *value) Parameter: char *name Name shared variable char *value Value shared variable Returned value: TRUE Succeeded FALSE Shared variable cannot found. Description: This function searches shared variable specified "name" stores value (character string) "value". shared variable means variable that used common custom command custom window programs. name value shared variable character string used similar manner environment variables found several operation systems. name value shared variable used bytes. 5.2.63 _set_shared_mem: shared variable Function name: _set_shared_mem(char *name, char *value) Parameter: char *name Name shared variable char *value Value shared variable Returned value: TRUE Return value always TRUE. Description: This function sets shared variable specified "name" value specified "value". value shared variable that already been set, previously value changed value specified "value". shared variable defined, variable area allocated. 5.2.64 _delete_shared_mem: Delete shared variable Function name: _delete_shared_mem(char *name) Parameter: char *name Name shared variable Returned value: TRUE Return value always TRUE. Description: This function deletes shared variable that specified "name". shared variable defined, nothing performed. 5.2.65 _get_err_msg: PD38SIM error message statement Function name: _get_err_msg(int err_no, char *msg) Parameter: err_no Error number char *msg Error message statement Returned value: TRUE Succeeded FALSE Error Error message statement corresponding error number cannot found. Description: This function gets PD38SIM's error message statement that corresponds error number specified "err_no". 5.2.66 _get_tick_count: Function name: Parameter: Returned value: Description: elapsed time since Windows startup _get_tick_count() None Elapsed time since Windows startup This function gets elapsed time since Windows started 5.2.67 _get_time: current system date time Function name: _get_time(int *year, *month, *dayOfWeek, *day, *hour, *minute, *secont, *milliseconds) Parameter: *year Location where current year stored *month Location where current month (112) stored *dayOfWeek Location where current week (e.g., Sunday stored *day Location where current (1-31) stored *hour Location where current time hours (1-24) stored *minute Location where current time minutes (0-59) stored *second Location where current time seconds (0-59) stored *milliseconds Location where current time milliseconds (0-999) stored Returned value: TRUE Return value always TRUE. Description: This function gets current date time system stores them locations specified each parameter. NULL specified parameter, information corresponding that parameter stored. 5.2.68 _disp_src_line: Change contents displayed program window Function name: disp_src_line(int lineno, char *filename, addr) Parameter: lineno Line number char *filename File name addr Address Returned value: TRUE Succeeded FALSE Error Description: This function updates contents displayed PD38SIM's program window. selected line selected (specified "lineno" "filename") displayed program window source mode. selected line selected source file cannot displayed, file displayed disassemble mode beginning with address specified "addr". 5.2.69 _cv_get_data: coverage data Function name: _cv_get_data(int saddr, eaddr, *rsaddr, *readdr, char *data) Parameter: saddr Start address data obtained eaddr address data obtained *rsaddr Start address data actually obtained *readdr address data actually obtained char *data Coverage data obtained Returned value: TRUE Succeeded FALSE Error Description: This function stores coverage data that includes address range specified "s_addr" "e_addr" area specified "data". However, since data bytes addresses from each 8-byte alignment stored byte "data", happen that greater range data than addresses specified "s_addr" "e_addr" actually stored. example, addresses from specified, data addresses from actually stored. start addresses actually obtained data stored *rs_addr *re_addr, respectively. Note that values stored *rs_addr *re_addr obtained calculation using formula below. *rs_addr s_addr *re_addr e_addr "data", specify array greater than e_addr s_addr format coverage data stored byte "data" follows: (Upper row: offset; Lower row: address offset) example, "s_addr" 0x400, coverage results addresses offset amount corresponding each stored "data[0]" shown below. (Upper row: offset; Lower row: Address) Consequently, memory accessed every other byte beginning with "s_addr", coverage data stored shown below. (Upper row: offset; Lower row: Coverage measurement result) data stored data[0] 01010101B, i.e., 0x55. Error: ER_IN2_ADDR_OUTRANGE ER_IN2_RUNNING Other Specified address range. Cannot obtained because program executing. Simulator error 5.2.70 _cv_set_data: coverage data Function name: _cv_set_data(int s_addr, e_addr, char *data) s_addr start address e_addr address char *data coverage data Returned value: TRUE Succeeded FALSE Error Description: This function sets coverage data stored area specified "data" range addresses specified "s_addr" "e_addr". However, since coverage data stored byte "data" bytes addresses, specify values "s_addr" "e_addr" increments bytes. format "data" same _cv_get_data() function described above. Error: ER_IN2_ADDR_OUTRANGE Specified address range. ER_IN2_RUNNING Cannot because program executing. Other Simulator error 5.2.71 _cv_clear_data: Clear coverage data Function name: _cv_clear_data() Parameter: None Returned value: TRUE Succeeded FALSE Error Description: This function clears coverage data. Error: ER_IN2_RUNNING Cannot cleared because program executing. Other Simulator error 5.2.72 _cv_clear_cache: Function name: Parameter: Returned value: Description: Clear coverage cache _cv_clear_cache() None TRUE Return value always TRUE. This function clears coverage cache. Parameter: 5.2.73 _syscom: Execute PD38SIM script command Function name: _syscom(char *command) Parameter: char *command Character string PD38SIM script command Returned value: TRUE Succeeded FALSE Error Description: This function executes character string specified "command" script command PD38SIM. script command that dumps range addresses from 1000H 1FFFH, example, specify this function follows: _syscom("DumpByte 1000, 1FFF"); 5.2.74 _doscom: Execute Function name: Parameter: Returned value: Description: command _doscom(char *command) char *command Character string command TRUE Succeeded FALSE Error This function executes character string specified "command" command. command that redirects output result file after specifying option command DOS, specify this function follows: _doscom("DIR TMP"); 5.2.75 List Simulator Errors table below lists error numbers that stored global variable "macro_err" when system call function returns FALSE. Error number ER_IN2_MCU_RESET ER_IN2_ERROR_2 ER_IN2_ERROR_3 ER_IN2_ERROR_4 ER_IN2_ERROR_5 ER_IN2_ERROR_6 ER_IN2_ERROR_7 ER_IN2_ARG_ERROR ER_IN2_ERROR_9 ER_IN2_ERROR_G ER_IN2_ERROR_H ER_IN2_ERROR_I ER_IN2_ERROR_M ER_IN2_MCU_RUN Description Target reset. Checksum error found received data Specified data does exist. Target program executing. Target program idle. Measurement already been stopped. Measurement already being executed. Argument error. Measurement completed. Number points exceeds valid range. break set. source line information loaded. Function range setting. Target execution error. System Call Functions Window Operation (winlib.lib) winlib.lib provides window-operating functions that used custom window programs. prototype declaration each function written winlib.h. Function name _win_printf _win_puts _win_set_cursor _win_set_color _win_set_bkcolor _win_column2dot _draw_text_out _draw_set_color _draw_set_bkcolor _draw_set_bkmode _draw_set_font _draw_get_char_size _draw_line _draw_fill_rect _draw_frame_rect _draw_invert_rect _draw_arc _draw_pie _win_redraw _win_redraw_clear _win_redraw_item _win_show_window _win_set_window_title _win_enable_window _win_button_create _win_button_set_text _win_hscroll_range _win_hscroll_pos _win_vscroll_range _win_vscroll_pos _win_statusbar_create _win_statusbar_set_pane _win_statusbar_set_text _win_dialog _win_message_box _win_filedialog _win_set_window_pos _win_set_window_size _win_timer_set _win_timer_kill Description Output text with format included Output character string custom window cursor position text color background color Convert cursor coordinates into pixel coordinates Output character string custom window text color background color background mode font font size Draw line Fill rectangle Draw rectangle Reverse rectangle color Draw ellipse Draw sector Redraw custom window Redraw custom window Redraw control item Show/hide control item title custom window Enable/disable control item Create button Change button text scroll range horizontal scroll position horizontal scroll scroll range vertical scroll position vertical scroll Create status items status text status Create input dialog Create message Create file selection dialog position custom window size custom window system timer Reset system timer 5.3.1 _win_printf: Output text with format included Function name: _win_printf(char *format Parameter: char *forma Format Variable parameter Returned value: Number characters output Description: This function outputs characters cursor position custom window after converting them under control "format" using text color specified _win_set_color() function background color specified _win_set_bkcolor() function. cursor position immediately following last character that output. cursor position desired place using _win_set_cursor() function. Note that only character font FIXED_SYS used. 5.3.2 _win_puts: Output Function name: Parameter: Returned value: Description: character string custom window _win_puts(char *str) char *str Output character string TRUE Return value always TRUE. This function outputs character string specified cursor position customer window using text color specified _win_set_color() function background color specified _win_set_bkcolor() function. cursor position immediately following last character that output. cursor position desired place using _win_set_cursor() function. Note that only character font FIXED_SYS used. 5.3.3 _win_set_cursor: cursor position Function name: _win_set_cursor(int Parameter: Specified column cursor Specified column cursor Returned value: TRUE Return value always TRUE. Description: This function moves cursor position specified cursor position defined with origin upper left corner client area custom window, columns increasing from there right columns increasing from there bottom. character output column. 5.3.4 _win _set_color: text color _win_set_color(int color) Parameter: color Text color Returned value: Previous text color Description: This function sets color specified "color" text. text color specified this function used when character string output using _win_printf() _win_puts() functions. "color", specify color constants listed below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 5.3.5 _win _set_bkcolor: Function name: Parameter: Returned value: Description: background color _win_set_bkcolor(int color) color Background color text Previous background color This function sets color specified "color" current background. text color specified this function used when character string output using _win_printf() _win_puts() functions. "color", specify color constants listed below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 5.3.6 _win_column2dot: Convert cursor coordinates into pixel coordinates Function name: _win_column2dot(int xcol, ycol, *xpix, *ypix) Parameter: xcol column ycol column *xpix pixel coordinate column position *ypix pixel coordinate column position Returned value: TRUE Return value always TRUE. Description: This function converts cursor coordinates specified xcol ycol into pixel coordinates stores them *xpix *ypix. 5.3.7 _draw_text_out: Output character string custom window Function name: _draw_text_out(int char *str) Parameter: Logical coordinate start point text Logical coordinate start point text char *str Pointer character string drawn Returned value: TRUE Return value always TRUE. Description: Using currently selected font, this function writes character string specified position using text color specified _draw_set_color() function background color specified _draw_set_bkcolor() function. 5.3.8 _draw_set_color: text color Function name: _draw_set_color(int color) Parameter: color Text color Returned value: Previous text color Description: This function sets color specified "color" text. text color specified this function used when character string output using _draw_text_out() function. "color", specify color constants listed below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 5.3.9 _draw_set_bkcolor: background color Function name: _draw_set_bkcolor(int color) Parameter: color Background color text Returned value: Previous background color Description: This function sets color specified "color" current background. background color specified this function used when character string output using _draw_text_out() function. "color", specify color constants listed below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray background mode "Fill" mode, system fills space between style-specified lines, space between brushed hatch lines, background character cells with background color. 5.3.10 _draw_set_bkmode: background mode Function name: _draw_set_bkmode(int flag) Parameter: flag mode Returned value: TRUE Return value always TRUE. Description: This function sets background mode. Specify whether want area filled with background color before drawing text. TRUE specified flag, background filled with current background color (default). FALSE specified flag, background changed before drawing text. 5.3.11 _draw_set_font: font Function name: _draw_set_font(int size, font) Parameter: size Font size font Font constant Returned value: TRUE Return value always TRUE. Description: This function specifies size style current drawing font. "font", specify some following font constants combined with Font constant Font style FONT_FIXED_SYS "FixedSys" FONT_MINTYO mincho" FONT_GOTHIC Gothic"" FONT_TIMESNEWROMAN "Times Roman" FONT_CENTURY "Century" FONT_ARIAL "Arial" FONT_BOLD Bold FONT_ITALIC Italic 5.3.12 _draw_get_char_size: font size Function name: _draw_get_char_size(int *pWidth, *pHeight) Parameter: *pWidth Location where character width stored *pHeight Location where character height stored Returned value: TRUE Return value always TRUE. Description: This function gets size font character currently being set. 5.3.13 _draw_line: Draw line Function name: _draw_line(int color) Parameter: Starting coordinate line Starting coordinate line Ending coordinate line coordinate line color Color line Returned value: TRUE Return value always TRUE. Description: This function draws line with specified color between specified coordinate points. "color" specify color constants shown below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 5.3.14 _draw_fill_rect: Fill rectangle Function name: _draw_fill_rect(int color) Parameter: Upper left coordinate rectangle Upper left coordinate rectangle Lower right coordinate rectangle Lower right coordinate rectangle color Color with which fill Returned value: TRUE Return value always TRUE. Description: This function draws rectangle filled with specified color with upper left lower right corners specified coordinates. "color" specify color constants shown below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 5.3.15 _draw_frame_rect: Draw rectangle Function name: _draw_frame_rect(int color) Parameter: Upper left coordinate rectangle Upper left coordinate rectangle Lower right coordinate rectangle Lower right coordinate rectangle color Color rectangle Returned value: TRUE Return value always TRUE. Description: This function draws lines form rectangle filled with specified color with upper left lower right corners specified coordinates. color specify color constants shown below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 5.3.16 _draw_invert_rect: Reverse rectangle color Function name: _draw_invert_rect(int Parameter: Upper left coordinate rectangle Upper left coordinate rectangle Lower right coordinate rectangle Lower right coordinate rectangle Returned value: TRUE Return value always TRUE. Description: This function reverses color rectangle with upper left lower right corners specified coordinates. 5.3.17 _draw_arc: Draw ellipse Function name: _draw_arc(int color) Parameter: Upper left coordinate boundary rectangle (logical unit) Upper left coordinate boundary rectangle (logical unit) Lower right coordinate boundary rectangle (logical unit) Lower right coordinate boundary rectangle (logical unit) coordinate starting point draw (logical unit) coordinate starting point draw (logical unit) coordinate ending point draw (logical unit) coordinate ending point draw (logical unit) color Color Returned value: TRUE Succeeded FALSE Error Description: This function draws ellipse. Specify coordinates boundary rectangle (x1, (x2, starting point (x3, ending point (x4, arc. starting ending points need line arc. line that links specified starting point center boundary rectangle calculated starting point calculated from ending point calculated same way. "color" specify color constants shown below. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 5.3.18 _draw_pie: Draw sector Function name: _draw_pie(int framecolor, paintcolor) Parameter: Upper left coordinate boundary rectangle (logical unit) Upper left coordinate boundary rectangle (logical unit) Lower right coordinate boundary rectangle (logical unit) Lower right coordinate boundary rectangle (logical unit) coordinate starting point draw sector (logical unit) coordinate starting point draw sector (logical unit) coordinate ending point draw sector (logical unit) coordinate ending point draw sector (logical unit) framecolor Color framing line sector paintcolor Color with which fill sector Returned value: TRUE Succeeded FALSE Error Description: This function draws sector. Define circumferential circle sector boundary rectangle ellipse (x1, (x2, y2). framecolor paintcolor, specify following color constants. Color constant Color COLOR_BLACK Black COLOR_BLUE Blue COLOR_GREEN Green COLOR_CYAN blue COLOR_RED COLOR_MAGENDA Purple COLOR_YELLOW Yellow COLOR_WHITE White COLOR_GRAY Gray COLOR_DKBLUE Dark blue COLOR_DKGREEN Dark green COLOR_DKCYAN Dark blue COLOR_DKRED Dark COLOR_DKMAGENDA Dark purple COLOR_DKYELLOW Dark yellow COLOR_LTGRAY Light gray 5.3.19 _win_redraw Redraw custom window Function name: _win_redraw() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function redraws custom window without erasing display. 5.3.20 _win_redraw_clear: Redraw custom window Function name: _win_redraw_clear() Parameter: None Returned value: TRUE Return value always TRUE. Description: This function redraws custom window after erasing display. 5.3.21 _win_redraw_item Redraw control item Function name: _win_redraw_item(int handle) Parameter: handle Handle control item Returned value: TRUE Return value always TRUE. Description: This function redraws control item specified "handle" (e.g., button). 5.3.22 _win_show_window: Show/hide control item Function name: _win_show_window(int handle, flag) Parameter: handle Handle control item flag TRUE: Displayed FALSE: displayed Returned value: TRUE Return value always TRUE. Description: This function specifies whether display control item specified "handle" (e.g., button). specified control item displayed when TRUE specified "flag" displayed when FALSE specified. 5.3.23 _win_set_window_title: title custom window Function name: _win_set_window_title(char *title) Parameter: char *title Window title Returned value: TRUE Return value always TRUE. Description: This function sets character string specified "title" title custom window. 5.3.24 _win_enable_window: Enable/disable control item Function name: _win_enable_window(int handle, flag) Parameter: handle Handle control item flag TRUE: Enabled FALSE: Disabled Returned value: TRUE Return value always TRUE. Description: This function specifies state control item specified "handle" (e.g., button). specified control item enabled when TRUE specified "flag" disabled when FALSE specified. When disabled, control item displayed gray. 5.3.25 _win_button_create: Create button Function name: _win_button_create(int x1,int y1,int x2,int char *str,int Parameter: Upper left coordinate button Upper left coordinate button Lower right coordinate button Lower right coordinate button char *str Button control text Button control Returned value: Handle button Description: This function creates button area specified that displays text specified surface. control specified "id" sent message handler argument OnCommand() handle function when button clicked. 5.3.26 _win_button_set_text: Change button text Function name: _win_button_set_text(int handle. char *text) Parameter: handle Handle button char *text Button control text Returned value: TRUE Succeeded FALSE Error Description: This function changes text displayed button specified "handle" that specified text. 5.3.27 _win_hscroll_range: scroll range horizontal scroll Function name: _win_hscroll_range(int min, max) Parameter: Minimum scroll position horizontal scroll Maximum scroll position horizontal scroll Returned value: TRUE Return value always TRUE. Description: This function specifies minimum maximum scroll positions horizontal scroll custom window. specified both max, horizontal scroll displayed. default, horizontal scroll hidden, with both parameters recommended scroll range 100. 5.3.28 _win_hscroll_pos: Function name: Parameter: Returned value: Description: position horizontal scroll _win_hscroll_pos(int pos) position horizontal scroll TRUE Return value always TRUE. This function sets current position horizontal scroll custom window redraws scroll make position horizontal scroll box. position must within scroll range. 5.3.29 _win_vscroll_range: scroll range vertical scroll Function name: _win_vscroll_range(int min, max) Parameter: Minimum scroll position vertical scroll Maximum scroll position vertical scroll Returned value: TRUE Return value always TRUE. Description: This function specifies minimum maximum scroll positions vertical scroll custom window. specified both "min" max, vertical scroll displayed. default, vertical scroll hidden, with both parameters recommended scroll range 100. 5.3.30 _win_vscroll_pos: Function name: Parameter: Returned value: Description: position vertical scroll _win_vscroll_pos(int pos) position vertical scroll TRUE Return value always TRUE. This function sets current position vertical scroll custom window redraws scroll make position vertical scroll box. position must within scroll range. 5.3.31 _win_statusbar_create: Create status Function name: _win_statusbar_create(int cnt) Parameter: Number items status Returned value: TRUE Return value always TRUE. Description: This function creates status bottom custom window. cnt, number items this status bar. 5.3.32 _win_statusbar_set_pane: items status Function name: _win_statusbar_set_pane(int index, style, size) Parameter: index Index number status item style Style item size Size item pixels) Returned value: TRUE Return value always TRUE. Description: This function sets style specified "style" size specified "size" item created status that specified "index". style, specify styles shown below. Style Description SBPS_NOBORDERS Does have boundary line round pane. SBPS_POPOUT boundary line displayed inverse video with text raised surface. SBPS_DISABLED Does draw text. SBPS_NORMAL Neither stretched inverted. Does have boundary line either. SBPS_STRETCH Stretches pane fill unused space. Only pane this style allowed status bar. This style combined with some other style using 5.3.33 _win_statusbar_set_text: text status Function name: _win_statusbar_set_text(tint index, char *text) Parameter: index Index number status item char *text Text displayed status Returned value: TRUE Return value always TRUE. Description: This function sets text displayed status item. 5.3.34 _win_dialog: Create input dialog Function name: _win_dialog(char *str, char *buf) Parameter: char *str Character string message displayed char *buf Location where obtained character string stored Returned value: TRUE button pressed FALSE Cancel button pressed Description: This function opens input dialog gets line character string. 5.3.35 _win_message_box: Create message Function name: _win_message_box(char *str, char *title, style) Parameter: char *str Message displayed char *title Title message style Operation content message Returned value: Execution result functions shown below Value Meaning sufficient memory IDABORT [Stop] button selected IDCANCEL [Cancel] button selected IDIGNORE [Ignore] button selected IDNO [No] button selected IDOK [OK] button selected IDRETRY [Retry] button selected IDYES [Yes] button selected Description: This function creates message box. style, specify following styles combined with Style Description MB_ABORTRETRYIGNORE Message contains three pushbuttons: [Stop], [Retry], [Ignore]. MB_APPLMODAL Operation PD38SIM/CB38SIM stopped until message responded (default). MB_DEFBUTTON1 First button default. first button always default unless MB_DEFBUTTON2 MB_DEBUTTON3 specified. MB_DEFBUTTON2 Second button default. MB_DEFBUTTON3 Third button default. MB_ICONEXCLAMATION Exclamation mark icon displayed message box. MB_ICONHAND Same MB_ICONSTOP. MB_ICONINFORMATION Icon with lowercase circle displayed message box. MB_ICONQUESTION Question mark icon displayed message box. MB_ICONSTOP [STOP] icon displayed message box. MB_OK Message contains [OK] pushbutton. MB_OKCANCEL Message contains [OK] [Cancel] pushbuttons. MB_RETRYCANCEL Message contains [Retry] [Cancel] pushbuttons MB_SYSTEMMODAL applications suspended until user responds message box. this message inform serious potentially dangerous errors (e.g., memory shortage) that require immediate corrective action. Style(continued from preceding page) MB_YESNO MB_YESNOCANCEL Description Message contains pushbuttons: [Yes] [No]. Message contains three pushbuttons: [Yes], [No], [Cancel]. 5.3.36 _win_filedialog: Create file selection dialog Function name _win_filedialog(char *title, openFileDialog, char *defExt, char *defFileName, flags, char *filter, char *fileName) Parameter: char *title Title dialog openFileDialog Specification open save char *defExt Default file name extension char *defFileName Default file name flags Flag customize dialog char *filter Specify filter char *fileName Destination where acquired file name store Returned value: TRUE button pressed. FALSE Cancel button pressed. Description: This function creates file selection dialog gets selected file name. "title", specify title dialog box. openFileDialog, specify TRUE when building dialog "Open file" FALSE when building dialog "Save file after giving name." "defExt", specify file name extension want automatically added when file name input file name edit without adding extension. extension added specify NULL here. defFileName, specify file name that displayed first file name entering edit box. file name displayed specify NULL here. "flags", specify styles shown below combining them with Flag OFN_ALLOWMULTISELECT Description This flag specifies that multiple choices selected "File name" list box. (When create dialog using private template, LBS_EXTENDEDSEL value must specified definition "File name" list box.) Flag OFN_CREATEPROMPT OFN_FILEMUSTEXIST OFN_HIDEREADONLY OFN_NOCHANGEDIR OFN_NONETWORKBUTTON OFN_NOREADONLYRETURN OFN_NOTESTFILECREATE OFN_OVERWRITEPROMPT Description This flag specifies that specified file cannot found, user asked confirm whether file need created dialog function. (This flag sets OFN_PATHMUSTEXIST OFN_FILEMUSTEXIST flags automatically.) This flag specifies that user only input existing file name "File name" entry field. invalid file name input "File name" entry field user when this flag set, dialog function displays warning message box. When this flag set, OFN_PATHMUSTEXIST also. This flag turns (hides) [Read-only] check box. This flag directs dialog reset current directory that selected when calling dialog box. This flag turns [Network] button disable from being used. This flag specifies that [Read-only] check returned file checked, that file placed writeprotected directory. This flag specifies that file created before closing dialog box. This flag must application saves file network-shared point that "Created corrected." application sets this flag, library does longer check whether file write-protected, disk capacity available, drive door open, whether network protected. Once file closed while this state, cannot reopened. Therefore, applications that this flag must handle files with caution. selected file already exists, this flag causes dialog "Saving file after giving name" generate message box. user must confirm whether file overwritten. Flag OFN_PATHMUSTEXIST OFN_READONLY Description This flag specifies that user only input valid path. invalid path input "File name" entry field user when this flag set, dialog function displays warning message box. When creating dialog box, this flag ensures that [Read-only] check default checked. also indicates status [Read-only] check when dialog closed. filter, specify pair character strings specify filters that identify file using format shown below. example below, filters (*.m;*.h) (*.*) specified. "Files(*.m;*.h)|*.m;*.h|All Files(*.*)|*.*||" Once filters specified, file list displays only selected ones, with others gone. selected file name stored FileName. multiple files selected cases when selection multiple files allowed, space character stored delimiter. 5.3.37 _win_set_window_pos: position custom window Function name: _win_set_window_pos(int Parameter: left-side position custom window upper-side position custom window Returned value: TRUE Succeeded FALSE Error Description: This function changes position custom window. 5.3.38 _win_set_window_size: size custom window Function name: _win_set_window_size(int Parameter: width custom window height custom window Returned value: TRUE Succeeded FALSE Error Description: This function changes size custom window. 5.3.39 _win_timer_set: system timer Function name: _win_timer_set(int nId, nElapse) Parameter: Timer identifier other than nElapse Time-out value Returned value: TRUE Succeeded FALSE Error Description: This function sets system timer that timer identifier specified nID. time-out value specified, that each time timer times out, system stores timer identifier value parameter nIDEvent calls OnTimer() handler function. reset timer, _win_timer_kill() function. 5.3.40 _win_timer_kill: Function name: Parameter: Returned value: Description: Reset system timer _win_timer_kill(int nId) Timer identifier other than TRUE Succeeded FALSE Error This function resets system timer specified nID. Handle Functions Custom Window Handle functions written framework that automatically generated CB38SIM when creating project custom window creation mode. These functions called when custom window receives message from Windows. table below lists handle functions. Handle function name OnChar OnCommand OnCreate OnDestroy OnDraw OnEvent OnHScroll OnKeyDown OnKeyUp OnLButtonDblClk OnLButtonDown OnLButtonUp OnMouseMove OnRButtonDblClk OnRButtonDown OnRButtonUp OnSize OnTimer OnVScroll Description When that converted into ASCII character code pressed, this function called following OnKeyDown() handle function. Called when command message received. Called when window creation requested. Called when window destruction requested. Called when window redrawing requested. Called when PD38SIM event received. Called when horizontal scroll clicked. Called when other than system keys pressed. Called when other than system keys released. Called when left mouse button double-clicked. Called when left mouse button pressed. Called when left mouse button released. Called when mouse cursor moved. Called when right mouse button double-clicked. Called when right mouse button pressed. Called when right mouse button released. Called when window size changed. Called when time-out interval informed elapsed time timer. Called when vertical scroll clicked. 5.4.1 Specifications Data Passed Handle Functions handle function called when custom window receives message from Windows. When calling handle function, custom window stores information attached message area indicated global variable _HandleMsgBlock make referencible from handle function. following shows example information passed handle function global variable _HandleMsgBlock. extern char OnSize() _HandleMsgBlock[32]; nType; Message data cx:; Message data Message data Restore message data nType ((int*)_HandleMsgBlock)[0]; ((int*)_HandleMsgBlock)[1]; ((int*)_HandleMsgBlock)[2]; Write message handler code hear, please. beginning handle function, information stored _HandleMsgBlock stored local variable handle function. Once this processing made, information passed handle function referenced variable. information passed handle functions varies with each handle function. contents these processing written framework default. 5.4.2 Char Handle Function Function name: OnChar Description: When that converted into ASCII character code pressed, this function called following OnKeyDown() handle function. Data: information stored _HandleMsgBlock shown below: ASCII character code bytes Repeat count bytes Flag(unused) bytes Variables: variables _HandleMsgBlock shown below. nChar ASCII character code value nRepCntRepeat count value indicating number times stroke generated while held down. nFlags used this version. 5.4.3 OnCommand Handle Function Function name: OnCommand Description: This function called when command message received from Windows. Data: information stored _HandleMsgBlock shown below: Command bytes Advice me Other recent searchesTX024400JI - TX024400JI TX024400JI Datasheet TPC8056-H - TPC8056-H TPC8056-H Datasheet SB100-05J - SB100-05J SB100-05J Datasheet S5N8950 - S5N8950 S5N8950 Datasheet NDC631N - NDC631N NDC631N Datasheet MCR703A - MCR703A MCR703A Datasheet MCR706A - MCR706A MCR706A Datasheet MCR704A - MCR704A MCR704A Datasheet MCR708A - MCR708A MCR708A Datasheet MC33363 - MC33363 MC33363 Datasheet K4J55323QF-GC - K4J55323QF-GC K4J55323QF-GC Datasheet FQPF8N60CF - FQPF8N60CF FQPF8N60CF Datasheet
Privacy Policy | Disclaimer |