English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 28 March 2020, 21:26   #21
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
Thanks I’ll test it. Does is also work if the base library pointer is known in the source file prior to the OS call?
kamelito is offline  
Old 28 March 2020, 22:42   #22
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
?? I don't understand, sorry
jotd is offline  
Old 28 March 2020, 22:58   #23
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
If I have move.l execbase, a6 then later jsr -30(a6) same with other base lib etc will it work,

For cheapres.py is the usage is python cheapres.py sourcefile? Any dependencies?

Last edited by kamelito; 28 March 2020 at 23:09.
kamelito is offline  
Old 28 March 2020, 23:33   #24
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
it will if the base lib is set before -30(a6) is called. I thought I protected the scan when RTS is encountered but it doesn't seem to be the case (working on the script right now so it might be done tonight)

usage is: cheapres.py -i input_file.asm -o output_file.asm.

Omitting the output overwrites the input (which can be regenerated at will probably)

Dependencies are kept to their minimum (no other python modules than already existing builtins, maybe it would even run on amiga in python 2.4 with minimum adaptations). Maybe time not to divert this thread any further. You can PM me if you have issues, or open a separate thread.

Last edited by jotd; 29 March 2020 at 12:50.
jotd is offline  
Old 29 March 2020, 11:14   #25
zenox98
Joy Division
 
zenox98's Avatar
 
Join Date: Nov 2006
Location: East Yorkshire
Age: 60
Posts: 239
Many thanks, Jotd - very useful.

BTW I think this is relevant to this thread as it is enhancing IRA output.

#my2cents
zenox98 is offline  
Old 29 March 2020, 12:18   #26
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
thanks if someone has issues with the scripts please yell. I have updated them several times since yesterday on my github page. Now cheapres.py is able to insert named offsets from $DFF000 base too as someone suggested.
jotd is offline  
Old 29 March 2020, 12:44   #27
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by kamelito View Post
One feature could be to be able to set the value of the indentation when using the -a so all offsets could be aligned and so have a more readable output.
Hm... but all offset-comments are aligned at position 40! Maybe you have an editor or viewer which is not set to the standard tab-width of 8?

Quote:
Is there a way to change data size of dc.x ? .b .w .l
Not yet. But I already have that on my ToDo-list for future additions. I mentioned the new directives DATAB, DATAW and DATAL for this purpose. Also on this list: a directive to insert user comments, an option to output mnemonics in lower-case.

Quote:
Is it also possible to change to binary, hex and decimal the values?
No. A global option would be easy, but I guess you would like to see it as a directive for certain regions?

Quote:
Say A5 point to $DFF000, then something like move.w D6,98(A5) is there a way for IRA to put the Amiga chipset EQU instead?
Like library LVOs, this should be done by a post-processor. Jotd has currently the best options for it!

Quote:
VASM seems to do not like label with a ., like jmp .label
Labels starting with a dot are local labels in many 68k assemblers. So this would be a bad choice.

Quote:
Originally Posted by redblade View Post
Were you the person who did Syndicate? I remember ending up on a Syndicate source code on some site.
What do you mean with "did"? But anyway, the answer is no!
phx is offline  
Old 29 March 2020, 23:08   #28
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
@PHX
>Maybe you have an editor or viewer which is not set to the standard tab-width of 8?
Right thanks notepad++ default is 4 with 8 it is perfect!

>Not yet. But I already have that on my ToDo-list for future additions. I mentioned the new directives DATAB, DATAW and DATAL for this purpose. Also on this list: a directive to insert user comments, an option to output mnemonics in lower-case.
>No. A global option would be easy, but I guess you would like to see it as a directive for certain regions?

I think your directives DATAB DATAW DATAL are the way to go but you could add a char like DATAW_B for word as binary or DATAB_D for decimal, DATAW_H for hex something like that. (Not sure if ascii is needed)


>Like library LVOs, this should be done by a post-processor. Jotd has currently >the best options for it!
I’ve seen he made updates, I’ll test tomorrow.

>Labels starting with a dot are local labels in many 68k assemblers. So this >would be a bad choice.
Not my choice it is IRA who did this I guess it choosed this because of symbols present in the exe.

@jotd
> dated them several times since yesterday on my github page. Now cheapres.py is able to insert named offsets from $DFF000 base too as someone suggested.

Thanks! Does your repo contains minimal info about how to use your tools?

Last edited by kamelito; 29 March 2020 at 23:13.
kamelito is offline  
Old 30 March 2020, 02:37   #29
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Quote:
Originally Posted by phx View Post
What do you mean with "did"? But anyway, the answer is no!
Someone did an amiga disassembly of Syndicate and they used IRA to do it. Must of been someone from the WHDLoad team.
redblade is offline  
Old 02 April 2020, 17:47   #30
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
tried this basereg stuff, can't seem to make it work

