Skip to content

Commit

Permalink
MMIX 2009 — Release 2023-11-25.
Browse files Browse the repository at this point in the history
  • Loading branch information
ascherer committed Nov 29, 2023
1 parent fb2b335 commit 9677eca
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
15 changes: 15 additions & 0 deletions bugtest.mms
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* testing BSPEC data
LOC #100
BSPEC 5
% TETRA #1234FFFF
%a GREG 3
% TETRA a-$0
% TETRA &a
WYDE #96,$1,2
% OCTA "abd"
% BYTE #EF,"AB"
% TETRA "11"
% TETRA #11
WYDE #2345
ESPEC
Main ADD $1,$1,$1
2 changes: 1 addition & 1 deletion mmix-arith.w
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ switch (r) {
o = o>>2;
o += (e-0x380)<<23;
if (o>=0x7f800000) exceptions |= O_BIT+X_BIT; /* overflow */
else if (o<0x100000) exceptions |= U_BIT; /* tininess */
else if (o<0x800000) exceptions |= U_BIT; /* tininess */
if (s=='-') o |= sign_bit;
return o;

Expand Down
2 changes: 1 addition & 1 deletion mmix-pipe.w
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ultra-configurable \MMIX\ pipeline: It defines the |MMIX_run| routine, which
does most of the
work. Another routine, |MMIX_init|, is also defined here, and so is a header
file called \.{mmix\_pipe.h}. The header file is used by the main routine and
file called \.{mmix-pipe.h}. The header file is used by the main routine and
by other routines like |MMIX_config|, which are compiled separately.

Readers of this program should be familiar with the explanation of \MMIX\
Expand Down
16 changes: 9 additions & 7 deletions mmixal.w
Original file line number Diff line number Diff line change
Expand Up @@ -1403,8 +1403,13 @@ void assemble(k,dat,x_bits)
unsigned char x_bits;
{
register int j,jj,l;
if (spec_mode) l=spec_mode_loc;
else {
if (spec_mode) {
l=spec_mode_loc;
if (l&(k-1)) {
if (held_bits==1 && k==2) spec_mode_loc=l=l+1,hold_buf[1]=0,held_bits=3;
else spec_mode_loc=l=(l+k)&-k,mmo_clear();
}
}@+else {
l=cur_loc.l;
@<Make sure |cur_loc| and |mmo_cur_loc| refer to the same tetrabyte@>;
if (!held_bits && !(cur_loc.h&0xe0000000)) mmo_sync();
Expand All @@ -1416,10 +1421,7 @@ void assemble(k,dat,x_bits)
listing_bits|=1<<jj;
}
listing_bits|=x_bits;
if (((l+k)&3)==0) {
if (listing_file) listing_clear();
mmo_clear();
}
if (((l+k)&3)==0) mmo_clear();
if (spec_mode) spec_mode_loc+=k; else cur_loc=incr(cur_loc,k);
}

Expand Down Expand Up @@ -3118,7 +3120,7 @@ switch(opcode) {
mmo_loc();@+mmo_sync();
mmo_lopp(lop_spec,val_stack[0].equiv.l);
spec_mode=true;@+spec_mode_loc=0;@+ goto bypass;
case ESPEC: spec_mode=false;@+goto bypass;
case ESPEC: spec_mode=false;@+if (held_bits) mmo_clear();@+goto bypass;
}

@ @<Glob...@>=
Expand Down

0 comments on commit 9677eca

Please sign in to comment.