Knuth: MMIX使用

MMIX 官方主页:Knuth: MMIX。有关 MMIX 的资料和软件都可以在上面找到。


~$ cat hello.mms 
argv   IS     $1
        LOC   #100
Main   LDOU   $255,argv,0
        TRAP   0,Fputs,StdOut
        GETA   $255,String
        TRAP   0,Fputs,StdOut
        TRAP   0,Halt,0
String BYTE   ", world",#a,0

~$ mmixal -l hello.mml hello.mms

~$ ls -l hello.*
-rw-rw-r-- 1 mymotif mymotif 492   9月 21 20:06 hello.mml
-rw-rw-r-- 1 mymotif mymotif 144   9月 21 20:06 hello.mmo
-rw-r--r-- 1 mymotif mymotif 191   9月 21 20:05 hello.mms

~$ mmix hello
hello, world

~$   hd hello.mmo
00000000   98 09 01 01 55 ff f2 ca   98 02 01 00 98 06 00 03   |....U...........|
00000010   68 65 6c 6c 6f 2e 6d 6d   73 00 00 00 98 07 00 03   |hello.mms.......|
00000020   8f ff 01 00 00 00 07 01   f4 ff 00 00 00 00 07 01   |................|
00000030   00 00 00 00 98 04 00 03   2c 20 77 6f 98 07 00 08   |........, wo....|
00000040   72 6c 64 0a 98 07 00 08   00 00 00 00 98 0a 00 ff   |rld.............|
00000050   00 00 00 00 00 00 01 00   98 0b 00 00 20 3a 50 50   |............ :PP|
00000060   10 40 40 20 4d 20 61 20   69 02 6e 01 00 81 20 53   |.@@ M a i.n... S|
00000070   20 74 10 10 20 72 20 69   20 6e 02 67 01 14 83 40   | t.. r i n.g...@|
00000080   20 61 20 72 20 67 0f 76   01 82 00 00 98 0c 00 0c   | a r g.v........|
00000090

~$ cat hello.mml
($001)             argv   IS     $1
                          LOC   #100
  ...100: 8fff0100   Main   LDOU   $255,argv,0
  ...104: 00000701         TRAP   0,Fputs,StdOut
  ...108: f4ffxxxx         GETA   $255,String
  ...10c: 00000701         TRAP   0,Fputs,StdOut
  ...110: 00000000         TRAP   0,Halt,0
  ...114: 2c20776f   String BYTE   ", world",#a,0
  ...118: 726c640a
  ...11c: 00      
                   

Symbol table:
  Main = #0000000000000100 (1)
  String = #0000000000000114 (3)
  argv = $001 (2)
~$ mmotype hello.mmo
File was created Fri Aug 15 13:44:01 1879
0000000000000100: 8fff0100 ("hello.mms", line 3)
0000000000000104: 00000701 (line 4)
0000000000000108: f4ff0000 (line 5)
000000000000010c: 00000701 (line 6)
0000000000000110: 00000000 (line 7)
0000000000000108: 00000003
0000000000000114: 2c20776f (line 8)
0000000000000118: 726c640a (line 8)
000000000000011c: 00000000 (line 8)
g255: 0000000000000100
Symbol table (beginning at tetra 23):
    Main = #0100 (1)
    String = #0114 (3)
    argv = $001 (2)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值