Skip to content

Commit

Permalink
MMIX 2009 — Release 2005-09-22.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Scherer committed Sep 8, 2011
1 parent 00b167b commit 2e88263
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ PDFTEX = dvipdfm
pdftex ) pdftex $* ;; \
esac

.mmb.mmo:
.mmo.mmb:
mmix -D$*.mmb $*.mmo

.mmo.mms:
.mms.mmo:
mmixal -x -b 250 -l $*.mml $*.mms

WEBFILES = abstime.w boilerplate.w mmix-arith.w mmix-config.w mmix-doc.w \
Expand Down
27 changes: 27 additions & 0 deletions coolcomb.mms
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
* The "cool-lex" combinations of Ruskey and Williams, ex 7.2.1.3--55(b)
s IS 4 % the number of 0-bits in each combination
t IS 3 % the number of 1-bits in each combination; s+t<=8 here
bits GREG 0
ptr GREG 0
LOC #100
Main LDA ptr,Data_Segment % assemble this with the -x switch!
SET bits,(1<<t)-1
1H PUSHJ $0,Visit
ADDU $0,bits,1
AND $0,$0,bits
SUBU $1,$0,1
XOR $1,$1,$0
ADDU $0,$1,1
AND $1,$1,bits
AND $0,$0,bits
ODIF $0,$0,1
SUBU $1,$1,$0
ADDU bits,bits,$1
SRU $0,bits,s+t
PBZ $0,1B
TRAP 0,Halt,0 % simulate this with the -I switch!
Visit STBU bits,ptr,0
INCL ptr,1
POP 0,0


2 changes: 1 addition & 1 deletion mmix-pipe.w
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ static void print_control_block(c)
if (c->ren_a) {@+printf(" a=");@+print_specnode(c->a);@+}
if (c->set_l) {@+printf(" rL=");@+print_specnode(c->rl);@+}
if (c->interrupt) {@+printf(" int=");@+print_bits(c->interrupt);@+}
if (c->arith_exc) printf(" exc=");@+print_bits(c->arith_exc<<8);
if (c->arith_exc) {@+printf(" exc=");@+print_bits(c->arith_exc<<8);@+}
default_go=incr(c->loc,4);
if (c->go.o.l!=default_go.l || c->go.o.h!=default_go.h) {
printf(" ->");@+print_octa(c->go.o);
Expand Down
5 changes: 3 additions & 2 deletions mmix-sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -2266,7 +2266,7 @@ to implement |SAVE| and |UNSAVE|.

@<Cases for ind...@>=
case SAVE:@+if (xx<G || yy!=0 || zz!=0) goto illegal_inst;
l[(O+L)&lring_mask].l=L++;
l[(O+L)&lring_mask].l=L, L++;
if (((S-O-L)&lring_mask)==0) stack_store();
O+=L;@+ g[rO]=incr(g[rO],L<<3);
L=g[rL].l=0;
Expand Down Expand Up @@ -2352,7 +2352,8 @@ case PRELD: case PRELDI: x=incr(w,xx);@+break;

@<Cases for ind...@>=
case GO: case GOI: x=inst_ptr;@+inst_ptr=w;@+goto store_x;
case JMP: case JMPB: inst_ptr=z;@+break;
case JMP: case JMPB: inst_ptr=z;
case SWYM: break;
case SYNC:@+if (xx!=0 || yy!=0 || zz>7) goto illegal_inst;
if (zz<=3) break;
case LDVTS: case LDVTSI: privileged_inst: strcpy(lhs,"!privileged");
Expand Down

0 comments on commit 2e88263

Please sign in to comment.