Annotation of researchv10no/cmd/sml/src/mips/mipsglue.sml, revision 1.1

1.1     ! root        1: (* Copyright 1989 by AT&T Bell Laboratories *)
        !             2: structure MipsAC : ASSEMBLER = struct
        !             3:     val diag_out = ref std_out
        !             4:     structure MCN = struct
        !             5:         open MipsCoder
        !             6:        structure M = struct
        !             7:            open M
        !             8:            fun comment s = output (!diag_out) s
        !             9:        end
        !            10:     end
        !            11:         
        !            12:     structure CM = MipsCM(MCN)
        !            13:        
        !            14:     structure Gen = CPScomp(CM)
        !            15:     fun generate (lexp, stream) = (
        !            16:         diag_out := stream;
        !            17:        Gen.compile lexp;
        !            18:        MipsCoder.codestats stream;
        !            19:        Emitters.address := 0;
        !            20:        MipsCoder.codegen (Emitters.MipsAsm stream);
        !            21:        ())
        !            22: end
        !            23: 
        !            24: structure MipsCodeStats : ASSEMBLER = struct
        !            25:     val diag_out = ref std_out
        !            26:     structure MCN = MipsCoder
        !            27:         
        !            28:     structure CM = MipsCM(MCN)
        !            29:        
        !            30:     structure Gen = CPScomp(CM)
        !            31:     fun generate (lexp, stream) = (
        !            32:        Gen.compile lexp;
        !            33:        MipsCoder.codestats stream;
        !            34:        ())
        !            35: end
        !            36: 
        !            37: structure MipsMCBig : CODEGENERATOR = struct
        !            38:     structure CM = MipsCM(MipsCoder)
        !            39:     structure Gen = CPScomp(CM)
        !            40:  
        !            41:     fun generate lexp = (
        !            42:        Gen.compile lexp;
        !            43:        MipsCoder.codegen (Emitters.BigEndian);
        !            44:        Emitters.emitted_string ()
        !            45:        )
        !            46: end
        !            47: 
        !            48: structure MipsMCLittle : CODEGENERATOR = struct
        !            49:     structure CM = MipsCM(MipsCoder)
        !            50:     structure Gen = CPScomp(CM)
        !            51: fun diag (s : string) f x =
        !            52:        f x handle e =>
        !            53:                (print "?exception "; print (System.exn_name e);
        !            54:                 print " in mipsglue."; print s; print "\n";
        !            55:                 raise e)
        !            56:  
        !            57:     fun generate lexp = (
        !            58:        diag "Gen.compile" Gen.compile lexp;
        !            59:        diag "MipsCoder.codegen" MipsCoder.codegen (Emitters.LittleEndian);
        !            60:        diag "Emitters.emitted_string" Emitters.emitted_string ()
        !            61:        )
        !            62: end
        !            63: 
        !            64: 
        !            65: structure CompMipsLittle = Batch(structure M=MipsMCLittle and A=MipsAC)
        !            66: structure IntMipsLittle = IntShare(MipsMCLittle)
        !            67: 
        !            68: structure CompMipsBig = Batch(structure M=MipsMCBig and A=MipsAC)
        !            69: structure IntMipsBig = IntShare(MipsMCBig)
        !            70: 
        !            71: structure CompMipsStats = Batch(structure M=MipsMCLittle and A=MipsCodeStats)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.