├── dumpros_small.jpg ├── README.md ├── LICENSE └── 5100_display_undump.py /dumpros_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stepleton/5100ExecutableROSDecode/HEAD/dumpros_small.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Decoding photographs of the IBM 5100's Executable ROS 2 | 3 | Follow the `.ipynb` file link for a detailed writeup and code. 4 | 5 | ## Licensing 6 | 7 | To the fullest extent possible, this project is released into the public domain. 8 | Nobody owns it. 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /5100_display_undump.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """Assemble screendump hex files into binary files. 3 | 4 | Usage: 5100_display_undump.py file1 file2 ... 5 | 6 | All files on the command line should be text files starting with twelve 7 | nonempty lines of 64 characters in [0123456789ABCDEF]. These files are assumed 8 | to be text transcriptions of the IBM 5x00 screen with the DISPLAY REGISTERS 9 | switch in the on position. 10 | 11 | This program will print binary data to stdout containing the same information 12 | as was shown on the IBM 5x00 screen. Data from successive files listed on the 13 | command line will be concatenated in the same order in the output. 14 | 15 | The DISPLAY REGISTERS display presents 256 16-bit "halfwords". Each halfword is 16 | shown as a 2x2 "square" of characters, e.g. 17 | 18 | AB 19 | CD 20 | 21 | which is the 16-bit value 0xABCD. The display presents the 256 halfwords in 22 | left-to-right, top-to-bottom order (or "row-major" order if you prefer). Refer 23 | to page 3-71 of the IBM 5100 Maintenance Information Manual (found at e.g. 24 | http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/5100/SY31-0405-3_5100maint_Oct79.pdf) 25 | for more details on this display. 26 | 27 | It's worth restating that this program will dump binary data directly to stdout. 28 | 29 | Licensing: 30 | 31 | This program and any supporting programs, software libraries, and documentation 32 | distributed alongside it are released into the public domain without any 33 | warranty. See the LICENSE file for details. 34 | """ 35 | 36 | import itertools 37 | import logging 38 | import sys 39 | 40 | 41 | def validate(filename, data): 42 | """Check that input data meets validity requirements, or fail.""" 43 | assert len(data) == 16, ( 44 | 'Screen transcription files must be 16 lines long, but {} has {} lines.' 45 | ''.format(filename, len(data))) 46 | assert all(len(d) == 64 for d in data), ( 47 | 'All lines in screen transcription files must contain exactly 64 ' 48 | 'characters, but {} deviates from this requirement.'.format(filename)) 49 | assert all(c in '0123456789ABCDEF' for c in ''.join(data)), ( 50 | 'Screen transcription files may only contain the characters "0123456789A' 51 | 'BCDEF", but {} has other characters.'.format(filename)) 52 | 53 | 54 | def decode(data): 55 | """Decode a DISPLAY REGISTERS screen dump as binary data.""" 56 | top_rows = ''.join(data[::2]) 57 | bot_rows = ''.join(data[1::2]) 58 | all_hex = ''.join(itertools.chain.from_iterable(zip(top_rows, bot_rows))) 59 | return bytes.fromhex(all_hex) 60 | 61 | 62 | def main(files): 63 | if not files: logging.warning( 64 | 'No files listed on commandline: output is empty.') 65 | for filename in files: 66 | with open(filename, 'r') as f: 67 | data = [l.upper() for l in f.read().splitlines()] 68 | validate(filename, data) 69 | sys.stdout.buffer.write(decode(data)) 70 | 71 | 72 | if __name__ == '__main__': 73 | main(sys.argv[1:]) 74 | --------------------------------------------------------------------------------