do_keyword.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. extern int x86_64_init_asm(void);
  25. extern int x86_64_do_asm(char *s, char c);
  26. extern int x86_64_asm_fin(void);
  27. extern struct klist_node globvars;
  28. int x86_64_init(void) {
  29. klist_init(&globvars);
  30. klist_init(&stack);
  31. return x86_64_init_asm();
  32. }
  33. int x86_64_do_keyword(char *s, char c) {
  34. x86_64_do_asm(s, c);
  35. return 0;
  36. }
  37. int x86_64_fin(void) {
  38. x86_64_asm_fin();
  39. return 0;
  40. }