x86_64.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* tripl/arch/x86_64/do_keyword.c
  2. *
  3. * This file is part of tripl.
  4. *
  5. * tripl is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * tripl is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with tripl. If not, see <https://www.gnu.org/licenses/>
  17. */
  18. /* gas x86_64 assembly, to stdout */
  19. #include <stdio.h>
  20. #include <klist.h>
  21. #include <tripl/tripl.h>
  22. #include <tripl/limits.h>
  23. #include <tripl/arch.h>
  24. int x86_64_init(void);
  25. int x86_64_fin(void);
  26. int x86_64_new_var(char *name, long value, int attr);
  27. int x86_64_set_var(char *name, long value, int attr);
  28. int x86_64_math_expr(char *s, char *name);
  29. struct arch x86_64_arch_fn = {
  30. .arch_init = x86_64_init,
  31. .arch_fin = x86_64_fin,
  32. .arch_new_var = x86_64_new_var,
  33. .arch_dump = NULL,
  34. .arch_import_shared = NULL,
  35. .arch_funcall = NULL,
  36. .arch_set_var = x86_64_set_var,
  37. .arch_math_expr = x86_64_math_expr
  38. };
  39. extern int x86_64_init_asm(void);
  40. extern int x86_64_asm_fin(void);
  41. __arch int x86_64_init(void) {
  42. return x86_64_init_asm();
  43. }
  44. __arch int x86_64_fin(void) {
  45. x86_64_asm_fin();
  46. return 0;
  47. }