PreviousUpNext

15.4.243  src/lib/compiler/back/low/emit/asm-util.pkg

## asm-util.pkg

# Compiled by:
#     src/lib/compiler/back/low/lib/lowhalf.lib

# This is a helper module for assemblers.




###             "A game in which you fly around in space
###              and shoot up other space ships?
###                That is the stupidest idea that
###              I have ever heard."
###                            -- Atari manager



stipulate
    package lbl =  codelabel;                                                   # codelabel             is from   src/lib/compiler/back/low/code/codelabel.pkg
    package rkj =  registerkinds_junk;                                                  # registerkinds_junk            is from   src/lib/compiler/back/low/code/registerkinds-junk.pkg
herein

    api Asm_Formatting_Utilities {
        #
        reginfo:    ((String -> Void), note::Notes) -> (rkj::Codetemp_Info -> Void);

        put_cuts_to:  (String -> Void) -> List( lbl::Codelabel ) -> Void;

    };
end;


stipulate
    package lbl =  codelabel;                                                   # codelabel             is from   src/lib/compiler/back/low/code/codelabel.pkg
    package lcn =  lowhalf_notes;                                                       # lowhalf_notes                 is from   src/lib/compiler/back/low/code/lowhalf-notes.pkg
    package rkj =  registerkinds_junk;                                                  # registerkinds_junk            is from   src/lib/compiler/back/low/code/registerkinds-junk.pkg
herein

    package   asm_formatting_utilities
    : (weak)  Asm_Formatting_Utilities                                                  # Asm_Formatting_Utilities      is from   src/lib/compiler/back/low/emit/asm-util.pkg
    {

        fun reginfo (emit, an)
            = 
            case (lcn::print_register_info.get an)
                #
                THE f =>   (fn c = emit (f c));
                NULL  =>   (fn _ = ());
            esac;

        fun put_cuts_to emit []
                =>
                ();

            put_cuts_to emit labels
                => 
                emit ("\n\t/* cuts to:" + text + " */\n")
                where
                    text = list::fold_backward

                               fn (l, "") =>  lbl::codelabel_to_string l;
                                  (l, s ) =>  lbl::codelabel_to_string l + ", " + s;
                               end

                               ""

                               labels;
                end;
        end;
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext