9c5fd4398349287af1757bd40189c1744ac16c0f
[mes.git] / module / mes / as-i386.scm
1 ;;; -*-scheme-*-
2
3 ;;; Mes --- Maxwell Equations of Software
4 ;;; Copyright © 2016,2017 Jan 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 elf)
29   #:export (
30             i386:accu-not
31             i386:accu-cmp-value
32             i386:accu->base
33             i386:accu->base-address
34             i386:accu->base-address+n
35             i386:accu->global
36             i386:accu->global-address
37             i386:accu->local
38             i386:accu-non-zero?
39             i386:accu-test
40             i386:accu-zero?
41             i386:accu+accu
42             i386:accu+base
43             i386:accu+value
44             i386:accu/base
45             i386:accu%base
46             i386:accu*base
47             i386:accu-base
48             i386:accu-shl
49             i386:base-sub
50             i386:base->accu
51             i386:base->accu-address
52             i386:byte-accu->base-address
53             i386:base->global
54             i386:base->local
55             i386:base-mem->accu
56             i386:byte-base-sub
57             i386:byte-base->accu-address
58             i386:byte-base->accu-address+n
59             i386:byte-base-mem->accu
60             i386:local-address->accu
61             i386:byte-local->accu
62             i386:byte-mem->accu
63             i386:base-mem+n->accu
64             i386:byte-mem->base
65             i386:byte-test-base
66             i386:byte-sub-base
67             i386:call
68             i386:call-accu
69             i386:formal
70             i386:function-locals
71             i386:function-preamble
72             i386:global-add
73             i386:global->accu
74             i386:global->base
75             i386:global-address->accu
76             i386:global-address->base
77             i386:jump
78             i386:jump
79             i386:jump-byte-nz
80             i386:jump-byte-z
81             i386:jump-c
82             i386:jump-cz
83             i386:jump-le
84             i386:jump-nc
85             i386:jump-ncz
86             i386:jump-nz
87             i386:jump-z
88             i386:local->accu
89             i386:local->base
90             i386:local-add
91             i386:local-address->accu
92             i386:local-ptr->accu
93             i386:local-ptr->base
94             i386:local-address->base
95             i386:local-test
96             i386:mem->accu
97             i386:mem+n->accu
98             i386:pop-accu
99             i386:push-accu
100             i386:pop-base
101             i386:push-base
102             i386:push-global
103             i386:push-global-address
104             i386:push-local
105             i386:push-local-de-ref
106             i386:push-local-address
107             i386:ret
108             i386:ret-local
109             i386:sub-base
110             i386:test-base
111             i386:test-jump-z
112             i386:value->accu
113             i386:value->accu-address
114             i386:value->accu-address+n
115             i386:value->global
116             i386:value->local
117             i386:value->base
118             i386:xor-accu
119             i386:xor-zf
120
121             ;; long jump
122             i386:Xjump
123             ;;i386:Xjump-c
124             ;;i386:Xjump-cz
125             i386:Xjump-nc
126             i386:Xjump-ncz
127
128             i386:Xjump-nz
129             i386:Xjump-z
130
131             i386:Xjump-g
132             i386:Xjump-ge
133
134             ;; i386:Xjump-l
135             ;; i386:Xjump-le
136
137             i386:XXjump
138
139             i386:accu+n
140             i386:base+n
141             i386:base-address->accu-address
142             ))
143
144 (include-from-path "mes/as-i386.mes")