--- a/UninterpretedBytes.st Sat Feb 28 14:04:58 2004 +0100
+++ b/UninterpretedBytes.st Sun Feb 29 14:50:37 2004 +0100
@@ -1656,11 +1656,11 @@
|v|
value >= 0 ifTrue:[
- v := value
+ v := value
] ifFalse:[
- v := 16r10000 + value
+ v := 16r10000 + value
].
- self unsignedShortAt:index put:v.
+ self unsignedShortAt:index put:v bigEndian:(UninterpretedBytes isBigEndian).
^ value
"
@@ -1676,6 +1676,37 @@
"Created: / 5.3.1998 / 11:02:05 / stefan"
!
+shortAt:index put:value bigEndian:bigEndian
+ "set the 2-bytes starting at index from the signed Integer value.
+ The index is a smalltalk index (i.e. 1-based).
+ The stored value must be in the range -32768 .. +32676.
+ The value is stored in the machines natural byteorder.
+ This may be worth a primitive.
+ This is the ST80 equivalent of #signedWordAt:put:"
+
+
+ |v|
+
+ value >= 0 ifTrue:[
+ v := value
+ ] ifFalse:[
+ v := 16r10000 + value
+ ].
+ self unsignedShortAt:index put:v bigEndian:bigEndian.
+ ^ value
+
+ "
+ |b|
+ b := ByteArray new:4.
+ b shortAt:1 put:1 bigEndian:true.
+ b shortAt:3 put:1 bigEndian:false.
+ b inspect
+ "
+
+ "Modified: / 1.7.1996 / 21:12:07 / cg"
+ "Created: / 5.3.1998 / 11:02:05 / stefan"
+!
+
signedWordAt:index
"return the 2-bytes starting at index as a signed Integer.
The index is a smalltalk index (i.e. 1-based).
@@ -2179,5 +2210,5 @@
!UninterpretedBytes class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.51 2003-12-19 23:42:49 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.52 2004-02-29 13:50:37 cg Exp $'
! !