07 August 2022, 12:29 | #1 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
vasm relocation error
I am getting a few
Code:
error 39: illegal relocation The errors are with the following lines (note, these lines are taken from the whole routine, and are not listed like this in the code, I can post the full code if needed, but also see the attached screenshot) Code:
move.w #PIPEBLIT,d0 move.w #BLITDMOD,d0 move.w #sprheight<<6,d2; #sprheight*64 = 32*64 = 2048 move.w #sprwidth>>4,d3; Spritewidth / 8 = 32/8 = 4BITPLANE_SIZE_B add.l #SCREEN_WIDTH/8,a0; Next source Bitplane The errors are showing on the following constants: PIPEBLIT, BLITMOD, sprheight, sprwidth, SCREEN_WIDTH Here is the setup for the above constants Code:
sprheight equ 32 sprwidth equ 32 sprsize equ (sprheight*4)+8; Bytes to skip to next sprite (sprheight*bytesperline+controlwords) sprskip equ sprsize*4 SPRxSPD equ 1 SPRySPD equ 2 BLITDMOD equ (BITPLANE_WORDS*SCREEN_DEPTH)-(sprwidth/8) PIPEBLIT equ (PIPE_TILE_WIDTH-sprwidth)/8 |
07 August 2022, 13:24 | #2 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,170
|
happens when the name is not defined as equ.
|
07 August 2022, 13:28 | #3 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,987
|
Are you using any includes in place of using hardware registers directly?
BLITDMOD or BLTDMOD is usually to describe $dff066, is VASM being told elsewhere that BLTDMOD is actually $dff066 and so the move.w wont work because $dff066 is being declared as a longword? |
07 August 2022, 13:32 | #4 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Most likely one or more of your Equates are unknown. Maybe as a result of a typo or simply wrong case?
These relocation errors appear when you use an unknown symbol, which the assembler then assumes as being externally defined, in complex arithmetic operations. Because Relocs only allow a simple addend with a referenced symbol. EDIT: The equates you have shown seem correct. But also check if BITPLANE_WORDS, SCREEN_DEPTH and PIPE_TILE_WIDTH are defined. Otherwise you have equates based on unknown symbols, and the arithmetic operations with them will lead to the relocation errors. Last edited by phx; 07 August 2022 at 13:35. Reason: Addition |
07 August 2022, 13:59 | #5 | ||
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Quote:
From what I can see everything is defined. Most of it is done in an external file that is included early in my code. sprheight is defined in my constants.asm file and then only used above. I have't used it anywhere else. I have added my code for the whole project (it is messy as I am learning). Quote:
I don't think so, as mentioned above, i get the error just with the sprheight declaration and that is declared and used once. Everything is defined that I can see, but maybe I cannot see the wood for the trees! |
||
07 August 2022, 16:15 | #6 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 178
|
So with vasm 1.9 the whole thing can be compiled and started. But the includes are needed, otherwise the code will not run.
|
07 August 2022, 16:23 | #7 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
|
07 August 2022, 16:33 | #8 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 178
|
Yes I know it. You have post it on other side
|
07 August 2022, 16:34 | #9 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
|
07 August 2022, 16:53 | #10 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 178
|
Sorry, then I expressed myself stupidly. Your sources can be compiled without problems. I have simply copied the missing includes from the "other" project.
So I can't reproduce the error. |
07 August 2022, 17:38 | #11 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
In the end I could assemble it, and the only error I saw was this: Code:
vasm 1.9a (c) in 2002-2022 Volker Barthelmann vasm M68k/CPU32/ColdFire cpu backend 2.5c (c) 2002-2022 Frank Wille vasm motorola syntax module 3.16 (c) 2002-2022 Frank Wille vasm test output module 1.0 (c) 2002 Volker Barthelmann error 39 in line 43 of "src/Copper.asm": illegal relocation included from line 32 of "Overflow.s" > move.l #(BPL0PTH<<16),d0 ; Bitplane high pointer to $00E00000 Do you have something which reproduces the other errors? EDIT: When trying to link an executable I also notice that Sprite1a and Sprite2a are undefined. Last edited by phx; 07 August 2022 at 17:43. Reason: More unknowns |
|
07 August 2022, 18:01 | #12 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 178
|
The symbole "BPL0PTH" is added at line 20 (include "i/custom.i") in the Overflow.s file.
|
07 August 2022, 18:08 | #13 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
But there was no "i/custom.i" in the archive.
@bippy: Can you exclude a problem with VisualCode? Did you also try to assemble your project manually from the shell? |
07 August 2022, 21:45 | #14 | |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Okay, so maybe I dived in abit too deep
well this is the header of my custom.i Code:
* * Custom chips hardware registers * * Written by Frank Wille in 2013, 2016. * Anyway I seem to be using a mixture of includes, I think I should probably replace them with a consistent set. I have some files from release 40.13 and some from an unknown release with intuition.i from release 1.3.. So I will sort this tonight I think. Any advice on which version of includes would be best? NDK3.9 maybe?? I will also go back to my source and try and clean it up. I might even restart it so that it is better structured. The issue with the sprites is the code started off just creating a screen, and then I took the agony sprite (which is an attached sprite 32px wide (so 4 sprites as it is 16 colour)) and I moved it around the screen. I then literally replaced the sprite and changed my code to get a gamescreen running. The sprite data is actually in another directory (bin/). I probably should have included everything in my archive. Thanks for the help. I will go and look at what you and others have pointed out and see what I can figure out further edit: attached the custom.i I am using and bpl0pth is defined Quote:
|
|
07 August 2022, 22:26 | #15 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
So... I decided to move all the constants out of the constants.asm file and included them at the bottom of the overflow.s file after all includes. The errors have now cleared
|
08 August 2022, 00:33 | #16 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,987
|
It might be that the file you've now moved your constants into, is now loaded/referenced earlier than the other file, which means the assembler now knows all your equates before the source uses them.
|
08 August 2022, 08:45 | #17 | |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Quote:
Well i have a file that loads in all the includes and source files and jumps to my progstart: lable. The first include after they system includes was my constants include which had well.. You know Anyway all I have done is removed that include and instead copied the contents of it into the file. That does the including, only it's at the end... So no idea! |
|
08 August 2022, 17:26 | #18 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Your custom.i has my header, but I am quite sure that somebody modified it and changed BPL1..6PT to BPL0..5PT. It wasn't me. The custom.i in all my games uses the official 1..6 numbering.
Such things happen, when you release your source into the public domain... Glad that you found the issue, BTW. |
08 August 2022, 18:37 | #19 | |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Quote:
Thanks, I have no idea where I got your modified includes from. I'll source some proper updated ones |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Infuriating vasm error | DanielAllsopp | Coders. Asm / Hardware | 9 | 09 November 2021 13:41 |
VASM/VLINK relocation issues | pipper | Coders. Asm / Hardware | 31 | 22 May 2021 12:03 |
compil error VASM | LeCaravage | Coders. Asm / Hardware | 8 | 26 January 2021 15:05 |
error compiling vasm on windows | Ami030 | Coders. Asm / Hardware | 3 | 28 December 2019 16:07 |
VASM fatal error.. | jimmy2x2x | Coders. Asm / Hardware | 2 | 21 November 2014 10:27 |
|
|