📄 commands.c
字号:
case 'q': help_ptr = help_q; if (strcmp(token[1], "qon") == 0) help_ptr = help_qoff; else if (strcmp(token[1], "qoff") == 0) help_ptr = help_qoff; break; case 'r': help_ptr = help_r; break; case 's': help_ptr = help_s; if (strcmp(token[1], "sid") == 0) help_ptr = help_sid; break; case 't': help_ptr = help_t; if (strcmp(token[1], "tip") == 0) help_ptr = help_tip; break; case 'x': help_ptr = help_x; break; case 'y': help_ptr = help_y; break; case 'z': help_ptr = help_zc; if (strcmp(token[1], "ze") == 0) help_ptr = help_ze; else if (strcmp(token[1], "zl") == 0) help_ptr = help_zl; break; default: help_ptr = help_main; break; } /* end switch */ else /* Too many parameters */ return (EMSYNTAX); i=0; while (*help_ptr[i] != '\0') { fprintf(stderr, "\n%s", help_ptr[i]); if (io_config.echo_mode == (INT32) TRUE) fprintf (io_config.echo_file, "\n%s", help_ptr[i]); i=i+1; } /* end while */ fprintf(stderr, "\n"); if (io_config.echo_mode == (INT32) TRUE) fprintf(io_config.echo_file, "\n"); return (SUCCESS); } /* end help_cmd() *//*** This command toggles control of the keyboard between** TERM_USER and TERM_29K.**** IMPORTANT NOTE** This command is no longer used. It was an attempt to** toggle control between the host and the target when the** target is displaying output and accepting input.** The UDI methodology allows this control to be handled by the** UDIWait procedures. Hence, this io_toggle_cmd is not used.** It is left here only as an historical anomoly**** The i command is now used for ix, ia, il the 2903x cashe** which is contained in the monitor.c code.** END OF IMPORTANT NOTE*/INT32io_toggle_cmd(token, token_count) char *token[]; int token_count; { if ((strcmp(token[0], "io_toggle") != 0) || (token_count != 1)) return (EMSYNTAX); if (io_config.io_control == TERM_29K) io_config.io_control = TERM_USER; else if (io_config.io_control == TERM_USER) io_config.io_control = TERM_29K; else return(EMFAIL); fprintf(stderr, "%s\n", io_control_name[io_config.io_control]); if (io_config.echo_mode == (INT32) TRUE) fprintf(io_config.echo_file, "%s\n", io_control_name[io_config.io_control]); return(0); } /* end io_toggle_cmd() *//*** This command send a BREAK message to the target. This** should halt execution of user code. A HALT message should** be returned by the target. This function deos not, however,** wait for the HALT message.*/INT32kill_cmd(token, token_count) char *token[]; int token_count; { int result; INT32 retval; result = -1; if ((strcmp(token[0], "k") != 0) || (token_count != 1)) return (EMSYNTAX); if ((retval = Mini_break()) != SUCCESS) { return(FAILURE); }; return(SUCCESS); } /* end kill_cmd() *//*** This command send a RESET message to the target. This** should restart the target code. A HALT message should** be returned by the target. This function deos not, however,** wait for the HALT message.*/INT32reset_cmd(token, token_count) char *token[]; int token_count; { int result; INT32 retval; result = -1; if ((strcmp(token[0], "r") != 0) || (token_count != 1)) return (EMSYNTAX); if ((retval = Mini_reset_processor()) != SUCCESS) { return(FAILURE); } else return(SUCCESS); } /* end reset_cmd() *//*** This command is used to display the versions of the various** MINIMON 29K modules. First the version of the host code and** its date is printed from the global data structure "host_config".** Next the montip version field and date is printed from** the VERSION_SPACE UDIRead call. This is an ascii zero terminated ** field of ** less than 11 characters.** Next the "version" field in the "target_config" data structure is** printed. This "version field is encoded as follows:**** Bits 0 - 7: Target debug core version** Bits 8 - 15: Configuration version** Bits 16 - 23: Message system version** Bits 24 - 31: Communication driver version**** Each eight bit field is further broken up into two four bit** fields. The first four bits is the "release" number, the** second is the "version" number. This is typically printed** as <version>.<release>. i.e. version=2, release=6 is** printed as "2.6".***//*** The os version number is coded into the eighth word of the **configuration message. It is in the lower 8 bits. ** Bits 0 - 7: OS version ***/INT32version_cmd(token, token_count) char *token[]; int token_count; { int comm_version; int message_version; int config_version; int debug_core_version; char tip_version[12]; char tip_date[12]; int os_version; /* eighth word of config message */ INT32 junk; char prtbuf[256]; INT32 retval; if ((strcmp(token[0], "ver") != 0) || (token_count != 1)) return (EMSYNTAX);/* byte count is 40 because 4 bytes for target version 4 bytes for os version 12 bytes for tip version 12 bytes for tip date 4 for msgbuf size 4 for max bkpts */ if ((retval = Mini_read_req ((INT32) VERSION_SPACE, (ADDR32) 0, (INT32) 1, (INT16) 40, (INT32 *) &junk, (BYTE *) &(versions_etc.version), TRUE)) != SUCCESS) return (FAILURE); comm_version = (int) ((versions_etc.version >> 24) & 0x00ff); message_version = (int) ((versions_etc.version >> 16) & 0x00ff); config_version = (int) ((versions_etc.version >> 8) & 0x00ff); debug_core_version = (int) ((versions_etc.version) & 0x00ff); strcpy(tip_version,versions_etc.tip_version); strcpy(tip_date,versions_etc.tip_date); os_version = (int) ((versions_etc.os_version ) & 0x00ff); sprintf(&prtbuf[0], "\n"); sprintf(&prtbuf[strlen(prtbuf)], "\n"); sprintf(&prtbuf[strlen(prtbuf)], " MiniMON29K R3.0\n"); if (io_config.echo_mode == (INT32) TRUE) fprintf (io_config.echo_file, "%s", &prtbuf[0]); fprintf (stderr, "%s", &prtbuf[0]); sprintf(&prtbuf[0], " Copyright 1993 Advanced Micro Devices, Inc.\n"); sprintf(&prtbuf[strlen(prtbuf)], "\n"); if (io_config.echo_mode == (INT32) TRUE) fprintf (io_config.echo_file, "%s", &prtbuf[0]); fprintf (stderr, "%s", &prtbuf[0]); sprintf(&prtbuf[0], "\t Host code:\n"); sprintf(&prtbuf[strlen(prtbuf)], "\t\t Version %s\n", host_config.version); sprintf(&prtbuf[strlen(prtbuf)], "\t\t Date: %s\n", host_config.date); sprintf(&prtbuf[strlen(prtbuf)], "\n"); if (io_config.echo_mode == (INT32) TRUE) fprintf (io_config.echo_file, "%s", &prtbuf[0]); fprintf (stderr, "%s", &prtbuf[0]); sprintf(&prtbuf[0], "\t Tip code:\n"); sprintf(&prtbuf[strlen(prtbuf)], "\t\t Version %s\n", tip_version); sprintf(&prtbuf[strlen(prtbuf)], "\t\t Date: %s\n", tip_date); sprintf(&prtbuf[strlen(prtbuf)], "\n"); if (io_config.echo_mode == (INT32) TRUE) fprintf (io_config.echo_file, "%s", &prtbuf[0]); fprintf (stderr, "%s", &prtbuf[0]); sprintf(&prtbuf[0], "\t Target code:\n"); sprintf(&prtbuf[strlen(prtbuf)], "\t\t Debug core version: %d.%d\n", ((debug_core_version >> 4) & 0x0f), (debug_core_version & 0x0f)); sprintf(&prtbuf[strlen(prtbuf)], "\t\t Configuration version: %d.%d\n", ((config_version >> 4) & 0x0f), (config_version & 0x0f)); sprintf(&prtbuf[strlen(prtbuf)], "\t\t Message system version: %d.%d\n", ((message_version >> 4) & 0x0f), (message_version & 0x0f)); sprintf(&prtbuf[strlen(prtbuf)], "\t\t Communication driver version: %d.%d\n", ((comm_version >> 4) & 0x0f), (comm_version & 0x0f)); sprintf(&prtbuf[strlen(prtbuf)], "\t\t OS system version: %d.%d\n", ((os_version >> 4) & 0x0f), (os_version & 0x0f)); sprintf(&prtbuf[strlen(prtbuf)], "\n"); if (io_config.echo_mode == (INT32) TRUE) fprintf (io_config.echo_file, "%s", &prtbuf[0]); fprintf (stderr, "%s", &prtbuf[0]); fprintf(stderr, "Maximum message buffer size on target: 0x%lx\n",versions_etc.max_msg_size); if (io_config.echo_mode == (INT32) TRUE) fprintf(io_config.echo_file, "Maximum message buffer size on target: 0x%lx\n",versions_etc.max_msg_size); fprintf(stderr, "Maximum number of breakpoints on target: %ld\n", versions_etc.max_bkpts); if (io_config.echo_mode == (INT32) TRUE) fprintf(io_config.echo_file, "Maximum message buffer size on target: 0x%lx\n",versions_etc.max_msg_size); return (SUCCESS); } /* end version_cmd() */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -