Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/OldCGen/mips/endian.sml
ViewVC logotype

View of /sml/trunk/src/compiler/OldCGen/mips/endian.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (download) (annotate)
Wed Mar 11 21:00:04 1998 UTC (23 years, 4 months ago) by monnier
File size: 852 byte(s)
Initial revision
(* Copyright 1991 by AT&T Bell Laboratories 
 *
 *)
structure LittleEndian : ENDIAN = 
    struct
      val architecture = "mipsel"
      val bigEndian = false
      val >> = Word.>>
      val &  = Word.andb
      infix >> &

      val order_real = implode o rev o explode
      val low_order_offset = 0
      fun wordLayout (hi,lo) =
	(lo & 0w255, (lo >> 0w8) & 0w255, hi & 0w255, (hi >> 0w8) & 0w255)
    end

structure BigEndian : ENDIAN = 
    struct
      val architecture = "mipseb"
      val bigEndian = true
      val >> = Word.>>
      val &  = Word.andb
      infix >> &

      fun order_real x = x
      val low_order_offset = 1
      fun wordLayout (hi,lo) =
	((hi >> 0w8) & 0w255, hi & 0w255, (lo >> 0w8) & 0w255, lo & 0w255)
    end


(*
 * $Log: endian.sml,v $
 * Revision 1.1.1.1  1997/01/14 01:38:38  george
 *   Version 109.24
 *
 *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0