15 January 2015, 13:38 | #1 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 744
|
Devpac - CNOP in a BSS Section
Trying to assemble the PT315 source in Devpac but the BSS Sections have CNOP 0,4 for aligning the file info blocks. It fails saying..
BSS or OFFSET section cannot contain data I can't seem to find the correct directive to get it to assemble? Any ideas? |
15 January 2015, 15:20 | #2 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
|
Just use EVEN instead cant you?
|
15 January 2015, 16:13 | #3 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
15 January 2015, 16:44 | #4 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
A fairly new version of vasm can be found in vbcc 0.9d. http://sun.hasenbraten.de/vbcc/ Not only does vasm optimize better than devpac (vasm optimizes branches in both directions for example), but it should be faster. Leffmann timed vasm as being faster than devpac but still 20x slower than PhxAss. My recent tests on the 68060 showed 13x-18x slower than PhxAss so there may be some improvement due to vbcc compiler improvements (Leffmann's tests were done on a 68030 though). I tried a 68060 specific build of vasm with direct FPU use and didn't see any difference in speed. The IEEE fp library using version of vasm in the new vbcc is not so slow for a compiled assembler. |
|
15 January 2015, 19:54 | #5 |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
|
You can use something similar, it works for ASM-One:
Code:
Section Test, BSS StartBSS ds.b 1 ds.b 2 ds.b 3 FixBSS ds.b (FixBSS-StartBSS+3)/4 AlignedLabel ds.b 1000 |
15 January 2015, 20:28 | #6 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
This will work too:
Code:
PAD4 MACRO .\@size = *-\1 .\@size2 = ((.\@size+4)/4)*4 ds.b .\@size2-.\@size ENDM data ds.b 3 PAD4 data aligned_data |
15 January 2015, 21:51 | #7 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
I am surprised that there is no easy way to align data in a bss section with DevPac. I didn't realize that before.
StingRays solution works with most assemblers. Another solution would be to start a new section for data objects which need 32-bit or 64-bit alignment. LoadSeg() allocates a new memory block for every section, so 64-bit alignment is guaranteed. Code:
section fileinfoblock,bss myfib: |
15 January 2015, 22:13 | #8 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
|
|
15 January 2015, 22:23 | #9 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
|
16 January 2015, 01:01 | #10 | |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
|
Quote:
I've never had to use it, so i've never had to check it. You however could check your Facebook messages, that would be a good start |
|
16 January 2015, 01:44 | #11 |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
I tested vasm in normal and devpac mode and CNOP aligned how I would expect. That means that vasm in devpac mode is not compatible with Devpac but perhaps we could ignore? I didn't find anything in the Devpac 3.0 manual about how to change the CNOP padding data (nothing about what data padding is used either). It would be possible to have an optional 3rd argument with the padding data although I don't know if it would be worth the trouble. I wonder if any other assemblers accept a 3rd argument for CNOP? Vasm does seem to be an option for h0ffman because of the lack of Devpac compatibility at least .
|
16 January 2015, 07:13 | #12 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
16 January 2015, 10:49 | #13 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
While developing vasm I always saw Devpac as the reference assembler. But now I'm a bit disappointed. Quote:
Besides CNOP it also makes sense to pad code hunks with NOP, when their length is not a multiple of four. Unfortunately Amiga assemblers show a very different behaviour: Code:
Assembler | CNOP NOP padding | code hunk NOP padding ------------------------------------------------------ A68k | yes | yes AsmOne | no | no Barfly | no | yes Devpac | no | no PhxAss | yes | yes vasm | yes (since 1.7c) | yes (since 1.7c) |
||
16 January 2015, 12:01 | #14 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
|
Probably wasnt an official Hisoft document then.
CAN YOU RESPOND TO YOUR MESSAGES ON FACEBOOK THAT YOUVR READ AND NOT RESPONDED TO.....CAN YOU DO THAT MATE? THIS YEAR IS PREFERABLE, THIS WEEK WOULD BE BETTER......T O D A Y WOULD BE POLITE. CAN YOU DO THAT MATE?????????????????????????????????????????????????? |
16 January 2015, 12:06 | #15 |
Moderator
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
|
It's been a very long time since I did this, but... the original system uses BCPL pointers and convert between them by shifting left and right by 2 when accessing sections.
Therefore, each section is guaranteed to start at an address that is an integral multiple of 4. |
16 January 2015, 12:11 | #16 |
Moderator
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
|
Also I am positive we used alignment in our games, which were all compiled using DevPac, but would have to dig up the sources to find out what the syntax exactly was. I might try if anything else fails...
|
16 January 2015, 13:36 | #17 |
Moderator
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
|
As far as I can see from some random source is that I used a section where 4 byte alignment was needed, the first data there is certainly starting at a 4 byte alignment. Then ds.b could be added with modulo 4 of the difference between known reference points to make sure that the next label starts at an integral multiple of 4.
Since the expression evaluator is particularly dumb by today's standards, you have to write something like this: section bss You can probably make this a macro with a local label in place of "pad" to make the code actually readable |
16 January 2015, 13:42 | #18 |
Moderator
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
|
And CNOP works just as well in 3.18
section bss data at the label "align" is 4 byte aligned. |
16 January 2015, 17:41 | #19 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
would a section not always start on an 8-byte boundary? or do some linkers combine sections, so this could be voided?
|
17 January 2015, 14:24 | #20 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Correct. The first data in a section is always guaranteed to start on a 8-byte boundary. When a linker combines sections, the following data is still guaranteed to start on a 4-byte boundary, as a hunk size is always a multiple of 4. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
cnop | phx | Coders. Asm / Hardware | 13 | 19 February 2015 21:33 |
newest ami/x and cnet bss | GreenMeanie | request.Apps | 1 | 16 September 2011 20:12 |
Off-topic section | BippyM | project.EAB | 3 | 29 January 2007 17:08 |
Section 8 ??? | plasmatron | Nostalgia & memories | 4 | 04 June 2004 20:40 |
Federation of the Free Traders + BSS Jane Seymour | haynor666 | MarketPlace | 0 | 06 June 2003 15:19 |
|
|