D8085AC and D27128D extracting program from EPROM - Page 1
Forum section: electronics / projects

author: Dom87
author_rank: Contributor
timestamp: April 25, 2020, 12:26:38 pm
content: Hi folks.I have an old piece of test equipment that uses an old school D8085AC processor and what appears to be a NEC D27128D as its EPROM.I was wondering how difficult it would be to extract the instructions from the D27128D and turn it into something meaningful, like assembly, that I could use to start figuring out the functionality.Thanks

author: Deni
author_rank: Regular Contributor
timestamp: April 25, 2020, 04:25:25 pm
content: Reading out EPROM is easy - there are many device programmers on the market, you can even build your own one usind Arduino, for example.The next step, disassembly, shoudl be simple too - there are many disassemblers for 8080/85. Analyzing disassembled code - well, that's up to your skills and persistence...

author: Dom87
author_rank: Contributor
timestamp: May 08, 2020, 09:59:50 pm
content: Thanks Deni.I found this article here from a blog called Dances with Ferrets...https://danceswithferrets.org/geekblog/?p=315and I now created an extract.Is there any particular disassembler you would recommend?

author: eblc1388
author_rank: Frequent Contributor
timestamp: May 09, 2020, 02:20:54 am
content: Hi Dom87,The author's Eprom reader in your above link generate a hex dump with ASCII, which is then send to your serial port on the PC. Therefore, each 8-bit Eprom data is sent as two ascii bytes, and the text file you can then capture in the terminal.However, most disassembler would only accept a true binary file image for disassembling. You will then need to do a lot of editing before the disassembler will accept it. You can modify the Arduino sketch to transfer the HEX data continuously without extra data like ascii representation, linefeed or carriage return, but then you still need to process the captured file into a true binary file.I don't know if one can send a binary values of 0x00~0xFF directly via the serial port.Regarding the disassembler, I would recommend the DASMx Version 1.40. Just search for "DASMx Version 1.40" in Google.edit: added disassembler info

author: amyk
author_rank: Super Contributor
timestamp: May 09, 2020, 02:48:46 am
content: Quote from: eblc1388 on May 09, 2020, 02:20:54 amYes you can, but you'd need some sort of framing protocol like PPP, HDLC, or SLIP. Otherwise it's just a stream of bytes.

author: Dom87
author_rank: Contributor
timestamp: May 09, 2020, 10:27:22 am
content: Thanks everyone. I think I have successfully converted the HEX/ASCII output from serial monitor (Arduino software).I copy and pasted all of the text from the monitor window and used a script I wrote to convert the string hex representation to a byte within the file.Code:void Main(){string filePath = @"F:\epromreadingfromarduino.txt";string[] rawLines = File.ReadAllLines(filePath);string dirPath = Path.GetDirectoryName(filePath);string fileName = Path.GetFileNameWithoutExtension(filePath);string binFile = $"{dirPath}\\{fileName}.bin";List<byte> bytesList = new List<byte>();foreach(var line in rawLines){if(line.Equals("Reading ROM ...", StringComparison.OrdinalIgnoreCase) || string.IsNullOrWhiteSpace(line)) continue;var lineData = line.Substring(0,32);var bytes = ConvertHexStringToByteArray(lineData);bytesList.AddRange(bytes);}ByteArrayToFile(binFile, bytesList.ToArray());}// Define other methods and classes hereprivate static byte[] ConvertHexStringToByteArray(string hexString){return Enumerable.Range(0, hexString.Length / 2).Select(i => Convert.ToByte(hexString.Substring(i * 2, 2), 16)).ToArray();}public bool ByteArrayToFile(string fileName, byte[] byteArray){try{using (var fs = new FileStream(fileName, FileMode.Create, FileAccess.Write)){fs.Write(byteArray, 0, byteArray.Length);return true;}}catch (Exception ex){Console.WriteLine("Exception caught in process: {0}", ex);return false;}}The file went from looking like this...To this, in a hex editor...Hopefully that is correct.

author: Dom87
author_rank: Contributor
timestamp: May 09, 2020, 10:43:24 am
content: Thanks for the suggestion of 'DASMx Version 1.40'.I have just given it a go, and it seems to have done the trick. It certainly it didn't complain about the file.Code:λ dasmx -c8085 reading_20200507_1926.binDASMx object code disassembler==============================(c) Copyright 1996-2003 Conquest ConsultantsVersion 1.40 (Oct 18 2003)CPU: Intel 8085 (MCS-80/85 family)Source file length: 16384 bytesPass 1...Pass 2...Now it looks like the arduous task of working out what is going on in the instructions.Thanks for your help.