+/*
+* Disassemble code from memory
+*
+* Usage:
+* disassemble address [# of lines]
+*
+ */
+command_ret_t do_disas(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
+{
+ (void) cmdtp;
+
+ /* We use the last specified parameters, unless new ones are
+ * entered.
+ */
+ uint32_t addr = disas_last_addr;
+ int length = 16;
+ int ret = CMD_RET_SUCCESS;
+
+ if (argc < 2)
+ return CMD_RET_USAGE;
+
+ if ((flag & CMD_FLAG_REPEAT) == 0) {
+ /* Address is specified since argc > 1 */
+ addr = eval_arg(argv[1], NULL);
+ addr += base_address;
+
+ /* If another parameter, it is the length (Number of lines) to display. */
+ if (argc > 2)
+ length = (int) eval_arg(argv[2], NULL);
+ }
+
+ z80_bus_request_or_exit();
+ clear_ctrlc(); /* forget any previous Control-C */
+ for (; length > 0; --length) {
+ addr = dis_decode(addr);
+ if (had_ctrlc() || ctrlc()) {
+ ret = CMD_RET_FAILURE;
+ break;
+ }
+ }
+ z80_bus_cmd(Release);
+ disas_last_addr = addr;
+
+ return ret;
+}
+