06a40ff893bdd7d6df725ac1e6a40bf02903e5de
[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 (i386:accu->local
31             i386:call
32             i386:exit
33             i386:formal
34             i386:function-preamble
35             i386:function-locals
36             i386:eputs
37             i386:jump
38             i386:jump-byte-nz
39             i386:jump-byte-z
40             i386:jump-nz
41             i386:jump-le
42             i386:local-add
43             i386:local-assign
44             i386:local->accu
45             i386:local->base
46             i386:local-test
47             i386:mem->accu
48             i386:mem-byte->accu
49             i386:Xmem-byte->accu
50             i386:push-accu
51             i386:puts
52             i386:ref-global
53             i386:ref-local
54             i386:ret
55             i386:ret-local
56             i386:value->accu
57             i386:write
58
59             i386:test-byte-base
60             i386:Xmem-byte->base
61             i386:Xjump-byte-z
62             i386:sub-byte-base
63             ))
64
65 (cond-expand
66  (guile-2)
67  (guile
68   (use-modules (ice-9 syncase)))
69  (mes))
70
71 (include-from-path "mes/libc-i386.mes")