I'm working on generating JSON tests for the 8088 from hardware.
{
"name": "add byte ds:[bx+si+C2h], al",
"bytes": [0, 64, 194],
"initial": {
"regs": {
"ax": 52773,
"bx": 22214,
"cx": 16054,
"dx": 57938,
"cs": 60492,
"ss": 17184,
"ds": 15619,
"es": 60510,
"sp": 56738,
"bp": 13363,
"si": 58400,
"di": 31158,
"ip": 16937,
"flags": 62535
},
"ram": [
[264920, 71],
[984809, 0],
[984810, 64],
[984811, 194],
[984812, 144],
[984813, 144],
[984814, 144],
[984815, 144]
],
"queue": []
},
"final": {
"regs": {
"ax": 52773,
"bx": 22214,
"cx": 16054,
"dx": 57938,
"cs": 60492,
"ss": 17184,
"ds": 15619,
"es": 60510,
"sp": 56738,
"bp": 13363,
"si": 58400,
"di": 31158,
"ip": 16940,
"flags": 62470
},
"ram": [
[264920, 108],
[984809, 0],
[984810, 64],
[984811, 194],
[984812, 144],
[984813, 144],
[984814, 144],
[984815, 144]
],
"queue": [144, 144, 144]
},
"cycles": [
["-", 984810, "CS", "R--", "---", 0, "CODE", "T2", "F", 0],
["-", 984810, "CS", "R--", "---", 64, "PASV", "T3", "-", 0],
["-", 984810, "CS", "---", "---", 0, "PASV", "T4", "-", 0],
["A", 984811, "--", "---", "---", 0, "CODE", "T1", "-", 0],
["-", 984811, "CS", "R--", "---", 0, "CODE", "T2", "S", 64],
["-", 984811, "CS", "R--", "---", 194, "PASV", "T3", "-", 0],
["-", 984811, "CS", "---", "---", 0, "PASV", "T4", "-", 0],
["A", 984812, "--", "---", "---", 0, "CODE", "T1", "-", 0],
["-", 984812, "CS", "R--", "---", 0, "CODE", "T2", "-", 0],
["-", 984812, "CS", "R--", "---", 144, "PASV", "T3", "-", 0],
["-", 984812, "CS", "---", "---", 0, "PASV", "T4", "S", 194],
["A", 984813, "--", "---", "---", 0, "CODE", "T1", "-", 0],
["-", 984813, "CS", "R--", "---", 0, "CODE", "T2", "-", 0],
["-", 984813, "CS", "R--", "---", 144, "PASV", "T3", "-", 0],
["-", 984813, "CS", "---", "---", 0, "PASV", "T4", "-", 0],
["-", 984813, "--", "---", "---", 0, "PASV", "Ti", "-", 0],
["-", 984813, "--", "---", "---", 0, "PASV", "Ti", "-", 0],
["A", 264920, "--", "---", "---", 0, "MEMR", "T1", "-", 0],
["-", 264920, "DS", "R--", "---", 0, "MEMR", "T2", "-", 0],
["-", 264920, "DS", "R--", "---", 71, "PASV", "T3", "-", 0],
["-", 264920, "DS", "---", "---", 0, "PASV", "T4", "-", 0],
["A", 984814, "--", "---", "---", 0, "CODE", "T1", "-", 0],
["-", 984814, "CS", "R--", "---", 0, "CODE", "T2", "-", 0],
["-", 984814, "CS", "R--", "---", 144, "PASV", "T3", "-", 0],
["-", 984814, "CS", "---", "---", 0, "PASV", "T4", "-", 0],
["A", 984815, "--", "---", "---", 0, "CODE", "T1", "-", 0],
["-", 984815, "CS", "R--", "---", 0, "CODE", "T2", "-", 0],
["-", 984815, "CS", "R--", "---", 144, "PASV", "T3", "-", 0],
["-", 984815, "CS", "---", "---", 0, "PASV", "T4", "-", 0],
["A", 264920, "--", "---", "---", 0, "MEMW", "T1", "-", 0],
["-", 264920, "DS", "-A-", "---", 0, "MEMW", "T2", "-", 0],
["-", 264920, "DS", "-AW", "---", 108, "PASV", "T3", "-", 0]
]
}
Before I start generating these wholesale, I thought I'd request your feedback. Do you see any omissions or have any suggestions?
V1 of my test suite will execute all instructions fresh from a CPU reset; so the queue contents will always be empty at start, and all bytes after the instruction bytes are NOPs, so the queue will always contain nothing but NOPs at the end. The I and T flags are not exercised.
If V1 is well received, I plan to do a V2 which will capture instructions 'in-flight' with arbitrary starting queue contents, and exercise traps and interrupts, but I figure this V1 is a good start.