diff options
Diffstat (limited to 'src/core/arm/arm_interface.h')
| -rw-r--r-- | src/core/arm/arm_interface.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 4dfe0570b..9fdc7ba3c 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -17,12 +17,20 @@ public: | |||
| 17 | ~ARM_Interface() { | 17 | ~ARM_Interface() { |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | /** | ||
| 21 | * Runs the CPU for the given number of instructions | ||
| 22 | * @param num_instructions Number of instructions to run | ||
| 23 | */ | ||
| 24 | void Run(int num_instructions) { | ||
| 25 | ExecuteInstructions(num_instructions); | ||
| 26 | m_num_instructions += num_instructions; | ||
| 27 | } | ||
| 28 | |||
| 20 | /// Step CPU by one instruction | 29 | /// Step CPU by one instruction |
| 21 | void Step() { | 30 | void Step() { |
| 22 | ExecuteInstruction(); | 31 | Run(1); |
| 23 | m_num_instructions++; | ||
| 24 | } | 32 | } |
| 25 | 33 | ||
| 26 | /** | 34 | /** |
| 27 | * Set the Program Counter to an address | 35 | * Set the Program Counter to an address |
| 28 | * @param addr Address to set PC to | 36 | * @param addr Address to set PC to |
| @@ -68,8 +76,11 @@ public: | |||
| 68 | 76 | ||
| 69 | protected: | 77 | protected: |
| 70 | 78 | ||
| 71 | /// Execture next instruction | 79 | /** |
| 72 | virtual void ExecuteInstruction() = 0; | 80 | * Executes the given number of instructions |
| 81 | * @param num_instructions Number of instructions to executes | ||
| 82 | */ | ||
| 83 | virtual void ExecuteInstructions(int num_instructions) = 0; | ||
| 73 | 84 | ||
| 74 | private: | 85 | private: |
| 75 | 86 | ||