Here it is. You can cut all of the Cola support __* subs
except __strlen or just replace the bsr __strlen with the actual
op.

-Melvin
        # Cola (0.0.4) generated
        #
_START:
        save ""
        bsr __Main
__END:
        end
        
__Generate:     pushi
        pushs
        pushn
        restore S31
        save S31
        bsr __strlen
        #Get return val in len
        restore I29
        set S28, "   *     "
        set S30, "  **     "
        set S29, S31
        set I27, 0
LBL1:
        ge I27, I29, LBL3
LBL2:
        set I30, 0
        add I31, I27, I29
        sub I25, I31, 1
        mod I24, I25, I29
        substr S27, S31, I24, 1
        ne S27, "*", LBL7
LBL5:
        set I24, I30
        inc I30
LBL7:
        add I25, I31, 1
        mod I23, I25, I29
        substr S27, S31, I23, 1
        ne S27, "*", LBL10
LBL8:
        set I23, I30
        inc I30
LBL10:
        sub I25, I31, 17
        mod I22, I25, I29
        substr S27, S31, I22, 1
        ne S27, "*", LBL13
LBL11:
        set I22, I30
        inc I30
LBL13:
        add I25, I31, 17
        mod I21, I25, I29
        substr S27, S31, I21, 1
        ne S27, "*", LBL16
LBL14:
        set I21, I30
        inc I30
LBL16:
        sub I25, I31, 16
        mod I20, I25, I29
        substr S27, S31, I20, 1
        ne S27, "*", LBL19
LBL17:
        set I20, I30
        inc I30
LBL19:
        add I25, I31, 16
        mod I19, I25, I29
        substr S27, S31, I19, 1
        ne S27, "*", LBL22
LBL20:
        set I19, I30
        inc I30
LBL22:
        sub I25, I31, 15
        mod I18, I25, I29
        substr S27, S31, I18, 1
        ne S27, "*", LBL25
LBL23:
        set I18, I30
        inc I30
LBL25:
        add I25, I31, 15
        mod I17, I25, I29
        substr S27, S31, I17, 1
        ne S27, "*", LBL28
LBL26:
        set I17, I30
        inc I30
LBL28:
        substr S27, S31, I27, 1
        ne S27, "*", LBL30
LBL29:
        substr S27, S30, I30, 1
        substr S29, I27, 1, S27
        branch LBL31
LBL30:
        ne I30, 3, LBL34
LBL32:
        set S27, "*"
        substr S29, I27, 1, S27
LBL34:
LBL31:
LBL4:
        set I25, I27
        inc I27
        branch LBL1
LBL3:
        # Push return val and jump
        save S29
LBL0:
        popn
        pops
        popi
        ret
__Main: pushi
        pushs
        pushn
        concat S30, "   **   * * *   ", " **  *  *       "
        concat S29, S30, " **          *  "
        concat S30, S29, "        *    ** "
        concat S29, S30, " **  *  *       "
        concat S30, S29, "     *          "
        concat S29, S30, "  *     *       "
        concat S30, S29, "        *       "
        concat S29, S30, " *   *   *  **  "
        concat S30, S29, "  *  *  *       "
        concat S29, S30, " **     *    *  "
        concat S30, S29, "          *     "
        concat S29, S30, "  *             "
        concat S30, S29, " *          *   "
        concat S29, S30, "     *          "
        concat S31, S29, "     *         *"
        set I30, 0
LBL36:
        ge I30, 500, LBL38
LBL37:
        save S31
        bsr __Generate
        #Get return val in world
        restore S31
LBL39:
        set I29, I30
        inc I30
        branch LBL36
LBL38:
LBL35:
        popn
        pops
        popi
        ret
        #End of class Life
        

__puts:
        pushi
        pushn
        pushs
        restore S31
        puts S31
        pops
        popn
        popi
        ret

__puti:
        pushi
        pushn
        pushs
        restore I31
        puts I31
        pops
        popn
        popi
        ret

__putf:
        pushi
        pushn
        pushs
        restore N31
        puts N31
        pops
        popn
        popi
        ret

__substr:
        pushi
        pushn
        pushs
        restore I31
        restore I30
        restore S31
        substr S30, S31, I30, I31
        save S30
        pops
        popn
        popi
        ret

__strlen:
        pushi
        pushn
        pushs
        restore S0
        length I0, S0
        save I0
        pops
        popn
        popi
        ret

__strchop:
        pushi
        pushn
        pushs
        restore S0
        chopn S0, 1
        save S0
        pops
        popn
        popi
        ret

__strrep:
        pushi
        pushn
        pushs
        restore S30
        restore I31
        restore I30
        restore S31
        substr S31, I30, I31, S30
        save S31
        pops
        popn
        popi
        ret

__ord:
        pushi
        pushn
        pushs
        restore S0
        ord I0, S0
        save I0
        pops
        popn
        popi
        ret

__gets:
        pushi
        pushn
        pushs
        read S0, 512
        save S0
        pops
        popn
        popi
        ret

__sleep:
        pushi
        pushn
        pushs
        restore I0
        sleep I0
        pops
        popn
        popi
        ret



Reply via email to