Add overflow and auxiliary carry flags manipulation functions
[emu8051.git] / src / emuconsole.c
index a3f563c..f29bbc5 100644 (file)
@@ -33,6 +33,8 @@
 #include "hexfile.h"
 #include "keyboard.h"
 
+extern struct options_t options;
+
 /* Capitalize all letters in buffer */
 static void
 Capitalize(char *buffer)
@@ -154,7 +156,7 @@ console_show_registers(void)
               "   -   P |\n");
        printf("| %.4X | %.2X | %.4X |  %.2X | %.2X |", cpu8051.pc,
               cpu8051_ReadD(_SP_),
-              (cpu8051_ReadD(_DPTRHIGH_) << 8) + cpu8051_ReadD(_DPTRLOW_),
+              memory_sfr_read_dptr(),
               cpu8051_ReadD(_ACC_), cpu8051_ReadD(_B_));
        printf("        %d   %d   %d   %d   %d   %d   %d   %d |",
               (PSW >> 7) & 1, (PSW >> 6) & 1, (PSW >> 5) & 1, (PSW >> 4) & 1,
@@ -451,22 +453,16 @@ TooMuchParameters:
 int
 main(int argc, char **argv)
 {
-       char *hex_file;
-
-       ParseCommandLineOptions(argc, argv);
+       parse_command_line_options(argc, argv);
 
        cpu8051_init();
 
-       hex_file = get_hex_filename();
-
-       if (hex_file != NULL)
-               LoadHexFile(hex_file);
+       if (options.filename != NULL)
+               LoadHexFile(options.filename);
 
        console_main();
 
-#ifdef EMU8051_DEBUG
-       printf("End of program.\n");
-#endif
+       log_info("Terminate");
 
        return 0;
 }