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.
 
 
 
 
 

34 lines
687 B

  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 <stddef.h>
  6. #include <stdint.h>
  7. #include <stdio.h>
  8. /* Structs */
  9. struct Line {
  10. char *data;
  11. size_t length;
  12. size_t lineno;
  13. struct Line *next;
  14. };
  15. typedef struct Line Line;
  16. typedef struct {
  17. Line *lines;
  18. char *filename;
  19. } LineBuffer;
  20. typedef struct ErrorInfo ErrorInfo;
  21. /* Functions */
  22. void error_info_print(const ErrorInfo*, FILE*);
  23. void error_info_destroy(ErrorInfo*);
  24. size_t assemble(const LineBuffer*, uint8_t**, ErrorInfo**);
  25. bool assemble_file(const char*, const char*);