GithubHelp home page GithubHelp logo

Comments (7)

vladikcomper avatar vladikcomper commented on July 24, 2024 2

I totally agree with @flamewing on the corrected moveq behaviour.

The way moveq worked in older AS revisions is completely broken and error-prone. It becomes apparent once you consider this simple example:

	moveq	#$A0-1, d0		; copy $A0 words ...

.copy:
	move.w	(a0)+, (a1)+
	dbf	d0, .copy

The older versions of AS won't raise any warnings during assembly, while moveq in this example will set register d0 to a different value than the instruction implies.
Instead of setting d0 to the value of $A0-1, the compiled instruction will effectively set it to $FFFFFFA0-1, because moveq #$A0-1 doesn't really exist due to the sign-extension.

This is completely incorrect and misleading behaviour, which leads to all sorts of hard-to-catch errors in your code.
The assembler must issue a warning when you're trying use moveq with values it cannot represent instead of silently accepting those and producing broken code. Those warnings should be enabled by default.

from s2disasm.

Awuwunya avatar Awuwunya commented on July 24, 2024 1

If you end up modifying AS more, please for the love of god go and fix the numerous parsing bugs and some of the strange bugs preventing some projects at all. Such as some that plagued paddin/align on S3K projects where it would break for no reason. Having qn actual usable version of AS would be amazing.

from s2disasm.

Brainulator9 avatar Brainulator9 commented on July 24, 2024

I would definitely enjoy a custom version of AS hand-tailored to our needs. I have no idea what features would be good to include, but having something that works better than vanilla AS as well as ASM68K is going to be very helpful.

from s2disasm.

flamewing avatar flamewing commented on July 24, 2024

Having examples of those issues would go a long way towards making it fixable.

from s2disasm.

flamewing avatar flamewing commented on July 24, 2024

So, I set up CI and daily snapshot autoreleases (for Windows, Linux, and OSX) and started doing some hacking. Please fill out bug reports for AS on that repository I forked, preferably with some example cases and I use for testing and I will try to fix them.

I will also be updating the disassemblies with these custom builds before closing this issue.

from s2disasm.

Clownacy avatar Clownacy commented on July 24, 2024

I don't think your repo has issues enabled. While I'm here, is there a chance you can edit AS to match its older behaviour to make this stuff unnecessary?

from s2disasm.

flamewing avatar flamewing commented on July 24, 2024

Hm, weird that issues was disabled. Anyway, enabled now.

Regarding the moveq/sign-extends... I am a bit torn. I like the warning AS generates because it allows catching some silly mistakes and forces you to be more explicit that yes, this is what you want. But on the other hand, it can be quite noisy, and the build setups used in the disassemblies treat warnings basically the same as errors, which is why that commit was needed in the first place.

Maybe an option to silence these kinds of sign-extension warnings would suffice?

from s2disasm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.