Quantcast

VM Maker: ImageFormat-dtl.25.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

VM Maker: ImageFormat-dtl.25.mcz

commits-2
 
David T. Lewis uploaded a new version of ImageFormat to project VM Maker:
http://source.squeak.org/VMMaker/ImageFormat-dtl.25.mcz

==================== Summary ====================

Name: ImageFormat-dtl.25
Author: dtl
Time: 13 May 2017, 6:35:37.899 pm
UUID: 62240a4e-d36c-462e-914e-0becf27eee36
Ancestors: ImageFormat-dtl.24

Support ImageFileHeader for reading format number from 64 bit Spur.

Fixes this:
  (ImageFormat fromFile: Smalltalk imageName) description
     ==> 'a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021)'

To do: Need new header reader for the 64 bit Spur files, which differ from  64 bit V3.

=============== Diff against ImageFormat-dtl.24 ===============

Item was changed:
  ----- Method: ImageFileHeader>>readImageVersionFrom:startingAt: (in category 'reading') -----
  readImageVersionFrom: aStream startingAt: imageOffset
  "Look for image format in the next 4 or 8 bytes and set imageFormat. Answer true
  if the header is written in little endian format."
 
  (aStream nextNumber: 4) caseOf:
  {
  [ 16r00001966 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. ^false ] .
  [ 16r66190000 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. ^true ] .
  [ 16r00001968 "6504" ] -> [ imageFormat := ImageFormat fromInteger: 6504. ^false ] .
  [ 16r68190000 "6504" ] -> [ imageFormat := ImageFormat fromInteger: 6504. ^true ] .
  [ 16r00001969 "6505" ] -> [ imageFormat := ImageFormat fromInteger: 6505. ^false ] .
  [ 16r69190000 "6505" ] -> [ imageFormat := ImageFormat fromInteger: 6505. ^true ] .
  [ 16r00001979 "6521" ] -> [ imageFormat := ImageFormat fromInteger: 6521. ^false ] .
  [ 16r79190000 "6521" ] -> [ imageFormat := ImageFormat fromInteger: 6521. ^true ] .
  [ 16rA0090100 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. aStream next: 4. ^true ] .
  [ 16rA2090100 "68002" ] -> [ imageFormat := ImageFormat fromInteger: 68002. aStream next: 4. ^true ] .
  [ 16rA3090100 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. aStream next: 4. ^true ] .
  [ 16rB3090100 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. aStream next: 4. ^true ] .
+ [ 16r000109B3 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. aStream next: 4. ^false ] .
+ [ 16rB5090100 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. aStream next: 4. ^true ] .
+ [ 16r000109B5 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. aStream next: 4. ^false ] .
  [ 16r00000000 ] -> [
+ "Standard interpreter VM puts the format number in the first 64 bits for a 64 bit image, so
+ the leading 4 bytes are zero in this case. Cog/Spur VMs put the format number in the first
+ 32 bits for both 32 and 64 bit images."
  (aStream nextNumber: 4) caseOf: {
  [ 16r000109A0 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. ^false ] .
  [ 16r000109A2 "68002" ] -> [ imageFormat := ImageFormat fromInteger: 68002. ^false ] .
  [ 16r000109A3 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. ^false ] .
  [ 16r000109B3 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. ^false ] .
  } otherwise: [self error: self asString , ' unrecognized format number']
  ]
  } otherwise: [self error: self asString , ' unrecognized format number']
 
  "ImageFormat versionNumberByteArrays do: [:e |
  Transcript cr; show: e printString , ': ', (ImageFormat fromBytes: e) description]
 
+ #[0 0 25 102]: a 32-bit image with no closure support and no native platform float word order requirement (6502)
+ #[102 25 0 0]: a 32-bit image with no closure support and no native platform float word order requirement (6502)
+ #[0 0 25 104]: a 32-bit image with closure support and no native platform float word order requirement (6504)
+ #[104 25 0 0]: a 32-bit image with closure support and no native platform float word order requirement (6504)
+ #[0 0 0 0 0 1 9 160]: a 64-bit image with no closure support and no native platform float word order requirement (68000)
+ #[160 9 1 0 0 0 0 0]: a 64-bit image with no closure support and no native platform float word order requirement (68000)
+ #[0 0 0 0 0 1 9 162]: a 64-bit image with closure support and no native platform float word order requirement (68002)
+ #[162 9 1 0 0 0 0 0]: a 64-bit image with closure support and no native platform float word order requirement (68002)
+ #[0 0 25 105]: a 32-bit image with closure support and float words stored in native platform order (6505)
+ #[105 25 0 0]: a 32-bit image with closure support and float words stored in native platform order (6505)
+ #[0 0 0 0 0 1 9 163]: a 64-bit image with closure support and float words stored in native platform order (68003)
+ #[163 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order (68003)
+ #[0 0 25 121]: a 32-bit image with closure support and float words stored in native platform order using Spur object format (6521)
+ #[121 25 0 0]: a 32-bit image with closure support and float words stored in native platform order using Spur object format (6521)
+ #[0 0 0 0 0 1 9 179]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019)
+ #[179 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019)
+ #[0 0 0 0 0 1 9 181]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021)
+ #[181 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021)
- #[0 0 25 102]: A 32-bit image with no closure support and no native platform float word order requirement (6502)
- #[102 25 0 0]: A 32-bit image with no closure support and no native platform float word order requirement (6502)
- #[0 0 25 104]: A 32-bit image with closure support and no native platform float word order requirement (6504)
- #[104 25 0 0]: A 32-bit image with closure support and no native platform float word order requirement (6504)
- #[0 0 0 0 0 1 9 160]: A 64-bit image with no closure support and no native platform float word order requirement (68000)
- #[160 9 1 0 0 0 0 0]: A 64-bit image with no closure support and no native platform float word order requirement (68000)
- #[0 0 0 0 0 1 9 162]: A 64-bit image with closure support and no native platform float word order requirement (68002)
- #[162 9 1 0 0 0 0 0]: A 64-bit image with closure support and no native platform float word order requirement (68002)
- #[0 0 25 105]: A 32-bit image with closure support and float words stored in native platform order (6505)
- #[105 25 0 0]: A 32-bit image with closure support and float words stored in native platform order (6505)
- #[0 0 0 0 0 1 9 163]: A 64-bit mage with closure support and float words stored in native platform order (68003)
- #[163 9 1 0 0 0 0 0]: A 64-bit image with closure support and float words stored in native platform order (68003)
-
  "
  !

Loading...