I'm making some progress in being able to decode an IAL style inverse assembler back into equivalent source code that could be assembled with the 10391B ASM.EXE assembler.
Below is what I currently get from processing the "6800/02 IA FOR GP PROBES 1_0" inverse assembler file i6800_p. I still need to handle declaring variables and constants with their initial values, and declaring strings and format strings instead of putting them inline.
Interesting that it turns out that the "6800/02 IA FOR GP PROBES 1_0" inverse assembler file i6800_p is the same as the "6800/02 IA FOR INTERFACE 1_0" inverse assembler file i6800_i file, except that the i6800_p version does this, which selects which status decoding is used (except in the TASK = 3 case):
LABEL_0015
GOTO LABEL_0016
while the i6800_i version does this:
LABEL_0015
GOTO LABEL_0026
"IAL"
IF TASK = 3 THEN GOTO LABEL_0010
IF TASK = 4 THEN GOTO LABEL_0015
IF TASK = 5 THEN GOTO LABEL_0015
OUTPUT "Illegal Task Request"
ABORT
OUTPUT "Data Error"
ABORT
LABEL_000D
POSITION ABS,1
OUTPUT "Illegal Opcode"
ABORT
LABEL_0010
LOAD ID_CODE
IF 7,0 = VAR_0048 THEN GOTO LABEL_0016
GOTO LABEL_0026
LABEL_0015
GOTO LABEL_0016
LABEL_0016
LOAD INPUT_TAG
IF 17,16 = 0 THEN GOTO LABEL_0043
LOAD INPUT_STATUS
IF 2,2 = 1 THEN GOTO LABEL_0043
LOAD INPUT_TAG
CASE_OF 1,0
GOTO LABEL_01A2
GOTO LABEL_0043
GOTO LABEL_0054
NOP
CASE_END
RETURN
LABEL_0026
LOAD INPUT_STATUS
IF 3,0 = 9 THEN GOTO LABEL_005B
LOAD INPUT_DATA
POSITION ABS,3
OUTPUT ACCUMULATOR,FORMAT=8,HEX,2
POSITION REL,1
LOAD INPUT_STATUS
CASE_OF 3,0
OUTPUT "Illegal Opcode"
OUTPUT "operand fetch"
OUTPUT "stack read"
OUTPUT "stack write"
OUTPUT "stack read"
OUTPUT "stack write"
OUTPUT "halt"
OUTPUT "vector"
OUTPUT "unused"
OUTPUT "opcode fetch"
OUTPUT "DMA read"
OUTPUT "DMA write"
OUTPUT "memory write"
OUTPUT "memory read"
OUTPUT "out of synch"
OUTPUT "interrupt ack"
CASE_END
SET RETURN_FLAGS,0
RETURN
LABEL_0043
LOAD INPUT_DATA
POSITION ABS,3
OUTPUT ACCUMULATOR,FORMAT=8,HEX,2
POSITION REL,1
LOAD INPUT_STATUS
CASE_OF 2,0
OUTPUT "non valid cycle"
OUTPUT "non valid cycle"
OUTPUT "memory write"
OUTPUT "memory read"
OUTPUT "dma or halt"
OUTPUT "dma or halt"
OUTPUT "dma or halt"
OUTPUT "dma or halt"
CASE_END
SET RETURN_FLAGS,0
RETURN
LABEL_0054
LOAD INPUT_DATA
POSITION ABS,3
OUTPUT ACCUMULATOR,FORMAT=8,HEX,2
POSITION REL,1
OUTPUT "unused cycle"
SET RETURN_FLAGS,0
RETURN
LABEL_005B
SET RETURN_FLAGS,1
INPUT REL,0
LOAD INITIAL_DATA
CASE_OF 7,7
GOTO LABEL_0062
GOTO LABEL_0103
CASE_END
LABEL_0062
CASE_OF 7,4
GOTO LABEL_006C
GOTO LABEL_008C
GOTO LABEL_009F
GOTO LABEL_00C4
GOTO LABEL_00E2
GOTO LABEL_00E2
GOTO LABEL_00E2
GOTO LABEL_00E2
CASE_END
LABEL_006C
CASE_OF 3,0
GOTO LABEL_000D
OUTPUT "NOP"
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
OUTPUT "TAP"
OUTPUT "TPA"
OUTPUT "INX"
OUTPUT "DEX"
GOTO LABEL_007F
GOTO LABEL_0081
GOTO LABEL_007F
GOTO LABEL_0081
GOTO LABEL_007F
GOTO LABEL_0081
CASE_END
RETURN
LABEL_007F
OUTPUT "CL"
GOTO LABEL_0082
LABEL_0081
OUTPUT "SE"
LABEL_0082
IF 2,1 = 1 THEN OUTPUT "V"
IF 2,1 = 2 THEN OUTPUT "C"
IF 2,1 = 3 THEN OUTPUT "I"
RETURN
LABEL_008C
CASE_OF 3,0
OUTPUT "SBA"
OUTPUT "CBA"
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
OUTPUT "TAB"
OUTPUT "TBA"
GOTO LABEL_000D
OUTPUT "DAA"
GOTO LABEL_000D
OUTPUT "ABA"
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
CASE_END
RETURN
LABEL_009F
OUTPUT "B"
CASE_OF 3,0
OUTPUT "RA"
GOTO LABEL_000D
OUTPUT "HI"
OUTPUT "LS"
OUTPUT "CC"
OUTPUT "CS"
OUTPUT "NE"
OUTPUT "EQ"
OUTPUT "VC"
OUTPUT "VS"
OUTPUT "PL"
OUTPUT "MI"
OUTPUT "GE"
OUTPUT "LT"
OUTPUT "GT"
OUTPUT "LE"
CASE_END
LABEL_00B2
INCREMENT INPUT_ADDRESS
LOAD INPUT_ADDRESS
ADD 1
STORE VAR_003E
INPUT ABS,INPUT_ADDRESS
IF INPUT_ERROR <> 0 THEN GOTO LABEL_017C
LOAD INPUT_DATA
POSITION ABS,6
IF 7,7 = 1 THEN INCLUSIVE_OR VAR_0046
ADD VAR_003E
AND VAR_0042
IF_NOT_MAPPED THEN OUTPUT ACCUMULATOR,FORMAT=16,HEX,4
RETURN
LABEL_00C4
CASE_OF 3,0
OUTPUT "TSX"
OUTPUT "INS"
GOTO LABEL_00D7
GOTO LABEL_00D7
OUTPUT "DES"
OUTPUT "TXS"
GOTO LABEL_00D7
GOTO LABEL_00D7
GOTO LABEL_000D
OUTPUT "RTS"
GOTO LABEL_000D
OUTPUT "RTI"
GOTO LABEL_000D
GOTO LABEL_000D
OUTPUT "WAI"
OUTPUT "SWI"
CASE_END
RETURN
LABEL_00D7
IF 2,2 = 0 THEN OUTPUT "PUL"
IF 2,2 = 1 THEN OUTPUT "PSH"
CASE_OF 0,0
GOTO LABEL_00FF
GOTO LABEL_0101
CASE_END
RETURN
LABEL_00E2
CASE_OF 3,0
OUTPUT "NEG"
GOTO LABEL_000D
GOTO LABEL_000D
OUTPUT "COM"
OUTPUT "LSR"
GOTO LABEL_000D
OUTPUT "ROR"
OUTPUT "ASR"
OUTPUT "ASL"
OUTPUT "ROL"
OUTPUT "DEC"
GOTO LABEL_000D
OUTPUT "INC"
OUTPUT "TST"
GOTO LABEL_00F5
OUTPUT "CLR"
CASE_END
GOTO LABEL_00F9
LABEL_00F5
CASE_OF 5,5
GOTO LABEL_000D
OUTPUT "JMP"
CASE_END
LABEL_00F9
CASE_OF 5,4
GOTO LABEL_00FF
GOTO LABEL_0101
GOTO LABEL_016B
GOTO LABEL_0170
CASE_END
LABEL_00FF
OUTPUT "A"
RETURN
LABEL_0101
OUTPUT "B"
RETURN
LABEL_0103
CASE_OF 3,0
OUTPUT "SUB"
OUTPUT "CMP"
OUTPUT "SBC"
GOTO LABEL_000D
OUTPUT "AND"
OUTPUT "BIT"
OUTPUT "LDA"
GOTO LABEL_0116
OUTPUT "EOR"
OUTPUT "ADC"
OUTPUT "ORA"
OUTPUT "ADD"
GOTO LABEL_011E
GOTO LABEL_0126
GOTO LABEL_0138
GOTO LABEL_0141
CASE_END
GOTO LABEL_0150
LABEL_0116
IF 7,4 = 8 THEN GOTO LABEL_000D
IF 7,4 = 12 THEN GOTO LABEL_000D
OUTPUT "STA"
GOTO LABEL_0150
LABEL_011E
IF 7,4 >= 12 THEN GOTO LABEL_000D
OUTPUT "CPX"
IF 5,4 = 0 THEN GOTO LABEL_0161
GOTO LABEL_0156
LABEL_0126
IF 7,4 = 9 THEN GOTO LABEL_000D
IF 7,4 >= 12 THEN GOTO LABEL_000D
IF 5,4 = 0 THEN GOTO LABEL_0136
OUTPUT "JSR"
IF 5,4 = 2 THEN GOTO LABEL_016B
IF 5,4 = 3 THEN GOTO LABEL_0170
LABEL_0136
OUTPUT "BSR"
GOTO LABEL_00B2
LABEL_0138
OUTPUT "LD"
CASE_OF 6,6
OUTPUT "S"
OUTPUT "X"
CASE_END
IF 5,4 = 0 THEN GOTO LABEL_0161
GOTO LABEL_0156
LABEL_0141
IF 7,4 = 8 THEN GOTO LABEL_000D
IF 7,4 = 12 THEN GOTO LABEL_000D
OUTPUT "ST"
CASE_OF 6,6
OUTPUT "S"
OUTPUT "X"
CASE_END
IF 5,4 = 0 THEN GOTO LABEL_0161
GOTO LABEL_0156
LABEL_0150
IF 6,6 = 0 THEN CALL LABEL_00FF
IF 6,6 = 1 THEN CALL LABEL_0101
LABEL_0156
CASE_OF 5,4
GOTO LABEL_015C
GOTO LABEL_0166
GOTO LABEL_016B
GOTO LABEL_0170
CASE_END
LABEL_015C
POSITION ABS,6
OUTPUT "#"
CALL LABEL_0175
OUTPUT ACCUMULATOR,FORMAT=8,HEX,2
RETURN
LABEL_0161
POSITION ABS,6
OUTPUT "#"
CALL LABEL_017E
OUTPUT ACCUMULATOR,FORMAT=16,HEX,4
RETURN
LABEL_0166
POSITION ABS,6
CALL LABEL_0175
IF_NOT_MAPPED THEN OUTPUT ACCUMULATOR,FORMAT=16,HEX,4
RETURN
LABEL_016B
POSITION ABS,6
CALL LABEL_0175
OUTPUT ACCUMULATOR,FORMAT=8,HEX,2
OUTPUT ",X"
RETURN
LABEL_0170
POSITION ABS,6
CALL LABEL_017E
IF_NOT_MAPPED THEN OUTPUT ACCUMULATOR,FORMAT=16,HEX,4
RETURN
LABEL_0175
INCREMENT INPUT_ADDRESS
INPUT ABS,INPUT_ADDRESS
IF INPUT_ERROR <> 0 THEN GOTO LABEL_017C
LOAD INPUT_DATA
RETURN
LABEL_017C
OUTPUT "**"
ABORT
LABEL_017E
INCREMENT INPUT_ADDRESS
LOAD INPUT_ADDRESS
STORE VAR_003C
INPUT ABS,INPUT_ADDRESS
IF INPUT_ERROR <> 0 THEN GOTO LABEL_0192
LOAD INPUT_DATA
ROTATE LEFT,8
AND VAR_0044
STORE VAR_0034
INCREMENT INPUT_ADDRESS
INPUT ABS,INPUT_ADDRESS
IF INPUT_ERROR <> 0 THEN GOTO LABEL_019D
LOAD INPUT_DATA
AND VAR_004A
INCLUSIVE_OR VAR_0034
RETURN
LABEL_0192
OUTPUT "**"
LOAD VAR_003C
STORE INPUT_ADDRESS
INCREMENT INPUT_ADDRESS
INPUT ABS,INPUT_ADDRESS
IF INPUT_ERROR <> 0 THEN GOTO LABEL_01A0
LOAD INPUT_DATA
OUTPUT ACCUMULATOR,FORMAT=8,HEX,2
ABORT
LABEL_019D
LOAD VAR_0034
ROTATE RIGHT,8
OUTPUT ACCUMULATOR,FORMAT=8,HEX,2
LABEL_01A0
OUTPUT "**"
ABORT
LABEL_01A2
SET VAR_0040,0
LABEL_01A3
LOAD INPUT_STATUS
IF 1,0 = 3 THEN GOTO LABEL_01AE
TAG_WITH 2
INCREMENT VAR_0040
INPUT REL,VAR_0040
IF INPUT_ERROR <> 0 THEN GOTO LABEL_005B
GOTO LABEL_01A3
LABEL_01AE
LOAD INPUT_DATA
CASE_OF 7,0
GOTO LABEL_000D
LOAD 56
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
LOAD 56
LOAD 56
LOAD VAR_004C
LOAD VAR_004E
LOAD 56
LOAD 56
LOAD 56
LOAD 56
LOAD 56
LOAD 56
LOAD 56
LOAD 56
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
LOAD 56
LOAD 56
GOTO LABEL_000D
LOAD 56
GOTO LABEL_000D
LOAD 56
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
GOTO LABEL_000D
LOAD VAR_0050
GOTO LABEL_000D
LOAD VAR_0052
LOAD VAR_0054
LOAD VAR_0056
LOAD VAR_0058
LOAD VAR_005A
LOAD VAR_005C
LOAD VAR_005E
LOAD VAR_0060
LOAD VAR_0062
LOAD VAR_0064
LOAD VAR_0066
LOAD VAR_0068
LOAD VAR_006A
LOAD VAR_006C
LOAD VAR_006E
LOAD VAR_0070
LOAD VAR_0072
LOAD VAR_0074
LOAD VAR_0076
LOAD VAR_0078
LOAD VAR_007A
LOAD VAR_007C
GOTO LABEL_000D
LOAD VAR_007E
GOTO LABEL_000D
LOAD VAR_0080
GOTO LABEL_000D
GOTO LABEL_000D
LOAD VAR_0082
LOAD VAR_0084
LOAD 56
GOTO LABEL_000D
GOTO LABEL_000D
LOAD 56
LOAD 56
GOTO LABEL_000D
LOAD 56
LOAD 56
LOAD 56
LOAD 56
LOAD 56
GOTO LABEL_000D
LOAD 56
LOAD 56
GOTO LABEL_000D
LOAD 56
LOAD 56
GOTO LABEL_000D
GOTO LABEL_000D
LOAD 56
LOAD 56
GOTO LABEL_000D
LOAD 56
LOAD 56
LOAD 56
LOAD 56
LOAD 56
GOTO LABEL_000D
LOAD 56
LOAD 56
GOTO LABEL_000D
LOAD 56
LOAD VAR_0086
GOTO LABEL_000D
GOTO LABEL_000D
LOAD VAR_0088
LOAD VAR_008A
GOTO LABEL_000D
LOAD VAR_008C
LOAD VAR_008E
LOAD VAR_0090
LOAD VAR_0092
LOAD VAR_0094
GOTO LABEL_000D
LOAD VAR_0096
LOAD VAR_0098
LOAD VAR_009A
LOAD VAR_009C
LOAD VAR_009E
GOTO LABEL_000D
GOTO LABEL_000D
LOAD VAR_00A0
LOAD VAR_00A2
GOTO LABEL_000D
LOAD VAR_00A4
LOAD VAR_00A6
LOAD VAR_00A8
LOAD VAR_00AA
LOAD VAR_00AC
GOTO LABEL_000D
LOAD VAR_00AE
LOAD VAR_00B0
LOAD VAR_00B2
LOAD VAR_00B4
LOAD 52
LOAD 52
LOAD 52
GOTO LABEL_000D
LOAD 52
LOAD 52
LOAD 52
GOTO LABEL_000D
LOAD 52
LOAD 52
LOAD 52
LOAD 52
LOAD VAR_00B6
LOAD VAR_00B8
LOAD VAR_00BA
GOTO LABEL_000D
LOAD VAR_00BC
LOAD VAR_00BE
LOAD VAR_00C0
GOTO LABEL_000D
LOAD VAR_00C2
LOAD VAR_00C4
LOAD VAR_00C6
LOAD VAR_00C8
LOAD VAR_00CA
LOAD VAR_00CC
LOAD VAR_00CE
LOAD VAR_00D0
LOAD VAR_00D2
GOTO LABEL_000D
LOAD VAR_00D4
LOAD VAR_00D6
LOAD VAR_00D8
LOAD VAR_00DA
LOAD VAR_00DC
GOTO LABEL_000D
LOAD VAR_00DE
LOAD VAR_00E0
LOAD VAR_00E2
LOAD VAR_00E4
LOAD VAR_00E6
LOAD VAR_00E8
LOAD VAR_00EA
LOAD VAR_00EC
LOAD VAR_00EE
LOAD VAR_00F0
LOAD VAR_00F2
LOAD VAR_00F4
LOAD VAR_00F6
LOAD VAR_00F8
LOAD VAR_00FA
GOTO LABEL_000D
LOAD VAR_00FC
LOAD VAR_00FE
LOAD VAR_0100
LOAD VAR_0102
LOAD VAR_0104
LOAD VAR_0106
LOAD VAR_0108
LOAD VAR_010A
LOAD VAR_010C
LOAD VAR_010E
LOAD VAR_0110
LOAD VAR_0112
LOAD 52
LOAD 52
LOAD 52
GOTO LABEL_000D
LOAD 52
LOAD 52
LOAD 52
GOTO LABEL_000D
LOAD 52
LOAD 52
LOAD 52
LOAD 52
GOTO LABEL_000D
GOTO LABEL_000D
LOAD VAR_0114
GOTO LABEL_000D
LOAD VAR_0116
LOAD VAR_0118
LOAD VAR_011A
GOTO LABEL_000D
LOAD VAR_011C
LOAD VAR_011E
LOAD VAR_0120
LOAD VAR_0122
LOAD VAR_0124
LOAD VAR_0126
LOAD VAR_0128
LOAD VAR_012A
GOTO LABEL_000D
GOTO LABEL_000D
LOAD VAR_012C
LOAD VAR_012E
LOAD VAR_0130
LOAD VAR_0132
LOAD VAR_0134
GOTO LABEL_000D
LOAD VAR_0136
LOAD VAR_0138
LOAD VAR_013A
LOAD VAR_013C
LOAD VAR_013E
LOAD VAR_0140
LOAD VAR_0142
LOAD VAR_0144
GOTO LABEL_000D
GOTO LABEL_000D
LOAD VAR_0146
LOAD VAR_0148
LOAD VAR_014A
LOAD VAR_014C
LOAD VAR_014E
GOTO LABEL_000D
LOAD VAR_0150
LOAD VAR_0152
LOAD VAR_0154
LOAD VAR_0156
LOAD VAR_0158
LOAD VAR_015A
LOAD VAR_015C
LOAD VAR_015E
GOTO LABEL_000D
GOTO LABEL_000D
LOAD VAR_0160
LOAD VAR_0162
CASE_END
LABEL_02B1
STORE VAR_0036
AND 3
STORE VAR_003A
IF 1,0 = 3 THEN GOTO LABEL_005B
TAG_WITH VAR_003A
LABEL_02B8
INCREMENT VAR_0040
INPUT REL,VAR_0040
IF INPUT_ERROR <> 0 THEN GOTO LABEL_005B
LOAD INPUT_STATUS
IF 2,2 = 1 THEN GOTO LABEL_02B8
LOAD VAR_0036
ROTATE RIGHT,2
GOTO LABEL_02B1