info.scm 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ;;; GNU Mes --- Maxwell Equations of Software
  2. ;;; Copyright © 2018,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Mes.
  5. ;;;
  6. ;;; GNU Mes is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Mes is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  18. ;;; Commentary:
  19. ;;; Initialize MesCC as i386/x86 compiler
  20. ;;; Code:
  21. (define-module (mescc i386 info)
  22. #:use-module (mescc info)
  23. #:use-module (mescc i386 as)
  24. #:export (x86-info))
  25. (define (x86-info)
  26. (make <info> #:types i386:type-alist #:registers i386:registers #:instructions i386:instructions))
  27. (define i386:registers '("eax" "ebx" "ecx" "edx" "esi" "edi"))
  28. (define i386:type-alist
  29. `(("char" . ,(make-type 'signed 1 #f))
  30. ("short" . ,(make-type 'signed 2 #f))
  31. ("int" . ,(make-type 'signed 4 #f))
  32. ("long" . ,(make-type 'signed 4 #f))
  33. ("default" . ,(make-type 'signed 4 #f))
  34. ("*" . ,(make-type 'unsigned 4 #f))
  35. ("long long" . ,(make-type 'signed 4 #f))
  36. ("long long int" . ,(make-type 'signed 4 #f))
  37. ("void" . ,(make-type 'void 1 #f))
  38. ("signed char" . ,(make-type 'signed 1 #f))
  39. ("unsigned char" . ,(make-type 'unsigned 1 #f))
  40. ("unsigned short" . ,(make-type 'unsigned 2 #f))
  41. ("unsigned" . ,(make-type 'unsigned 4 #f))
  42. ("unsigned int" . ,(make-type 'unsigned 4 #f))
  43. ("unsigned long" . ,(make-type 'unsigned 4 #f))
  44. ("unsigned long long" . ,(make-type 'unsigned 4 #f))
  45. ("unsigned long long int" . ,(make-type 'unsigned 4 #f))
  46. ("float" . ,(make-type 'float 4 #f))
  47. ("double" . ,(make-type 'float 4 #f))
  48. ("long double" . ,(make-type 'float 4 #f))
  49. ("short int" . ,(make-type 'signed 2 #f))
  50. ("unsigned short int" . ,(make-type 'unsigned 2 #f))
  51. ("long int" . ,(make-type 'signed 4 #f))
  52. ("unsigned long int" . ,(make-type 'unsigned 4 #f))))