English Amiga Board


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

 
 
Thread Tools
Old 28 December 2023, 23:00   #101
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by hop View Post
There seems to be a problem with the latest changes.
Indeed. I should always test all cases after a modifications.
I have updated the archive.
phx is offline  
Old 30 December 2023, 22:14   #102
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
I have updated the archive.
All working as expected now thanks.
hop is offline  
Old 15 January 2024, 20:17   #103
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
The current V2.11 beta source is here:
http://sun.hasenbraten.de/~frank/TEST/ira_211_beta.lha

I added this new option:
Code:
        -LABEL=<style>    Label style 0=LAB_index, 1=LAB_addr.
The default is still the old label-style 0.
Do you think it would make sense to apply this option to EXT symbols too?

Before:
Code:
EXT_0007	EQU	$400
EXT_0008	EQU	$402
EXT_0009	EQU	$8002
EXT_000a	EQU	$56660
EXT_000d	EQU	$5666A
EXT_000e	EQU	$7FFFE
After:
Code:
EXT_400		EQU	$400
EXT_402		EQU	$402
EXT_8002	EQU	$8002
EXT_56660	EQU	$56660
EXT_5666A	EQU	$5666A
EXT_7FFFE	EQU	$7FFFE
hop is offline  
Old 17 January 2024, 16:08   #104
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by hop View Post
Do you think it would make sense to apply this option to EXT symbols too?
The EXT-symbols are equates and no labels, but why not? Ok, I updated the beta source archive.
phx is offline  
Old 18 January 2024, 10:03   #105
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
The EXT-symbols are equates and no labels, but why not? Ok, I updated the beta source archive.
Thanks very much for making this change. It is a definite improvement, and makes the disassembly easier to understand at a glance. It's especially useful for game bootblocks and loaders that use fixed addresses.

Do you think it is worth mentioning this feature in -LABEL=<style> string in the Usage in FormatError(), or would it just be clutter?

On a related note, is it possible to configure ira to use a single equate for all of the $400 values in the following code? It would be great if the equate could be renamed too.

Code:
EXT_400		EQU	$400
...
; ------------------------------------------------------------------------------
; Load Splash Screen Sequence to $400
; ------------------------------------------------------------------------------
	BSR.W	SeekTrackZero		;70106: 610009a4
	BSR.W	MotorOn			;7010a: 61000a02
	MOVEA.L	#$00000400,A0		;7010e: 207c00000400
	MOVEQ	#3,D0			;70114: 7003
	MOVE.W	#$0006,D1		;70116: 323c0006
LAB_7011A:
	BSR.W	ReadTrack		;7011a: 61000916
	ADDA.L	#$00001800,A0		;7011e: d1fc00001800
	ADDI.L	#$00000001,D0		;70124: 068000000001
	DBF	D1,LAB_7011A		;7012a: 51c9ffee
	BSR.W	MotorOff		;7012e: 61000a0a
	MOVEA.L	#$00000400,A0		;70132: 207c00000400
	MOVEA.L	#$00000400,A1		;70138: 227c00000400
	BSR.W	Unpack			;7013e: 61000722
; Execute loaded code at $400 [Splash screens sequence plays]
	JSR	EXT_400.W		;70142: 4eb80400
Ideally the output would look like:

Code:
SPLASH_ADDR		EQU	$400
...
; ------------------------------------------------------------------------------
; Load Splash Screen Sequence to $400
; ------------------------------------------------------------------------------
	BSR.W	SeekTrackZero		;70106: 610009a4
	BSR.W	MotorOn			;7010a: 61000a02
	MOVEA.L	#SPLASH_ADDR,A0		;7010e: 207c00000400
	MOVEQ	#3,D0			;70114: 7003
	MOVE.W	#$0006,D1		;70116: 323c0006
