% Author: Blake Hegerle <bhegerle@ea...>
% MMIX Program 5.2.1-3  
% 2005-11-04 21:10

% An implementation of the Program given in answer to 5.2.1-3.

N1      IS      16
N       IS      16*8

I       IS      $1
A       IS      $2
B       IS      $3
C       IS      $4

INPUT   GREG    0

        LOC     0

        OCTA    0
        OCTA    503
        OCTA    087
        OCTA    512
        OCTA    061
        OCTA    908
        OCTA    170
        OCTA    897
        OCTA    275
        OCTA    653
        OCTA    426
        OCTA    154
        OCTA    509
        OCTA    612
        OCTA    677
        OCTA    765
        OCTA    703

        LOC     #100

2H      LDOU    A,I
        LDOU    B,I,8
        CMPU    C,A,B
        BNP     C,1F
        STOU    A,I,8
        STOU    B,I
        ADDU    I,I,8

Main    SET     I,N
1H      SUBU    I,I,8
        PBP     I,2B

        TRAP    0,Halt,0