English Amiga Board


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

 
 
Thread Tools
Old 26 January 2020, 16:03   #1
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,461
vasm bug with ORG directives

I think i found something on version 1.8f



test.asm:


Code:

LEVEL1

        ORG    $400
        dc.b    "ABCD"

        org $500
        dc.b    "EFGH"

assemble with


vasmm68k_mot -devpac -nosym -Fbin -o out test.asm


Open "out" with a text editor: the second "org" isn't at offset $100 of the file but at offset $500 !!!


now if you define LEVEL1 like:


LEVEL1 EQU 0


it works properly !
jotd is offline  
Old 26 January 2020, 19:06   #2
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,731
Quote:
Originally Posted by jotd View Post
now if you define LEVEL1 like:


LEVEL1 EQU 0


it works properly !
Sure. Because in that case the situation is completely different. With the EQU your program starts with an ORG, so everything is as you expect. But with a label called LEVEL1 the assembler automatically starts a relocatable code section (default attributes: section CODE,code).

An ORG directive within a SECTION is handled as a "relocated Org". Which means all code following that ORG is assembled absolutely for the given address, but placed within that section. Usually you will switch back with a SECTION directive. The behaviour for a second ORG following it is undefined. Seems that it works like a real ORG instead, which regards a relocatable code section as being located at $0. Not sure if this is a bug. But I guess you really wanted to start the program with an ORG and not with a label/section.
phx is offline  
Old 26 January 2020, 19:09   #3
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,461
I see your point! thanks. No big deal anyway. Bad habit to define constants without values then as the asm assumes they're labels.
jotd 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
assemblers LOAD & ORG directives jotd Coders. Asm / Hardware 4 26 January 2020 16:00
CMake and vasm sparhawk Coders. General 9 30 November 2019 21:04
Issues with ORG directive (vasm + FS-UAE) Maggot Coders. Asm / Hardware 6 21 November 2018 19:48
Bug in x64 file requester and bug in Blizzard PPC ROM filesize headkase support.WinUAE 5 26 June 2016 14:17
vasm question marduk_kurios Coders. Asm / Hardware 7 14 February 2014 20:06

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:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07230 seconds with 15 queries