15 April 2024, 17:14 | #121 |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
|
16 May 2024, 13:09 | #122 |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Hi. I'm having trouble processing offset hunk files with
-configand I'm not sure if this is user error or a bug. Using WB1.3 Calculator as a test case, this works as expected: Code:
ira -a -label=1 -radix=0 -compat=bi -preproc Calculator ira -a -label=1 -radix=0 -compat=bi -config Calculator Code:
ira -a -label=1 -radix=0 -compat=bi -offset=$10000 -preproc Calculator ira -a -label=1 -radix=0 -compat=bi -config Calculator DPass1(see below), before eventually crashing with read access vilolation Code:
IRA V2.11 (May 16 2024) (c)1993-1995 Tim Ruehsen (SiliconSurfer/PHANTASM) (c)2009-2023 Frank Wille (c)2014-2019 Nicolas Bastien SOURCE : "Calculator" TARGET : "Calculator.asm" CONFIG : "Calculator.cnf" MACHINE: MC68000 OFFSET : $00010000 codeAdrs: 0 codeAdrMax: 16 CodeArea[0]: 00010000 - 0001008a CodeArea[1]: 000100a2 - 00010582 ... CodeArea[19]: 00011df0 - 00011df0 CodeArea[20]: 00011df4 - 00011df4 Watch out: prgcounter(00010000) > nextreloc(00000080) Watch out: prgcounter(00010002) > nextreloc(00000080) Watch out: prgcounter(00010006) > nextreloc(00000080) ... Watch out: prgcounter(00010088) > nextreloc(00000080) P1 Missed bad reloc addr $00000080! Pass 1: 100% Pass 2: correcting labels Pass 2: writing mnemonics 0 adr=10000 This=0 0 adr=10002 This=0 0 adr=10006 This=0 ... 0 adr=10088 This=0 0 adr=1008a This=0 This is not a problem for -BINARY files. Many thanks for any help with this. EDIT: Passing -offset=$10000along with -configfixes this, but I thought the offset would be read from the config file. EDIT2: This seems to be an ordering bug: Code:
main() Init() ReadOptions() parse -OFFSET=<OFFSET> into ira->params.prgStart ReadAmigaHunkExecutable(ira); ExamineHunks() set ira->hunksOffs[] from ira->params.prgStart set ira->reloc.relocAdr[] <- ira->hunksOffs[i] + offset ReadConfig() Parse OFFSET directive into ira->params.prgStart Last edited by hop; 16 May 2024 at 14:29. |
16 May 2024, 18:04 | #123 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,539
|
Yes, but only because BINARY files have no relocations attached.
Quote:
I guess the easiest solution is to forbid the OFFSET directive in config files, as long as the input file type is not a raw binary. And don't let -preproc write OFFSET to config files, when the type is not binary. I fixed that now (still allowing OFFSET=0 for backwards compatibility). For hunk-format executables you have to use the command line option. I wasn't even aware that it can be used for relocatable executable files. |
|
16 May 2024, 18:21 | #124 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Thanks
Of course Quote:
|
|
17 May 2024, 00:46 | #125 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,539
|
Nothing is impossible. I'm on holiday for four days now and will think about whether it is worth the effort. The feature to use OFFSET for relocatable executables seems rarely used. What is your use-case here?
|
17 May 2024, 08:26 | #126 | ||
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Quote:
Quote:
The tool is also handy for identifying "hidden" CODE areas such as exception handlers. Last edited by hop; 17 May 2024 at 08:46. Reason: Clarity |
||
20 May 2024, 22:39 | #127 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 604
|
Quote:
|
|
20 May 2024, 23:30 | #128 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Quote:
A video is a great idea. I was just about ready to release this tool, but I really thought it needed some more automation to be really useful. Feature creep. |
|
21 May 2024, 21:23 | #129 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,204
|
Looks very neat, and looking forward to trying it out! I've also played around with making a more advanced disassambler myself, and the lack of "recursive" code discovery in IRA once you go for config settings is by far my biggest issue.
|
21 May 2024, 23:05 | #130 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Quote:
I wasn't planning on writing a 68000 emulator, but the code traversal benefits from it. I should probably swap it out for a tried and tested feature compete 680x0 one, but it's been fun. The traversal algorithm needs a bit more work. At present it can both break out of loops early that need to complete (like memcpys), and get stuck in loops it needs to escape from (like waitrasters). Swapping the simple counters for some simple CPU/memory state tracking should hopefully fix this. |
|
21 May 2024, 23:16 | #131 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,369
|
I always wanted to do this too (symbolic execution) since 2003 but never went through. If you have your own emulation layer, you could get rid of IRA altogether, as executing in "text" mode has its limitations. There's a very good lib called "capstone" that even has a python interface and which can disassemble a lot of processors. I've used it in a project for work on 68040 and it works.
To be honest, finding LVOs is often much easier, with some manual rework. I've written a tool (cheapres.py) which allows to find most of them by performing some lousy & cheap "symbolic" execution (run until RTS or JMP or BRA and keep track of the current A6 value), then you rework the IRA source and run again to find the remaining ones. |
22 May 2024, 17:14 | #132 | ||
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Hi. I would not have liked to try this in 2003, when immediate mode GUIs were not available.
Quote:
Thanks very much. Noted! Quote:
|
||
22 May 2024, 17:55 | #133 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,539
|
Ok. Had not much time during my holidays, but implemented that now. The config file is read twice. Once before reading the source file (for OFFSET) and once after that, for the remaining options.
Beta-archive is here: http://sun.hasenbraten.de/~frank/TEST/ira_211beta.lha |
22 May 2024, 18:55 | #134 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Quote:
|
|
26 May 2024, 21:43 | #135 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Quote:
|
|
28 May 2024, 16:07 | #136 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Quote:
|
|
29 May 2024, 12:48 | #137 |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
Hi. I think I may have found a little ira bug relating to hex values.
When SECSTRT_operand labels are generated for values >= $10, the $ is incorrectly added as part of the label. This can be reproduced by preprocessing WB1.3 Clock: Code:
ira.exe -keepbin -a -label=1 -radix=0 -OLDSTYLE -compat=bi -M68000 -preproc Workbench1.3/Utilities/Clock Code:
JSR SECSTRT_$11 ;02c2: 4eb9000032ac DC.L SECSTRT_$A ;0c7e: 0000236c MOVEA.L #SECSTRT_$D,A0 ;2bfa: 207c00002d30 itoasc_nohexprefixto supp.h|.cpp and calling in place of itoascin the line following the three occurences of adrcat("SECSTRT_"); There may be a more elegant solution. EDIT2: That didn't work because I didn't account for WriteSectionin ira.c. I think a better solution might be to always write these suffixes in decimal. I've implemented itoasc_decimallocally, but I think this could be simplified. Last edited by hop; 29 May 2024 at 13:31. |
29 May 2024, 23:16 | #138 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,539
|
Quote:
-labeland -radixoptions were given. Quote:
|
||
30 May 2024, 22:20 | #139 |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 235
|
|
02 June 2024, 14:00 | #140 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,539
|
Atari!
During a long weekend (starting on Thursday) I found the motivation to implement loading of Atari TOS executables in IRA.
Code:
P Code:
P Code:
P Code:
P Code:
vlink -bamigahunk -o test test.tos |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ira for Windows | jotd | Coders. General | 63 | 12 December 2023 10:53 |
New tutorial on sprites | Yragael | Coders. Tutorials | 8 | 04 September 2023 21:00 |
Debugging messages in serial (small tutorial, mainly for cross-dev) | alkis | Coders. Asm / Hardware | 7 | 22 February 2016 14:16 |
68020 to 68000 code convertion using Ira and PhxAss | gulliver | Coders. Asm / Hardware | 18 | 12 April 2014 01:09 |
Looking for IRA v1.07 or newer :-) | voxel | request.Apps | 7 | 30 July 2008 01:39 |
|
|