diff --git a/make.scm b/make.scm index 3f7fd50b..01a35f2d 100755 --- a/make.scm +++ b/make.scm @@ -253,17 +253,17 @@ exec ${GUILE-guile} --no-auto-compile -L . -L guile -C . -C guile -s "$0" ${1+"$ ;;(add-target (group "check-scaffold" #:dependencies (filter (target-prefix? "check-scaffold") %targets))) -(add-target (bin.gcc "scaffold/main.c")) -(add-target (check "scaffold/main.gcc" #:exit 42)) +;; (add-target (bin.gcc "scaffold/main.c")) +;; (add-target (check "scaffold/main.gcc" #:exit 42)) -(add-target (bin.gcc "scaffold/main.c" #:libc #f)) -(add-target (check "scaffold/main.mlibc-gcc" #:exit 42)) +;; (add-target (bin.gcc "scaffold/main.c" #:libc #f)) +;; (add-target (check "scaffold/main.mlibc-gcc" #:exit 42)) -(add-target (bin.mescc "scaffold/main.c" #:libc mini-libc-mes.E)) -(add-target (check "scaffold/main.mini-guile" #:exit 42)) +;; (add-target (bin.mescc "scaffold/main.c" #:libc mini-libc-mes.E)) +;; (add-target (check "scaffold/main.mini-guile" #:exit 42)) -(add-target (bin.mescc "scaffold/main.c")) -(add-target (check "scaffold/main.guile" #:exit 42)) +;; (add-target (bin.mescc "scaffold/main.c")) +;; (add-target (check "scaffold/main.guile" #:exit 42)) (add-target (bin.gcc "scaffold/hello.c")) diff --git a/scaffold/main.c b/scaffold/main.c index 5ac0120b..46a2ae1c 100644 --- a/scaffold/main.c +++ b/scaffold/main.c @@ -18,8 +18,59 @@ * along with Mes. If not, see . */ +#if __i386__ +#define main _start +#endif + int main (int argc, char *argv[]) { +#if __MESC__ + asm ("mov____$i32,%ebx !42"); + asm ("mov____$i32,%eax !1"); + asm ("int____$0x80"); +#elif __i386__ + asm (".byte 144"); + asm (".byte 144"); + asm (".byte 144"); +#if 1 //MESC_TCC + asm (".byte 187"); + asm (".byte 42"); + asm (".byte 0"); + asm (".byte 0"); + asm (".byte 0"); + + asm (".byte 184"); + asm (".byte 1"); + asm (".byte 0"); + asm (".byte 0"); + asm (".byte 0"); + + asm (".byte 205"); + asm (".byte 128"); + + asm (".byte 137"); + asm (".byte 69"); + asm (".byte 252"); + +#else + asm ("mov $42,%ebx"); + asm ("mov $1,%eax"); + asm ("int $128"); +#endif + + asm (".byte 144"); + asm (".byte 144"); + asm (".byte 144"); + +#elif __x86_64__ + asm (".byte 144"); + asm ("mov $42,%rbx"); + asm ("mov $1,%rax"); + asm ("int $128"); +#else + #error "platform not supported" +#endif + // not reached return 42; }