我根据http://www.bitrange.com/mmix/install.html为 mmix 编译了 gcc 4.6.0 。在我尝试了他们简单的 hello world 或任何其他对 printf 的调用超过第一个字符串之后,只有第一个字符串被打印出来。例如
lada@:~/f/c> cat hellommix.c
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
printf ("hello, %s\n", argc > 1 ? argv[1] : "world");
exit (0);
}
lada@:~/f/c> mmix-gcc hellommix.c
lada@:~/f/c> mmix ./a.out "abc"
hello, lada@:~/f/c>
生成的程序集如下所示:
# 1 "hellommix.c"
! mmixal:= 8H LOC Data_Section
.text ! mmixal:= 9H LOC 8B
.section .rodata
.p2align 2
LOC @+(4-@)&3
LC:0 IS @
BYTE "world",#0
.p2align 2
LOC @+(4-@)&3
LC:1 IS @
BYTE "hello, %s",#a,#0
.text ! mmixal:= 9H LOC 8B
.p2align 2
LOC @+(4-@)&3
.global main
main IS @
SUBU $254,$254,24
STOU $253,$254,16
ADDU $253,$254,24
GET $2,rJ
SET $3,$0
SUBU $0,$253,24
STOU $1,$0,0
SUBU $0,$253,12
STTU $3,$0,0
SUBU $0,$253,12
LDT $0,$0,0
SLU $0,$0,32
SR $0,$0,32
CMP $0,$0,1
BNP $0,L:2
SUBU $0,$253,24
LDO $0,$0,0
LDO $0,$0,8
JMP L:3
L:2 IS @
GETA $0,LC:0
L:3 IS @
GETA $5,LC:1
SET $6,$0
PUSHJ $4,printf
PUT rJ,$2
SETL $5,0
PUSHJ $4,exit
.data ! mmixal:= 8H LOC 9B