--- mon/src/mon.cpp 2002/07/17 10:00:54 1.18 +++ mon/src/mon.cpp 2003/09/27 20:30:44 1.21 @@ -52,7 +52,7 @@ extern "C" { #include "mon_lowmem.h" #ifndef VERSION -#define VERSION "2" +#define VERSION "3" #endif @@ -267,11 +267,22 @@ static void read_line(char *prompt) line_read = readline(prompt); - if (line_read && *line_read) - add_history(line_read); + if (line_read) { + + if (*line_read) + add_history(line_read); + + strncpy(in_ptr = input, line_read, INPUT_LENGTH); + input[INPUT_LENGTH-1] = 0; - strncpy(in_ptr = input, line_read, INPUT_LENGTH); - input[INPUT_LENGTH-1] = 0; + } else { + + // EOF, quit cxmon + fprintf(monout, "x\n"); + input[0] = 'x'; + input[1] = 0; + in_ptr = input; + } #else fprintf(monout, prompt); fflush(monout); @@ -1017,6 +1028,7 @@ void mon_init(void) mon_add_command("d80", disassemble_z80, "d80 [start [end]] Disassemble Z80 code\n"); mon_add_command("d86", disassemble_80x86_32, "d86 [start [end]] Disassemble 80x86 (32-bit) code\n"); mon_add_command("d8086", disassemble_80x86_16, "d8086 [start [end]] Disassemble 80x86 (16-bit) code\n"); + mon_add_command("d8664", disassemble_x86_64, "d8664 [start [end]] Disassemble x86-64 code\n"); mon_add_command(":", modify, ": start string Modify memory\n"); mon_add_command("f", fill, "f start end string Fill memory\n"); mon_add_command("y", apply_byte, "y[b|h|w] start end expr Apply expression to memory\n");