Re: Mixing mmix and C code?

"Tommy Thorn" <tommy.thorn@gmail.com>
11 Oct 2006 23:21:51 -0400

          From comp.compilers

Related articles
Mixing mmix and C code? nhbfluci@rrzn-user.uni-hannover.de (Luciano) (2006-10-10)
Re: Mixing mmix and C code? tommy.thorn@gmail.com (Tommy Thorn) (2006-10-11)
Re: Mixing mmix and C code? nhbfluci@rrzn-user.uni-hannover.de (Luciano) (2006-10-16)
Re: Mixing mmix and C code? tommy.thorn@gmail.com (Tommy Thorn) (2006-10-17)
Re: Mixing mmix and C code? danwang74@gmail.com (Daniel C. Wang) (2006-10-17)
Re: Mixing mmix and C code? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-10-17)
Re: Mixing mmix and C code? tommy.thorn@gmail.com (Tommy Thorn) (2006-10-19)
| List of all articles for this month |
From: "Tommy Thorn" <tommy.thorn@gmail.com>
Newsgroups: comp.compilers
Date: 11 Oct 2006 23:21:51 -0400
Organization: Compilers Central
References: 06-10-034
Keywords: practice
Posted-Date: 11 Oct 2006 23:21:51 EDT

Luciano wrote:
> I am intersted in the mmix language by Donald Knuth. Is there a way
> to call to routine that I write in mmix from C, or is there an mmix to
> C converter?
>
> Thanks
> Luciano
> [I see that Knuth has an mmix interpreter written in C. Perhaps you
> can modify that to make it a callable library. -John]


Luciano, the question is a bit unclear. First, MMIX is strictly
speaking not a language, but a microprocessor architeture. Most
likely, you do not want to be writing in the binary code that is the
machine code language of MMIX.


If you're using the mmix-gcc and wish to mix assembly to C code, then
that's completely standard. You can either inline assembly with the
usual asm() syntax, eg. asm("ADDI $2,$5,8") or write an complete
assembly file and with with that.


If you wish to instrument the simulator (as John implies), then it is
not that hard at all to modify the MMIX simulator. However, if you need
access to all of MMIX (notably the priviledge instructions) then you
need to modify the pipeline simulator MMMIX, which is a non-trivial
exercise.


Cheers,
Tommy


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.