English Amiga Board


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

 
 
Thread Tools
Old Yesterday, 19:35   #1
dansalvato
Registered User
 
Join Date: Jun 2009
Location: United States
Posts: 59
vasm - Warn when addressing absolute 16-bit memory?

Hello, I'm wondering if it's possible for vasm (or something else in the build stack) to provide a warning if an instruction is addressing an absolute 16-bit memory address. This only ever happens in my code if I typo, so it would help a lot to preemptively find these bugs if the assembler could warn me about it.

For example, sometimes I accidentally type something like this:

Code:
move.w $10(a4),d0
As this:

Code:
move.w $10,d0
Any suggestions on how to catch this during build?
dansalvato is offline  
Old Yesterday, 20:37   #2
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,289
Maybe I'm wrong, but I doubt any amiga assembler would warn about that. The major issue being the obviously correct
move.l 4.w,..
and less (depending on context) reading/setting of interrupt routines.

Is this really an issue you've encountered with literal offsets or only with "named" offsets? Asking because I've not really had an issue with the former, while the later might be worth looking at adding more "guard rails" for if possible in a compatible way (IMO).
paraj is offline  
Old Yesterday, 21:44   #3
dansalvato
Registered User
 
Join Date: Jun 2009
Location: United States
Posts: 59
Quote:
Originally Posted by paraj View Post
Maybe I'm wrong, but I doubt any amiga assembler would warn about that. The major issue being the obviously correct
move.l 4.w,..
and less (depending on context) reading/setting of interrupt routines.

Is this really an issue you've encountered with literal offsets or only with "named" offsets? Asking because I've not really had an issue with the former, while the later might be worth looking at adding more "guard rails" for if possible in a compatible way (IMO).
This is a good point. I only encounter it with named offsets, and only during part of the build process where I use the -pic (position-independent code) assembler option. I have module files that I build with -pic that are only supposed to address memory using a base register.

I could do this the quick and dirty way by writing a script that parses my code and looks for these errors, but I was just hoping a more formal mechanism existed.
dansalvato is offline  
Old Today, 00:34   #4
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 867
Quote:
Originally Posted by paraj View Post
Maybe I'm wrong, but I doubt any amiga assembler would warn about that.
Something in the back of my head says BAsm will get cranky about it unless opted out?
NorthWay 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
16-Bit/32-Bit UK Computer Price Comparisons Amigajay Retrogaming General Discussion 10 02 July 2020 17:12
Absolute addressing Old_Bob Coders. Asm / Hardware 9 20 September 2018 10:36
Best Way to Convert 32-bit Signed Value to 16 Bit? AGS Coders. Asm / Hardware 31 29 December 2013 13:58
Memory addressing CmdrVimes Coders. General 7 25 October 2010 22:20
Memory Addressing Architecture Zetr0 support.Hardware 2 10 July 2007 16:55

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

Top

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