dc020a295cb3eeed2a99402526cdf840cccb754c
[mes.git] / module / mes / libc-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 ;;; libc-i386.mes defines C library routines
24
25 ;;; Code:
26
27 (define-module (mes libc-i386)
28   #:use-module (srfi srfi-1)
29   #:use-module (mes elf)
30   #:export (
31             i386:accu-not
32             i386:accu-cmp-value
33             i386:accu->global
34             i386:accu->local
35             i386:accu-non-zero?
36             i386:accu-test
37             i386:accu-zero?
38             i386:accu+accu
39             i386:accu+base
40             i386:accu-shl
41             i386:base-sub
42             i386:base->accu
43             i386:base->accu-ref
44             i386:base-mem->accu
45             i386:byte-base-sub
46             i386:byte-base->accu-ref
47             i386:byte-base-mem->accu
48             i386:byte-local->accu
49             i386:byte-mem->accu
50             i386:base-mem+n->accu
51             i386:byte-mem->base
52             i386:byte-test-base
53             i386:byte-sub-base
54             i386:call
55             i386:formal
56             i386:function-locals
57             i386:function-preamble
58             i386:global->accu
59             i386:global->base
60             i386:jump
61             i386:jump
62             i386:jump-byte-nz
63             i386:jump-byte-z
64             i386:jump-c
65             i386:jump-cz
66             i386:jump-le
67             i386:jump-nc
68             i386:jump-ncz
69             i386:jump-nz
70             i386:jump-z
71             i386:local->accu
72             i386:local->base
73             i386:local-add
74             i386:local-address->accu
75             i386:local-ref->base
76             i386:local-test
77             i386:push-accu
78             i386:push-global
79             i386:push-global-ref
80             i386:push-local
81             i386:push-local-de-ref
82             i386:push-local-ref
83             i386:ret
84             i386:ret-local
85             i386:sub-base
86             i386:test-base
87             i386:test-jump-z
88             i386:value->accu
89             i386:value->accu-ref
90             i386:value->accu-ref+n
91             i386:value->global
92             i386:value->local
93             i386:value->base
94             i386:xor-accu
95             i386:xor-zf
96
97             i386:Xjump
98             i386:Xjump-nz
99
100             ;; libc
101             i386:exit
102             i386:open
103             i386:read
104             i386:write
105             ))
106
107 (cond-expand
108  (guile-2)
109  (guile
110   (use-modules (ice-9 syncase)))
111  (mes))
112
113 (include-from-path "mes/libc-i386.mes")