added #longLongAt:put:bigEndian:
authorClaus Gittinger <cg@exept.de>
Sat, 09 May 1998 01:14:46 +0200
changeset 3439 6589d152090c
parent 3438 2e64ef848871
child 3440 ac93772ac2ca
added #longLongAt:put:bigEndian:
UIBytes.st
UninterpretedBytes.st
--- a/UIBytes.st	Fri May 08 21:42:02 1998 +0200
+++ b/UIBytes.st	Sat May 09 01:14:46 1998 +0200
@@ -846,7 +846,7 @@
 longLongAt:index bigEndian:msb
     "return the 8-bytes starting at index as a signed Integer.
      The index is a smalltalk index (i.e. 1-based).
-     The value is retrieved in the machines natural byte order.
+     The value is retrieved in the given byte order.
      This may be worth a primitive."
 
     |w|
@@ -864,9 +864,9 @@
      (b longLongAt:1 msb:true)    
     "
 
-    "Modified: / 1.7.1996 / 21:11:28 / cg"
     "Modified: / 5.3.1998 / 12:06:28 / stefan"
     "Created: / 5.3.1998 / 14:40:54 / stefan"
+    "Modified: / 9.5.1998 / 01:10:59 / cg"
 !
 
 longLongAt:byteIndex put:anInteger
@@ -880,6 +880,23 @@
     "Created: / 3.4.1998 / 13:34:22 / cg"
 !
 
+longLongAt:byteIndex put:anInteger bigEndian:msb
+    "store a signed longLong (64bit) integer.
+     The index is a smalltalk index (i.e. 1-based).
+     Same as #signedQuadWordAt:put: - for ST80 compatibility."
+
+    |v|
+
+    v := anInteger.
+    anInteger < 0 ifTrue:[
+        v := v + 16r10000000000000000
+    ].
+    ^ self unsignedLongLongAt:byteIndex put:v bigEndian:msb
+
+    "Created: / 9.5.1998 / 01:10:24 / cg"
+    "Modified: / 9.5.1998 / 01:13:34 / cg"
+!
+
 quadWordAt:index MSB:msb
     "return the 8-bytes starting at index as an (unsigned) Integer.
      The index is a smalltalk index (i.e. 1-based).
@@ -1812,6 +1829,6 @@
 !UninterpretedBytes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/UIBytes.st,v 1.25 1998-05-08 15:24:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/UIBytes.st,v 1.26 1998-05-08 23:14:46 cg Exp $'
 ! !
 UninterpretedBytes initialize!
--- a/UninterpretedBytes.st	Fri May 08 21:42:02 1998 +0200
+++ b/UninterpretedBytes.st	Sat May 09 01:14:46 1998 +0200
@@ -846,7 +846,7 @@
 longLongAt:index bigEndian:msb
     "return the 8-bytes starting at index as a signed Integer.
      The index is a smalltalk index (i.e. 1-based).
-     The value is retrieved in the machines natural byte order.
+     The value is retrieved in the given byte order.
      This may be worth a primitive."
 
     |w|
@@ -864,9 +864,9 @@
      (b longLongAt:1 msb:true)    
     "
 
-    "Modified: / 1.7.1996 / 21:11:28 / cg"
     "Modified: / 5.3.1998 / 12:06:28 / stefan"
     "Created: / 5.3.1998 / 14:40:54 / stefan"
+    "Modified: / 9.5.1998 / 01:10:59 / cg"
 !
 
 longLongAt:byteIndex put:anInteger
@@ -880,6 +880,23 @@
     "Created: / 3.4.1998 / 13:34:22 / cg"
 !
 
+longLongAt:byteIndex put:anInteger bigEndian:msb
+    "store a signed longLong (64bit) integer.
+     The index is a smalltalk index (i.e. 1-based).
+     Same as #signedQuadWordAt:put: - for ST80 compatibility."
+
+    |v|
+
+    v := anInteger.
+    anInteger < 0 ifTrue:[
+        v := v + 16r10000000000000000
+    ].
+    ^ self unsignedLongLongAt:byteIndex put:v bigEndian:msb
+
+    "Created: / 9.5.1998 / 01:10:24 / cg"
+    "Modified: / 9.5.1998 / 01:13:34 / cg"
+!
+
 quadWordAt:index MSB:msb
     "return the 8-bytes starting at index as an (unsigned) Integer.
      The index is a smalltalk index (i.e. 1-based).
@@ -1812,6 +1829,6 @@
 !UninterpretedBytes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.25 1998-05-08 15:24:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.26 1998-05-08 23:14:46 cg Exp $'
 ! !
 UninterpretedBytes initialize!