mescc: Tinycc support: Support bit-fields.
[mes.git] / module / mes / as-i386.scm
1 ;;; -*-scheme-*-
2
3 ;;; Mes --- Maxwell Equations of Software
4 ;;; Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 ;;;
6 ;;; This file is part of Mes.
7 ;;;
8 ;;; Mes is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; Mes is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with Mes.  If not, see <http://www.gnu.org/licenses/>.
20
21 ;;; Commentary:
22
23 ;;; as-i386.scm defines i386 assembly
24
25 ;;; Code:
26
27 (define-module (mes as-i386)
28   #:use-module (mes guile)
29   #:use-module (mes as)
30   #:export (
31             i386:accu%base
32             i386:accu*base
33             i386:accu*n->label
34             i386:accu*n->local
35             i386:accu+accu
36             i386:accu+base
37             i386:accu+value
38             i386:accu->base
39             i386:accu->base-mem
40             i386:byte-accu->base-mem
41             i386:word-accu->base-mem
42             i386:accu->base-mem+n
43             i386:byte-accu->base-mem+n
44             i386:word-accu->base-mem+n
45             i386:accu->label
46             i386:accu->local
47             i386:accu->local+n
48             i386:byte-accu->local+n
49             i386:word-accu->local+n
50             i386:accu->local+n
51             i386:accu-and
52             i386:accu-and-base
53             i386:accu-and-base-mem
54             i386:accu-base
55             i386:accu-cmp-value
56             i386:accu-mem-add
57             i386:accu-mem->base-mem
58             i386:accu-negate
59             i386:accu-not
60             i386:accu-or-base
61             i386:accu-or-base-mem
62             i386:accu-shl
63             i386:accu-test
64             i386:accu-xor-base
65             i386:accu-zero?
66             i386:accu/base
67             i386:accu<->stack
68             i386:accu<<base
69             i386:accu>>base
70             i386:base+value
71             i386:base->accu
72             i386:base->accu-mem
73             i386:base->label
74             i386:base-mem->accu-mem
75             i386:base-mem+n->accu
76             i386:base-mem->accu
77             i386:base-sub
78             i386:byte-accu->base-mem
79             i386:word-accu->base-mem
80             i386:byte-base->accu-mem
81             i386:byte-base->accu-mem+n
82             i386:byte-base-mem->accu
83             i386:byte-base-sub
84             i386:byte-local->accu
85             i386:word-local->accu
86             i386:byte-local->base
87             i386:byte-mem->accu
88             i386:word-mem->accu
89             i386:byte-mem->base
90             i386:byte-sub-base
91             i386:byte-test-base
92             i386:call-accu
93             i386:call-label
94             i386:formal
95             i386:function-locals
96             i386:function-preamble
97             i386:jump
98             i386:jump
99             i386:jump-byte-z
100             i386:jump-g
101             i386:jump-ge
102             i386:jump-l
103             i386:jump-le
104             i386:jump-nz
105             i386:jump-z
106             i386:label->accu
107             i386:label->base
108             i386:label-mem->accu
109             i386:label-mem->base
110             i386:label-mem-add
111             i386:local->accu
112             i386:local->base
113             i386:local-add
114             i386:local-address->accu
115             i386:local-address->accu
116             i386:local-address->base
117             i386:local-ptr->accu
118             i386:local-ptr->base
119             i386:local-test
120             i386:mem+n->accu
121             i386:byte-mem+n->accu
122             i386:word-mem+n->accu
123             i386:mem->accu
124             i386:mem->base
125             i386:nop
126             i386:nz->accu
127             i386:pop-accu
128             i386:pop-base
129             i386:push-accu
130             i386:push-base
131             i386:push-byte-local-de-de-ref
132             i386:push-byte-local-de-ref
133             i386:push-word-local-de-ref
134             i386:push-label
135             i386:push-label-mem
136             i386:push-local
137             i386:push-local-address
138             i386:push-local-de-ref
139             i386:ret
140             i386:ret-local
141             i386:sub-base
142             i386:test-base
143             i386:value->accu
144             i386:value->accu-mem
145             i386:value->accu-mem+n
146             i386:value->base
147             i386:value->label
148             i386:value->local
149             i386:xor-accu
150             i386:xor-zf
151             i386:g?->accu
152             i386:ge?->accu
153             i386:l?->accu
154             i386:le?->accu
155             i386:z->accu
156             ))
157
158 (cond-expand
159  (guile-2)
160  (guile
161   (use-modules (ice-9 syncase)))
162  (mes))
163
164 (include-from-path "mes/as-i386.mes")