defender of the crown:

Code:
	MOVEA.L	(A7)+,A1		;0FE4A: 225F
	SUBA	#$000A,A1		;0FE4C: 92FC000A
	MOVE.L	(A1),D1			;0FE50: 2211
	ADD.L	D1,D1			;0FE52: D281
	ADD.L	D1,D1			;0FE54: D281
	MOVEA.L	D1,A4			;0FE56: 2841
	ADDA.L	#$00008002,A4		;0FE58: D9FC00008002

...

	SECTION S_1,DATA,CHIP

	DC.W	$4EF9			;11618
...
LAB_0C50:
	DS.L	132			;13B30
	END
A4 (before add) matches first section. Adding $8002 is as Frank said to benefit from full 64k range. But I can't seem to put the proper values

Code:
BASEADR  $11618
BASEOFF $8002
this fails (mapping like section 1 minus 55000 values or something). Note that section isn't that big. All offsets are negative. I've tried just BASEADDR $1961A but in that case I get "out of range". I think this is the proper value, but IRA doesn't allow it.
jotd is offline  
Old 02 April 2020, 18:34   #31
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
@jotd
I guess it’s 32766, have you seen my PMs?
kamelito is offline  
Old 02 April 2020, 21:37   #32
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by jotd View Post
Code:
    MOVE.L    (A1),D1            ;0FE50: 2211
    ADD.L    D1,D1            ;0FE52: D281
    ADD.L    D1,D1            ;0FE54: D281
    MOVEA.L    D1,A4            ;0FE56: 2841
    ADDA.L    #$00008002,A4        ;0FE58: D9FC00008002
This looks like reading the BPTR which links the next section. I guess that the $8002 skips the first four bytes which would be the BPTR to the next section. So the real offset is $7ffe, as Kamelito mentioned.

Also a base offset >$8000 makes no sense.
phx is offline  
Old 04 April 2020, 16:42   #33
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
BTW I found a very annoying bug in last version of IRA (2.09). I tried to disassemble a binary file (start $80000) like this:

Code:
>ira -a -offset=$80000 -binary heimsp.bin

IRA V2.09 (Apr  1 2020)
(c)1993-1995 Tim Ruehsen (SiliconSurfer/PHANTASM)
(c)2009-2015 Frank Wille
(c)2014-2017 Nicolas Bastien

Atari's executable files not yet supported.
WTF Atari???
And second IRA HAS DELETED THE FILE! I tried several times, same thing. Version 2.00 works well on that file. I have zoned it if you want to check.
jotd is offline  
Old 05 April 2020, 17:10   #34
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
@jotd how cheapres recognize the different libraries bases? Do you look for specific text like ExecBase, IntuitionBase is their a list? Or is it done differently?
kamelito is offline  
Old 05 April 2020, 17:31   #35
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
yeah, good question. ExecBase, IntuitionBase, GraphicsBase... basically name of the lib with first letter uppercased. Ex: lowlevel.library => LowlevelBase.

You can manually set them if the program uses a proxy routine to open the libraries (often happens in C programs)
jotd is offline  
Old 05 April 2020, 19:24   #36
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
@jotd
Thanks is PotgoBase handled?
kamelito is offline  
Old 05 April 2020, 19:37   #37
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
devices aren't supported ATM.
jotd is offline  
Old 07 April 2020, 01:23   #38
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by jotd View Post
Code:
>ira -a -offset=$80000 -binary heimsp.bin
...
Atari's executable files not yet supported.
That's a bug. There should be no automatic file format detection when you clearly specified it as raw binary. Fixed.

Quote:
WTF Atari???
Yes. Seems that Nicolas prepared IRA for some more formats like Atari, Megadrive and ELF executables. Your binary definitely has an Atari header.

Quote:
And second IRA HAS DELETED THE FILE!
Might be a second bug, but as Atari is not yet implemented I would ignore it for now.
phx is offline  
Old 07 April 2020, 10:54   #39
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
another strange thing when processing Oscar (ECS) executable.

shitload of messages like this:

Watch out: prgcounter(0000d0a0) > nextreloc(000088bc)
then
P1 Missed bad reloc addr $000088bc!

Output is okay, though.
jotd is offline  
Old 07 April 2020, 20:40   #40
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by jotd View Post
P1 Missed bad reloc addr $000088bc!

Output is okay, though.
I cannot remember the details, but probably there was a relocation in the executable's reloc-hunk which the reassembler now skipped in the output, because the code was not detected correctly?

Check offset $88bc. Does it look correct? Is there a label in this location?
phx is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:29.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.76814 seconds with 14 queries