0 Members and 3 Guests are viewing this topic.
equates = ['Enii','9ndd'] prizmInstructions = ['Mov #imm, Rn','Mov.W @(disp*2+PC),Rn']
For the record, (and sorry I haven't already told you scout), but we are working on a GUI disassembler, and other stuff in a thing called prizmsuite.We've already got the google site set up for it, so if you want to host some code there scout, just send me a PM.
equates, prizmInstructions = zip(*[ ('Enii', 'Mov #imm, Rn'), ('9ndd', 'Mov.W @(disp*2+PC),Rn'), ('Dndd', 'MOV.L @(disp*4+PC),Rn'), ('6nm3', 'Mov Rm, Rn'), ('2nm0', 'MOV.B Rm,@Rn'), ('2nm1', 'Mov.W Rm,@Rn'), ('2nm2', 'Mov.L Rm,@Rn'), ('6nm0', 'Mov.B @Rm,Rn'), ('6nm1', 'Mov.W @Rm,Rn'), ('6nm2', 'Mov.L @Rm,Rn'), ('2nm4', 'MOV.B Rm,@-Rn'), ('2nm5', 'MOV.W Rm,@-Rn'), ('2nm6', 'MOV.L Rm,@-Rn'), ('6nm4', 'MOV.B @Rm+,Rn'), ('6nm5', 'MOV.W @Rm+,Rn'), ('6nm6', 'MOV.L @Rm+,Rn'), ('80nd', 'MOV.B R0,@(disp+Rn)'), ('81nd', 'MOV.W R0,@(disp*2+Rn)'), ('1nmd', 'MOV.L Rm,@(disp*4+Rn)'), ('84md', 'MOV.B @(disp+Rm),R0'), ('85md', 'MOV.W @(disp*2+Rm),R0'), ('5nmd', 'MOV.L @(disp*4+Rm),Rn'), ('0nm4', 'MOV.B Rm,@(R0+Rn)'), ('0nm5', 'MOV.W Rm,@(R0+Rn)'), ('0nm6', 'MOV.L Rm,@(R0+Rn)'), ('0nmC', 'MOV.B @(R0+Rm),Rn'), ('0nmD', 'MOV.W @(R0+Rm),Rn'), ('0nmE', 'MOV.L @(R0+Rm),Rn'), ('C0dd', 'MOV.B R0,@(disp+GBR)'), ('C1dd', 'MOV.W R0,@(disp*2+GBR)'), ('C2dd', 'MOV.L R0,@(disp*4+GBR)'), ('C4dd', 'MOV.B @(disp+GBR),R0'), ('C5dd', 'MOV.W @(disp*2+GBR),R0'), ('C6dd', 'MOV.W @(disp*4+GBR),R0'), ('C7dd', 'MOVA @(disp*4+PC),R0'), ('0n29', 'MOVT Rn'), ('0n83', 'PREF @Rn'), ('6nm8', 'SWAP.B Rm,Rn'), ('6nm9', 'SWAP.W Rm,Rn'), ('2nmD', 'XTRCT Rm,Rn'), ('3nmC', 'ADD Rm,Rn'), ('7nii', 'ADD #imm,Rn'), ('3nmE', 'ADDC Rm,Rn'), ('3nmF', 'ADDV Rm,Rn'), ('88ii', 'CMP/EQ #imm,R0'), ('3nm0', 'CMP/EQ Rn,Rm'), ('3nm2', 'CMP/HS Rm,Rn'), ('3nm3', 'CMP/GE Rm,Rn'), ('3nm6', 'CMP/HI Rm,Rn'), ('3nm7', 'CMP/GT Rm,Rn'), ('4n11', 'CMP/PZ Rn'), ('4n15', 'CMP/PL Rn'), ('2nmC', 'CMP/STR Rm,Rn'), ('3nm4', 'DIV1 Rm,Rn'), ('2nm7', 'DIV0S Rm,Rn'), ('001A', 'DIV0U'), ('3nmD', 'DMULS.L Rm,Rn'), ('3nm5', 'DMULU.L Rm,Rn'), ('4n10', 'DT Rn'), ('6nmE', 'EXTS.B Rm,Rn'), ('6nmF', 'EXTS.W Rm,Rn'), ('6nmC', 'EXTU.B Rm,Rn'), ('6nmD', 'EXTU.W Rm,Rn'), ('0nmF', 'MAC.L @Rm+,@Rn+'), ('4nmF', 'MAC.W @Rm+,@Rn+'), ('0nm7', 'MUL.L Rm,Rn'), ('2nmF', 'MULS.W Rm,Rn'), ('2nmE', 'MULU.W Rm,Rn'), ('6nmB', 'NEG Rm,Rn'), ('6nmA', 'NEGC Rm,Rn'), ('3nm8', 'SUB Rm,Rn'), ('3nmA', 'SUBC Rm,Rn'), ('3nmB', 'SUBV Rm,Rn'), ('2nm9', 'AND Rm,Rn'), ('C9ii', 'AND #imm,R0'), ('CDii', 'AND.B #imm,@(R0+GBR)'), ('6nm7', 'NOT Rm,Rn'), ('2nmB', 'OR Rm,Rn'), ('CBii', 'OR #imm,R0'), ('CFii', 'OR.B #imm,@(R0+GBR)'), ('4nm8', 'TAS.B @Rn'), ('2nm8', 'TST Rm,Rn'), ('C8ii', 'TST #imm,R0'), ('CCii', 'TST.B #imm,@(R0+GBR)'), ('2nmA', 'XOR Rm,Rn'), ('CAii', 'XOR #imm,R0'), ('CEii', 'XOR.B #imm,@(R0+GBR)'), ('4n04', 'ROTL Rn'), ('4n05', 'ROTR Rn'), ('4n24', 'ROTCL Rn'), ('4n25', 'ROTCR Rn'), ('4nmC', 'SHAD Rm,Rn'), ('4n20', 'SHAL Rn'), ('4n21', 'SHAR Rn'), ('4nmD', 'SHLD Rm,Rn'), ('4n00', 'SHLL Rn'), ('4n01', 'SHLR Rn'), ('4n08', 'SHLL2 Rn'), ('4n09', 'SHLR2 Rn'), ('4n18', 'SHLL8 Rn'), ('4n19', 'SHLR8 Rn'), ('4n28', 'SHLR8 Rn'), ('4n29', 'SHLR16 Rn'), ('8Bdd', 'BF label'), ('8Fdd', 'BF/S label'), ('89dd', 'BT label'), ('8Ddd', 'BT/S label'), ('Addd', 'BRA label'), ('0n03', 'BRAF Rn'), ('Bddd', 'BSR label'), ('0n03', 'BSRF Rn'), ('4n2B', 'JMP @Rn'), ('4n0B', 'JSR @Rn'), ('000B', 'RTS'), ('0028', 'CLRMAC'), ('0048', 'CLRS'), ('0008', 'CLRT'), ('4m0E', 'LDC Rm,SR'), ('4m1E', 'LDC Rm,GBR'), ('4m2E', 'LDC Rm,VBR'), ('4M3E', 'LDC Rm,SSR'), ('4m4E', 'LDC Rm,SPC'), ('4m8E', 'LDC Rm,R0_BANK'), ('4m9E', 'LDC Rm,R1_BANK'), ('4mAE', 'LDC Rm,R2_BANK'), ('4mBE', 'LDC Rm,R3_BANK'), ('4mCE', 'LDC Rm,R4_BANK'), ('4mDE', 'LDC Rm,R5_BANK'), ('4mEE', 'LDC Rm,R6_BANK'), ('4mFE', 'LDC Rm,R7_BANK'), ('4m07', 'LDC.L @Rm+,SR'), ('4m17', 'LDC.L @Rm+,GBR'), ('4m27', 'LDC.L @Rm+,VBR'), ('4m37', 'LDC.L @Rm+,SSR'), ('4m47', 'LDC.L @Rm+,SPC'), ('4m87', 'LDC.L @Rm+,R0_BANK'), ('4m97', 'LDC.L @Rm+,R1_BANK'), ('4mA7', 'LDC.L @Rm+,R2_BANK'), ('4mB7', 'LDC.L @Rm+,R3_BANK'), ('4mC7', 'LDC.L @Rm+,R4_BANK'), ('4mD7', 'LDC.L @Rm+,R5_BANK'), ('4mE7', 'LDC.L @Rm+,R6_BANK'), ('4mF7', 'LDC.L @Rm+,R7_BANK'), ('4m0A', 'LDS Rm,MACH'), ('4m1A', 'LDS Rm,MACL'), ('4m2A', 'LDS Rm,PR'), ('4m06', 'LDS.L @Rm+,MACH'), ('4m16', 'LDS.L @Rm+,MACL'), ('4m26', 'LDS.L @Rm+,PR'), ('0038', 'LDTLB'), ('0009', 'NOP'), ('0n83', 'PREF @Rn'), ('002B', 'RTE'), ('0058', 'SETS'), ('0018', 'SETT'), ('001B', 'SLEEP'), ('0n02', 'STC SR,Rn'), ('0n12', 'STC GBR,Rn'), ('0n22', 'STC VBR,Rn'), ('0n32', 'STC SSR,Rn'), ('0n42', 'STC SPC,Rn'), ('0n82', 'STC R0_BANK,Rn'), ('0n92', 'STC R1_BANK,Rn'), ('0nA2', 'STC R2_BANK,Rn'), ('0nB2', 'STC R3_BANK,Rn'), ('0nC2', 'STC R4_BANK,Rn'), ('0nD2', 'STC R5_BANK,Rn'), ('0nE2', 'STC R6_BANK,Rn'), ('0nF2', 'STC R7_BANK,Rn'), ('4n03', 'STC.L SR,@-Rn'), ('4n13', 'STC.L GBR,@-Rn'), ('4n23', 'STC.L VBR,@-Rn'), ('4n33', 'STC.L SSR,@-Rn'), ('4n43', 'STC.L SPC,@-Rn'), ('4n83', 'STC.L R0_BANK,@-Rn'), ('4n93', 'STC.L R1_BANK,@-Rn'), ('4nA3', 'STC.L R2_BANK,@-Rn'), ('4nB3', 'STC.L R3_BANK,@-Rn'), ('4nC3', 'STC.L R4_BANK,@-Rn'), ('4nD3', 'STC.L R5_BANK,@-Rn'), ('4nE3', 'STC.L R6_BANK,@-Rn'), ('4nF3', 'STC.L R7_BANK,@-Rn'), ('0n0A', 'STS MACH,Rn'), ('0n1A', 'STS MACL,Rn'), ('0n2A', 'STS PR,Rn'), ('4n02', 'STS.L MACH,@-Rn'), ('4n12', 'STS.L MACL,@-Rn'), ('4n22', 'STS.L PR,@-Rn'), ('C3ii', 'TRAPA #imm'),])
Golpat, is that a dictionary? If that is python, I am not aware of what that is. Also, I'm very happy that you made it I have to know what that is to use it.
c:\> sh3_disass.py Geometry.g3a 7000 7020 > Geometry.Sc:\> type Geometry.S00007000: MOV.L R14,@-R1500007002: STS.L PR,@-R1500007004: ADD $FC,R1500007006: MOV.L R4,@R1500007008: MOV.L @($07*4+PC),R3 = 6563D7050000700A: JSR @R30000700C: MOV R5, R140000700E: MOV.L @($07*4+PC),R1 = 64F27F0400007010: MOV $01, R600007012: MOV $00, R400007014: JSR @R1
MOV.L R14,@–R15STS.L PR,@–R15ADD $FC,R15MOV.L R4,@R15MOV.L @($07*4+PC),R3JSR @R3MOV R14, R5
I accidentally got MOV R14, R5 instead of the correct MOV R5, R14
equates = ['Enii','9ndd','Dndd','6nm3','2nm0','2nm1','2nm2','6nm0','6nm1','6nm2','2nm4','2nm5','2nm6','6nm4','6nm5','6nm6','80nd','81nd','1nmd','84md','85md','5nmd','0nm4','0nm5','0nm6','0nmC','0nmD','0nmE','C0dd','C1dd','C2dd','C4dd','C5dd','C6dd','C7dd','0n29','0n83','6nm8','6nm9','2nmD','3nmC','7nii','3nmE','3nmF','88ii','3nm0','3nm2','3nm3','3nm6','3nm7','4n11','4n15','2nmC','3nm4','2nm7','001A','3nmD','3nm5','4n10','6nmE','6nmF','6nmC','6nmD','0nmF','4nmF','0nm7','2nmF','2nmE','6nmB','6nmA','3nm8','3nmA','3nmB','2nm9','C9ii','CDii','6nm7','2nmB','CBii','CFii','4nm8','2nm8','C8ii','CCii','2nmA','CAii','CEii','4n04','4n05','4n24','4n25','4nmC','4n20','4n21','4nmD','4n00','4n01','4n08','4n09','4n18','4n19','4n28','4n29','8Bdd','8Fdd','89dd','8Ddd','Addd','0n03','Bddd','0n03','4n2B','4n0B','000B','0028','0048','0008','4m0E','4m1E','4m2E','4M3E','4m4E','4m8E','4m9E','4mAE','4mBE','4mCE','4mDE','4mEE','4mFE','4m07','4m17','4m27','4m37','4m47','4m87','4m97','4mA7','4mB7','4mC7','4mD7','4mE7','4mF7','4m0A','4m1A','4m2A','4m06','4m16','4m26','0038','0009','0n83','002B','0058','0018','001B','0n02','0n12','0n22','0n32','0n42','0n82','0n92','0nA2','0nB2','0nC2','0nD2','0nE2','0nF2','4n03','4n13','4n23','4n33','4n43','4n83','4n93','4nA3','4nB3','4nC3','4nD3','4nE3','4nF3','0n0A','0n1A','0n2A','4n02','4n12','4n22','C3ii']
prizmInstructions = ['Mov #imm, Rn','Mov.W @(disp*2+PC),Rn','MOV.L @(disp*4+PC),Rn','Mov Rm, Rn','MOV.B Rm,@Rn','Mov.W Rm,@Rn','Mov.L Rm,@Rn','Mov.B @Rm,Rn','Mov.W @Rm,Rn','Mov.L @Rm,Rn','MOV.B Rm,@-Rn','MOV.W Rm,@-Rn','MOV.L Rm,@-Rn','MOV.B @Rm+,Rn','MOV.W @Rm+,Rn','MOV.L @Rm+,Rn','MOV.B R0,@(disp+Rn)','MOV.W R0,@(disp*2+Rn)','MOV.L Rm,@(disp*4+Rn)','MOV.B @(disp+Rm),R0','MOV.W @(disp*2+Rm),R0','MOV.L @(disp*4+Rm),Rn','MOV.B Rm,@(R0+Rn)','MOV.W Rm,@(R0+Rn)','MOV.L Rm,@(R0+Rn)','MOV.B @(R0+Rm),Rn','MOV.W @(R0+Rm),Rn','MOV.L @(R0+Rm),Rn','MOV.B R0,@(disp+GBR)','MOV.W R0,@(disp*2+GBR)','MOV.L R0,@(disp*4+GBR)','MOV.B @(disp+GBR),R0','MOV.W @(disp*2+GBR),R0','MOV.W @(disp*4+GBR),R0','MOVA @(disp*4+PC),R0','MOVT Rn','PREF @Rn','SWAP.B Rm,Rn','SWAP.W Rm,Rn','XTRCT Rm,Rn','ADD Rm,Rn','ADD #imm,Rn','ADDC Rm,Rn','ADDV Rm,Rn','CMP/EQ #imm,R0','CMP/EQ Rn,Rm','CMP/HS Rm,Rn','CMP/GE Rm,Rn','CMP/HI Rm,Rn','CMP/GT Rm,Rn','CMP/PZ Rn','CMP/PL Rn','CMP/STR Rm,Rn','DIV1 Rm,Rn','DIV0S Rm,Rn','DIV0U','DMULS.L Rm,Rn','DMULU.L Rm,Rn','DT Rn','EXTS.B Rm,Rn','EXTS.W Rm,Rn','EXTU.B Rm,Rn','EXTU.W Rm,Rn','MAC.L @Rm+,@Rn+','MAC.W @Rm+,@Rn+','MUL.L Rm,Rn','MULS.W Rm,Rn','MULU.W Rm,Rn','NEG Rm,Rn','NEGC Rm,Rn','SUB Rm,Rn','SUBC Rm,Rn','SUBV Rm,Rn','AND Rm,Rn','AND #imm,R0','AND.B #imm,@(R0+GBR)','NOT Rm,Rn','OR Rm,Rn','OR #imm,R0','OR.B #imm,@(R0+GBR)','TAS.B @Rn','TST Rm,Rn','TST #imm,R0','TST.B #imm,@(R0+GBR)','XOR Rm,Rn','XOR #imm,R0','XOR.B #imm,@(R0+GBR)','ROTL Rn','ROTR Rn','ROTCL Rn','ROTCR Rn','SHAD Rm,Rn','SHAL Rn','SHAR Rn','SHLD Rm,Rn','SHLL Rn','SHLR Rn','SHLL2 Rn','SHLR2 Rn','SHLL8 Rn','SHLR8 Rn','SHLR8 Rn','SHLR16 Rn','BF label','BF/S label','BT label','BT/S label','BRA label','BRAF Rn','BSR label','BSRF Rn','JMP @Rn','JSR @Rn','RTS','CLRMAC','CLRS','CLRT','LDC Rm,SR','LDC Rm,GBR','LDC Rm,VBR','LDC Rm,SSR','LDC Rm,SPC','LDC Rm,R0_BANK','LDC Rm,R1_BANK','LDC Rm,R2_BANK','LDC Rm,R3_BANK','LDC Rm,R4_BANK','LDC Rm,R5_BANK','LDC Rm,R6_BANK','LDC Rm,R7_BANK','LDC.L @Rm+,SR','LDC.L @Rm+,GBR','LDC.L @Rm+,VBR','LDC.L @Rm+,SSR','LDC.L @Rm+,SPC','LDC.L @Rm+,R0_BANK','LDC.L @Rm+,R1_BANK','LDC.L @Rm+,R2_BANK','LDC.L @Rm+,R3_BANK','LDC.L @Rm+,R4_BANK','LDC.L @Rm+,R5_BANK','LDC.L @Rm+,R6_BANK','LDC.L @Rm+,R7_BANK','LDS Rm,MACH','LDS Rm,MACL','LDS Rm,PR','LDS.L @Rm+,MACH','LDS.L @Rm+,MACL','LDS.L @Rm+,PR','LDTLB','NOP','PREF @Rn','RTE','SETS','SETT','SLEEP','STC SR,Rn','STC GBR,Rn','STC VBR,Rn','STC SSR,Rn','STC SPC,Rn','STC R0_BANK,Rn','STC R1_BANK,Rn','STC R2_BANK,Rn','STC R3_BANK,Rn','STC R4_BANK,Rn','STC R5_BANK,Rn','STC R6_BANK,Rn','STC R7_BANK,Rn','STC.L SR,@-Rn','STC.L GBR,@-Rn','STC.L VBR,@-Rn','STC.L SSR,@-Rn','STC.L SPC,@-Rn','STC.L R0_BANK,@-Rn','STC.L R1_BANK,@-Rn','STC.L R2_BANK,@-Rn','STC.L R3_BANK,@-Rn','STC.L R4_BANK,@-Rn','STC.L R5_BANK,@-Rn','STC.L R6_BANK,@-Rn','STC.L R7_BANK,@-Rn','STS MACH,Rn','STS MACL,Rn','STS PR,Rn','STS.L MACH,@-Rn','STS.L MACL,@-Rn','STS.L PR,@-Rn','TRAPA #imm']