code_51.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*******************************************************************************
  2. * Emu51
  3. * code_51.h:
  4. * Created by mlt on 22/03/23.
  5. ******************************************************************************/
  6. #ifndef EMU51_CODE_51_H
  7. #define EMU51_CODE_51_H
  8. #include <stdint.h>
  9. class code_51
  10. {
  11. public:
  12. char mnem[6]; // instruction mnemonic (2-4 characters)
  13. uint8_t code; // instruction code
  14. uint8_t length; // bytes which are needed to write this instruction into memory
  15. uint8_t cycles; // time unit
  16. char display_string[20]; // string which is ready for displaying, it's made by make_ds(WORD) method
  17. char datas[12]; // string which contains datas which will be displayed after mnemonic
  18. void make_ds(uint16_t); // make display string
  19. void process(); // process the instruction
  20. };
  21. extern code_51 asm51[256];
  22. extern unsigned long c_time;
  23. uint8_t check_C(void);
  24. uint8_t check_AC(void);
  25. uint8_t check_OV(void);
  26. uint8_t check_P(void);
  27. void set_C(void);
  28. void clr_C(void);
  29. void set_Bit(uint8_t bit);
  30. void clr_Bit(uint8_t bit);
  31. #endif /* EMU51_CODE_51_H */