I'm learning MMIX so I tried making a simple program to add one to itself and print the result. Unfortunately it doesn't print anything. Here is my program:
n IS $4
y IS $3
t IS $255
LOC #100
Main SET n,1 %let n = 1
ADD y,n,1 %add 1 to n and store the result in y
LDA t,y
TRAP 0,Fputs,StdOut
TRAP 0,Halt,0
What am I doing wrong?
I ended up figuring it out after seeing the code here. I had to first create a byte, then store the value of the register into the byte. Then by printing out that byte, I get the result of ADD y,n,1.