RPGHacker / asar

(Now) official repository of the SNES assembler Asar, originally created by Alcaro
Other
204 stars 44 forks source link

Find and add undocumented features to the manual #17

Closed RPGHacker closed 10 months ago

RPGHacker commented 6 years ago

There still seem to exist a couple of undocumented features within Asar. Find them and add them to the manual.

randomdude999 commented 6 years ago

Line 880 of assembleblock.cpp: //this part is not mentioned in the manual Also from the 0x.asm test it looks like 0x80 is a possible alternative to $80, but I can't figure out why it works.

RPGHacker commented 6 years ago

Yeah, I came across the first one before. I'm not sure if I added it to the manual, and since probably not many people know about it and/or use it, I think I'd leave it out of the manual intentionally, since it's some really ugly ambiguity with defines (this would come in handy should someone ever decide to rewrite Asar from scratch).

Didn't know about 0x literals, though (or maybe I forgot about it). That should definitely go into the manual (I think there's a section for number literals). Some other undocumented features currently on my list (which I found either from reading old changelogs or from looking at code, not all of them may actually be valid in the current version anymore):

As I said, not all of those may even be valid anymore. For example: I searched the entire solution for "assembler", but found nothing indicating that a define like that actually exists (however, it would certainly be useful to have, even with xkas support being dropped eventually, since in theory someone could make a new assembler in the future which was only partially compatible with Asar, but also had this define, just with a different value).

That's about all I've found so far.

RPGHacker commented 6 years ago

Added deprecation warnings for "freespace fixed" and "autoclear" - they're useless aliases I don't want to support forever. Might also add a deprecation warning to !condition later on, again something I don't want to keep supporting. Tested assembling a patch with !assembler in it. It doesn't seem to exist in the current version and was probably remove (thinking about whether we should add back certain intrinsic defines to the compiler - doesn't seem like a horrible idea, even C++ compilers have that, and can make it possible to support multiple different compilers should we ever rewrite this thing or write a new compiler). Will add everything else to the documentation later.

RPGHacker commented 6 years ago

Alright, this can be closed with the latest commit.

A few notes:

Aside from that, I've now covered every undocumented feature I was aware of. If anyone finds further ones, feel free to reopen this issue.

With that we've closed all issues that are currently assigned to the 1.60 milestone, so maybe we should start discussing a 1.60 beta release now (either in a new issue or on SMW Central).

randomdude999 commented 6 years ago

a very late reply but if !condition was actually used by the SA1 pack, as if !!LZ3 (check the end of boost/lzx.asm). I fixed that and I think i'll submit an update to that, but it shows that it was possible to use this feature. I think it should be re-added with a deprecation warning.

RPGHacker commented 6 years ago

Interesting to know. Reopening this for now. I guess the only scenario in which it was actually usable then was in combination with a define. I think in any other case, it would actually complain about a missing define, at least from what I've tried.

randomdude999 commented 6 years ago

Just tried some stuff and apparently if !(condition) works too without complaining about defines. So you don't have to use a define, but i agree that the use cases of this are very limited.

RPGHacker commented 6 years ago

That's weird. I remember specifically trying if !(condition) and it not working... :/

randomdude999 commented 6 years ago

I made a new issue for that (#113).

RPGHacker commented 3 years ago

Found more undocumented stuff: fill/skip align and fill/skip offset. I don't quite remember what these do, but reopening the issue so that we don't forget to document them at some point.

randomdude999 commented 10 months ago

fill/skip align were documented at some point, so this is done again (for now...)