Skip to content

Commit

Permalink
LC3: Change #define flags to be enums private in the LC3 simulator cl…
Browse files Browse the repository at this point in the history
…ass.
  • Loading branch information
mikeakohn committed Dec 17, 2023
1 parent db2ace1 commit a39a953
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions simulate/lc3.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

#include "simulate/Simulate.h"

#define FLAG_PRIV 0x8000
#define FLAG_N 0x0004
#define FLAG_Z 0x0002
#define FLAG_P 0x0001

class SimulateLc3 : public Simulate
{
public:
Expand All @@ -41,6 +36,14 @@ class SimulateLc3 : public Simulate
int execute(uint16_t opcode);
int get_reg_index(const char *reg_string);

enum Flags
{
FLAG_PRIV = 0x8000,
FLAG_N = 0x0004,
FLAG_Z = 0x0002,
FLAG_P = 0x0001
};

uint16_t reg[8];
uint16_t pc;
uint16_t psr;
Expand Down

0 comments on commit a39a953

Please sign in to comment.