![]() |
![]() |
#1 |
Registered User
Join Date: Jun 2009
Location: United States
Posts: 60
|
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 Code:
move.w $10,d0 |
![]() |
![]() |
#2 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,293
|
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). |
![]() |
![]() |
#3 | |
Registered User
Join Date: Jun 2009
Location: United States
Posts: 60
|
Quote:
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. |
|
![]() |
![]() |
#4 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 873
|
|
![]() |
![]() |
#5 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 830
|
Quote:
in source you can disable it in following way Code:
IFD BARFLY BOPT w4- ;disable 64k warnings ENDC ;END IFD BARFLY |
|
![]() |
![]() |
#6 |
Registered User
Join Date: Nov 2005
Location: United Kingdom
Age: 41
Posts: 126
|
Yes, Barfly definitely warns about vector accesses by default. I get caught out by this when recompiling disassembled game code.
![]() My similar typo mistake is usually forgetting to put # when using constants, e.g. move.b $10,d0 instead of: move.b #$10,d0 |
![]() |
![]() |
#7 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,571
|
Quote:
equor rs? With real labels and small-data your problem would disappear, because the PIC mode generates an error for everything which may need a relocation entry. Otherwise, I could add an option to print warnings for any 16- or 32-bit absolute addressing mode, if anybody thinks this is useful. Maybe something like -warnabs16and -warnabs32. |
|
![]() |
![]() |
#8 | ||
Registered User
Join Date: Jun 2009
Location: United States
Posts: 60
|
Quote:
Quote:
clr.w SomeOffsetinstead of clr.w SomeOffset(a4). I imagine this mistake is pretty common, and it's not just me. In any case, I'd be very grateful and benefit from the warning option you suggest, whether or not the option cares about equate vs. literal. |
||
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
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 |
|
|