English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 19 June 2018, 15:26   #1
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Assembling Photon's tutorials using vasm

I'm trying to assemble tutorial22 by Photon. I'm doing this on win10, using the lastest vasm (1.8c). The code file in the attached archive is almost identical to the one written by Photon himself.

If I assemble this on the Amiga (well, AmigaForever) using AsmOne 1.48, everything works as expected. I get an executable file of 17600 bytes.

If I use vasm 1.8c to assemble this (make file included in attached archive), I get a file that is much bigger, ie 72223 bytes. One of the reasons for this seems to be that the BSS section is included in the executable. But even worse: my executable file is not executable! Even after I do a "protect mytut22.exe RWED", it still says my file is not executable.

So I have 2 questions:
1. how do I make the file executable?
2. how do I minimise the executable's size?

TIA!
Attached Files
File Type: zip mytut22.zip (16.7 KB, 95 views)
guy lateur is offline  
Old 19 June 2018, 15:28   #2
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
Quote:
Originally Posted by guy lateur View Post
I'm trying to assemble tutorial22 by Photon. I'm doing this on win10, using the lastest vasm (1.8c). The code file in the attached archive is almost identical to the one written by Photon himself.

If I assemble this on the Amiga (well, AmigaForever) using AsmOne 1.48, everything works as expected. I get an executable file of 17600 bytes.

If I use vasm 1.8c to assemble this (make file included in attached archive), I get a file that is much bigger, ie 72223 bytes. One of the reasons for this seems to be that the BSS section is included in the executable. But even worse: my executable file is not executable! Even after I do a "protect mytut22.exe RWED", it still says my file is not executable.

So I have 2 questions:
1. how do I make the file executable?
2. how do I minimise the executable's size?

TIA!
Seems to be vasm or your bug. Amiga exe file cant have 72223 bytes. Maybe with infohunk, but i dont remember exactly. Perhaps Vasm (as standard) used hunk word relocation, which is unsupported by older Amiga ROMs. Standard is hunk longword relocation. For me word hunk relocation is only problem for new coders/C programmers. You are not alone with "file is not executable" message. For me Amiga standard was always longword hunk relocation, word hunk relocation can be only option to choose, not default.

Last edited by Don_Adan; 19 June 2018 at 15:36.
Don_Adan is offline  
Old 19 June 2018, 16:05   #3
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by Don_Adan View Post
Seems to be vasm or your bug. Amiga exe file cant have 72223 bytes. Maybe with infohunk, but i dont remember exactly. Perhaps Vasm (as standard) used hunk word relocation, which is unsupported by older Amiga ROMs. Standard is hunk longword relocation. For me word hunk relocation is only problem for new coders/C programmers. You are not alone with "file is not executable" message. For me Amiga standard was always longword hunk relocation, word hunk relocation can be only option to choose, not default.
Thanks for your input. I'm very new to assembly programming and vasm, so I don't really know how to do 'hunk longword relocation'. In the vasm manual it mentions a .balign directive, but I don't know how to use it. Any tips on that?

FYI, here's the output from vasm:
Code:
F:\Amiga\dev\asmskool\mytut22>make -f mytut22.make
vasmm68k_mot.exe -o mytut22.exe mytut22.S
vasm 1.8c (c) in 2002-2018 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.3b (c) 2002-2017 Frank Wille
vasm motorola syntax module 3.11c (c) 2002-2018 Frank Wille
vasm test output module 1.0 (c) 2002 Volker Barthelmann

TutDemo(acrx2):          881 bytes
TutData(adrw1):        16504 bytes
TutBSS(aurw1):         33792 bytes
dir mytut22*
 Volume in drive F is DataSSD
 Volume Serial Number is C6A4-7A59

 Directory of F:\Amiga\dev\asmskool\mytut22

19/06/2018  15:16            72 223 mytut22.exe
19/06/2018  14:41               157 mytut22.make
19/06/2018  14:44             8 276 mytut22.S
               3 File(s)         80 656 bytes
               0 Dir(s)  827 977 826 304 bytes free
So the total exe size is bigger than the sum of the 3 parts. Also, making all 3 parts a multiple of 4 bytes (by inserting some ds.b's) does not guarantee the exe file size to be a multiple of 4 bytes.
guy lateur is offline  
Old 19 June 2018, 16:10   #4
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
The 72223 byte file in the archive is a listing, not an executable. Try looking at it with a text viewer.
meynaf is offline  
Old 19 June 2018, 16:11   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
It's not a listing, it's an object file. Specify
-Fhunkexe -kick1hunks
to produce a KS 1.2 compatible executable.
Leffmann is offline  
Old 19 June 2018, 16:16   #6
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
This file contains text. AmigaOS object files are not text.
meynaf is offline  
Old 19 June 2018, 16:20   #7
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by Leffmann View Post
It's not a listing, it's an object file. Specify
-Fhunkexe -kick1hunks
to produce a KS 1.2 compatible executable.
Yes! Thank you so much, Leffmann! This solved both problems (size + executability) in 1 go!

I still have a lot to learn, obviously, but I'm getting there, step by little step..
guy lateur is offline  
Old 19 June 2018, 16:39   #8
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Quote:
Originally Posted by guy lateur View Post
Yes! Thank you so much, Leffmann! This solved both problems (size + executability) in 1 go!

I still have a lot to learn, obviously, but I'm getting there, step by little step..
Cool

Quote:
Originally Posted by meynaf View Post
This file contains text. AmigaOS object files are not text.
Vasm supports many types of output formats, not just AmigaDOS object files. To produce a listing you use the -L option, and what you have there is the output from the default Test module, which seems to contain everything needed to produce an executable, but since it's text I guess it's not wrong to call it a listing.

Last edited by Leffmann; 19 June 2018 at 16:45.
Leffmann is offline  
Old 20 June 2018, 13:02   #9
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by guy lateur View Post
Code:
vasm 1.8c (c) in 2002-2018 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.3b (c) 2002-2017 Frank Wille
vasm motorola syntax module 3.11c (c) 2002-2018 Frank Wille
vasm test output module 1.0 (c) 2002 Volker Barthelmann
Just look at the last line. The default output format is "test", not AmigaOS hunk-format executable.
phx is offline  
Old 20 June 2018, 13:08   #10
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by phx View Post
Just look at the last line. The default output format is "test", not AmigaOS hunk-format executable.
Yep, that kinda makes sense now, but not until very recently..
guy lateur 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
VASM wrong assembling? deadwood Coders. Asm / Hardware 32 01 January 2015 23:25
Assembling Gravity Force 2 source code absence Coders. General 5 13 May 2012 11:44
Photon's A1700 Photon Hardware mods 43 25 December 2011 15:30
[REQ:ASM] Assembling and running jman Coders. Tutorials 9 07 May 2011 18:39
Devpac and assembling for absolute addresses h0ffman Coders. General 10 21 March 2011 19:12

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 10:12.

Top

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