LAB_7011A:
	BSR.W	ReadTrack		;7011a: 61000916
	ADDA.L	#$00001800,A0		;7011e: d1fc00001800
	ADDI.L	#$00000001,D0		;70124: 068000000001
	DBF	D1,LAB_7011A		;7012a: 51c9ffee
	BSR.W	MotorOff		;7012e: 61000a0a
	MOVEA.L	#SPLASH_ADDR,A0		;70132: 207c00000400
	MOVEA.L	#SPLASH_ADDR,A1		;70138: 227c00000400
	BSR.W	Unpack			;7013e: 61000722
; Execute loaded code at $400 [Splash screens sequence plays]
	JSR	SPLASH_ADDR.W		;70142: 4eb80400
hop is offline  
Old 18 January 2024, 17:33   #106
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by hop View Post
Do you think it is worth mentioning this feature in -LABEL=<style> string in the Usage in FormatError(), or would it just be clutter?
It's a little bit tight, but I tried to put it there. Source is updated.

Quote:
On a related note, is it possible to configure ira to use a single equate for all of the $400 values in the following code? It would be great if the equate could be renamed too.
That's not so trivial and would require some more time to do - which I currently don't have, being focussed on other projects.
phx is offline  
Old 18 January 2024, 17:46   #107
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
That's not so trivial and would require some more time to do - which I currently don't have, being focussed on other projects.
No problem at all. I just wanted to make sure I wasn't missing something. Thanks very much for your support!
hop is offline  
Old 20 March 2024, 09:15   #108
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Hi. I'm a bit confused by the intent of the
ExtendFileName
function in init.c. It is used to generate the output filenames:
targetName
(.asm),
configName
(.cnf), as well as
binaryName
and
labelName
.

It looks like
ExtendFileName
is designed to append a file extension, and also strip the volume/drive label and directories from a path. For example: DH0:games/game -> game.asm, game.cnf etc

So it would seem that ira is designed to output the .asm/.cnf file in the current working directory by default, rather than next to the source file.

I've been using ira on Windows, which often uses backslashes for path separators.
ExtendFileName
does not account for this - it only searches for forward slashes. Fixing this has exposed the behaviour described above, which I don't think is very desirable. I think it would be better if
ExtendFileName
did not strip the preceding path from a filename, so for example: DH0:games/game -> DH0:games/game.asm, DH0:games/game.cnf etc and similarly for Windows C:\Games\Game -> C:\Games\Game.asm, C:\Games\Game.cnf

What are your thoughts on this? Please could you let me know if I have misunderstood anything here? Thanks

Last edited by hop; 20 March 2024 at 09:27. Reason: Correction
hop is offline  
Old 10 April 2024, 16:09   #109
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by hop View Post
I think it would be better if
ExtendFileName
did not strip the preceding path from a filename, so for example: DH0:games/game -> DH0:games/game.asm, DH0:games/game.cnf etc and similarly for Windows C:\Games\Game -> C:\Games\Game.asm, C:\Games\Game.cnf
Absolutely! I can only agree. Although I use IRA under AmigaOS/MorphOS and NetBSD I never noticed the problem, as I'm always working with files in my current directory only.

Fixed and updated the test-archive. Only the
ExtendFileName
function in
init.c
was modified.
phx is offline  
Old 11 April 2024, 16:33   #110
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
Absolutely! I can only agree. Although I use IRA under AmigaOS/MorphOS and NetBSD I never noticed the problem, as I'm always working with files in my current directory only.

Fixed and updated the test-archive. Only the
ExtendFileName
function in
init.c
was modified.
Thanks very much. Where can I find the test-archive? I am only aware of https://aminet.net/package/dev/asm/ira
hop is offline  
Old 12 April 2024, 13:37   #111
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
It's still the same URL we used previously in this thread:
http://sun.hasenbraten.de/~frank/TEST/ira_211beta.lha
phx is offline  
Old 12 April 2024, 17:56   #112
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
It's still the same URL we used previously in this thread:
http://sun.hasenbraten.de/~frank/TEST/ira_211beta.lha
Thanks. Sorry, I'd forgotten about that.

