Cleanup of autoconf files
[emu8051.git] / src / cli / parser.y
index 1cb282c..dc42613 100644 (file)
@@ -9,6 +9,7 @@
 #include "menu.h"
 #include "memory.h"
 #include "timers.h"
+#include "memory.h"
 #include "cpu8051.h"
 
 /* int yydebug = 1; */
@@ -42,16 +43,16 @@ int yyerror(const char *str)
 %token TOK_UNASM
 %token TOK_MOD_EXT TOK_MOD_INT TOK_MOD_PROG TOK_MOD_REG
 %token TOK_QUIT
+%token TOK_A TOK_B TOK_C TOK_D
 
 %%
 
-start  :  start command { menu_prompt(); }
+start  :  start command
    |  error TOK_ENTER {
          /* In case of error, discard entire line */
          yyerrok;
-         menu_prompt();
       }
-   | start TOK_ENTER { menu_prompt(); }
+   | start TOK_ENTER
    |
    ;
 
@@ -85,19 +86,19 @@ breakpoint_clr:
        TOK_RB NUMBER TOK_ENTER
        {
           log_debug("  Remove breakpoint at $%04X", $2);
-          ClearBreakpoint($2);
+          breakpoint_clr($2);
        }
         |
        TOK_RB TOK_ENTER
        {
           log_debug("  Remove breakpoint at PC");
-          ClearBreakpoint(cpu8051.pc);
+          breakpoint_clr(cpu8051.pc);
        }
         |
        TOK_RB TOK_ALL TOK_ENTER
        {
           log_debug("  Remove all breakpoints");
-          ClearAllBreakpoints();
+          breakpoints_clr_all();
        }
        ;
 
@@ -105,22 +106,22 @@ breakpoint_set:
        TOK_SB TOK_ENTER
        {
           log_debug("  Set breakpoint at PC");
-          SetBreakpoint(cpu8051.pc);
+          breakpoint_set(cpu8051.pc);
        }
         |
 
        TOK_SB NUMBER TOK_ENTER
        {
           log_debug("  Set breakpoint at $%04X", $2);
-          SetBreakpoint($2);
-       }
+          breakpoint_set($2);
+        }
        ;
 
 breakpoint_display:
        TOK_DB TOK_ENTER
        {
           log_debug("  Display breakpoints");
-          ShowBreakpoints();
+          breakpoints_show();
        }
        ;
 
@@ -128,19 +129,19 @@ dump_mem:
        TOK_DE NUMBER NUMBER TOK_ENTER
        {
           log_debug("  Dump External Data Memory at $%04X, len %d", $2, $3);
-          DumpMem($2, $3, EXT_MEM_ID);
+          mem_dump($2, $3, EXT_MEM_ID);
        }
         |
        TOK_DI NUMBER NUMBER TOK_ENTER
        {
           log_debug("  Dump Internal Data Memory at $%04X, len %d", $2, $3);
-          DumpMem($2, $3, INT_MEM_ID);
+          mem_dump($2, $3, INT_MEM_ID);
        }
         |
        TOK_DP NUMBER NUMBER TOK_ENTER
        {
           log_debug("  Dump Program Memory at $%04X, len %d", $2, $3);
-          DumpMem($2, $3, PGM_MEM_ID);
+          mem_dump($2, $3, PGM_MEM_ID);
        }
        ;
 
@@ -156,24 +157,24 @@ modify:
        TOK_MOD_EXT NUMBER NUMBER TOK_ENTER
        {
           log_debug("  Modify external memory");
-          memory_write8(EXT_MEM_ID, $2, $3);
+          mem_write8(EXT_MEM_ID, $2, $3);
        }
        |
        TOK_MOD_INT NUMBER NUMBER TOK_ENTER
        {
           log_debug("  Modify internal memory");
-          memory_write8(INT_MEM_ID, $2, $3);
+          mem_write8(INT_MEM_ID, $2, $3);
        }
        |
        TOK_MOD_PROG NUMBER NUMBER TOK_ENTER
        {
           log_debug("  Modify program memory");
-          memory_write8(PGM_MEM_ID, $2, $3);
+          mem_write8(PGM_MEM_ID, $2, $3);
        }
        |
        TOK_MOD_REG WORD NUMBER TOK_ENTER
        {
-          SetRegister($2, $3);
+          register_set($2, $3);
        }
        ;
 
@@ -209,12 +210,27 @@ help:
 reset:
        TOK_RST TOK_ENTER
        {
-          cpu8051_Reset();
+          cpu8051_reset();
+       }
+        |
+       TOK_RST_TIMER TOK_A TOK_ENTER
+       {
+          gp_timer_reset(0);
+       }
+        |
+       TOK_RST_TIMER TOK_B TOK_ENTER
+       {
+          gp_timer_reset(1);
+       }
+        |
+       TOK_RST_TIMER TOK_C TOK_ENTER
+       {
+          gp_timer_reset(2);
        }
         |
-       TOK_RST_TIMER TOK_ENTER
+       TOK_RST_TIMER TOK_D TOK_ENTER
        {
-          gp_timer_reset();
+          gp_timer_reset(3);
        }
         ;
 
@@ -228,18 +244,18 @@ step:
 unasm:
        TOK_UNASM NUMBER NUMBER TOK_ENTER
        {
-          DisasmN($2, $3);
+          disassemble_num($2, $3);
        }
         |
        TOK_UNASM NUMBER TOK_ENTER
        {
-          DisasmN(cpu8051.pc, $2);
+          disassemble_num(cpu8051.pc, $2);
        }
        ;
         |
        TOK_UNASM TOK_ENTER
        {
-          DisasmN(cpu8051.pc, 16);
+          disassemble_num(cpu8051.pc, 16);
        }
        ;