An emulator, assembler, and disassembler for the Sega Game Gear
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parse_util.h 1.4 KiB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. #pragma once
  4. #include <stdbool.h>
  5. #include <stdint.h>
  6. #include "inst_args.h"
  7. #include "state.h"
  8. #define dparse__Bool dparse_bool
  9. /* Functions */
  10. /* General parsers */
  11. bool parse_bool(bool*, const char*, ssize_t);
  12. bool parse_uint32_t(uint32_t*, const char*, ssize_t);
  13. bool parse_string(char**, size_t*, const char*, ssize_t);
  14. bool parse_bytes(uint8_t**, size_t*, const char*, ssize_t);
  15. /* Instruction argument parsers */
  16. bool argparse_register(ASMArgRegister*, const char*, ssize_t);
  17. bool argparse_condition(ASMArgCondition*, const char*, ssize_t);
  18. bool argparse_immediate(ASMArgImmediate*, const char*, ssize_t);
  19. bool argparse_indirect(ASMArgIndirect*, const char*, ssize_t);
  20. bool argparse_indexed(ASMArgIndexed*, const char*, ssize_t);
  21. bool argparse_label(ASMArgLabel*, const char*, ssize_t);
  22. /* Preprocessor directive parsers */
  23. bool dparse_bool(bool*, const ASMLine*, const char*);
  24. bool dparse_uint32_t(uint32_t*, const ASMLine*, const char*);
  25. bool dparse_uint16_t(uint16_t*, const ASMLine*, const char*);
  26. bool dparse_uint8_t(uint8_t*, const ASMLine*, const char*);
  27. bool dparse_rom_size(uint32_t*, const ASMLine*, const char*);
  28. bool dparse_region_string(uint8_t*, const ASMLine*, const char*);
  29. bool dparse_size_code(uint8_t*, const ASMLine*, const char*);