I've just been disassembling WB1.3 Calculator with ira as a test case, and I am not sure if I have encountered a bug or if this is user error. Can you please advise?

Code:
LAB_67A:
	JMP	LAB_67C+2(PC,D0.W)	;067a: 4efb0000
LAB_67E:
	UNLK	A5			;067e: 4e5d
	RTS				;0680: 4e75
The disassembly does not assemble because LAB_67C is not defined. However, 67C+2=LAB_67E, which is defined.
hop is offline  
Old 12 April 2024, 18:30   #113
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
I would guess this is a problem in your private ira compilation, as I saw exactly the same problem in your still secret project and sent you a screenshot. I don't see it with ira under NetBSD or AmigaOS.
phx is offline  
Old 12 April 2024, 20:05   #114
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
I would guess this is a problem in your private ira compilation, as I saw exactly the same problem in your still secret project and sent you a screenshot. I don't see it with ira under NetBSD or AmigaOS.
Ah. Sorry. I misunderstood. I'll investigate this. I have only made very minor changes to ira. I'll look into this (test vanilla ira and also on Linux) and let you know what I find. Many thanks.
hop is offline  
Old 13 April 2024, 20:02   #115
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
I would guess this is a problem in your private ira compilation, as I saw exactly the same problem in your still secret project and sent you a screenshot. I don't see it with ira under NetBSD or AmigaOS.
I don't seem to have any local changes to ira. I can repro the issue with your latest archive compiling with
nmake -f Makefile.win32
. It looks this problem may be related the
-LABEL=1
option.

For Calculator with
-LABEL=0
the resultant disassembly is valid - the JMP dest is relative to a defined label:

Code:
LAB_0052:
	JMP	LAB_0052+2(PC,D0.W)	;067a: 4efb0000
LAB_0053:
	UNLK	A5			;067e: 4e5d
For Calculator with
-LABEL=1
the resultant disassembly is invalid - the JMP dest is relative to an undefined label and the offset is effectively applied twice:

Code:
LAB_67A:
	JMP	LAB_67C+2(PC,D0.W)	;067a: 4efb0000
LAB_67E:
	UNLK	A5			;067e: 4e5d
I'll see if I can debug this. The command line is:

Code:
ira -a -label=1 -radix=0 -compat=bi -config Calculator
Thanks

Last edited by hop; 13 April 2024 at 20:12. Reason: clarity
hop is offline  
Old 13 April 2024, 21:10   #116
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by hop View Post
IIt looks this problem may be related the
-LABEL=1
option.
Confirmed. I missed that you use that option, while trying to reproduce it.
It happens when offsetting a label (like
LAB_xyz+2
).
phx is offline  
Old 13 April 2024, 21:14   #117
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
Confirmed. I missed that you use that option, while trying to reproduce it.
It happens when offsetting a label (like
LAB_xyz+2
).
Thanks. I think I've found the point in the code that appends the label and the +, but not sure quite why it's going wrong yet.
hop is offline  
Old 14 April 2024, 12:39   #118
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Fixed it. I have to use
LabelAdr2[r]
instead of
label.labelAdr[r]
in
CatLabelAdr()
. Update with the beta archive from the previous link.
phx is offline  
Old 14 April 2024, 13:02   #119
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Quote:
Originally Posted by phx View Post
Fixed it. I have to use
LabelAdr2[r]
instead of
label.labelAdr[r]
in
CatLabelAdr()
. Update with the beta archive from the previous link.
Haha! I have literally this minute just found this myself Many thanks for confirming!
hop is offline  
Old 15 April 2024, 11:06   #120
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Two hours later I fixed a similar bug with offsetting a symbol defined at section start (replacing
SECSTRT_n
). Make sure
ira_2.c
has date 13:58 CEST. I reuploaded the archive.
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 01:21.

Top

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