Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Interpret real operands that omit decimal as a real value #2
This is a documented "quirk":
I'm new to fv1 and this caused me some confusion in code I was assembling. Is this "quirk" supposed to be a feature or is this just a deficiency of
It's not clear to me why you'd want to be able to specify e.g.
Thanks for your work on this project!
added a commit
Jan 19, 2019
I originally intended this "quirk" to be a feature that resolves ambiguity of argument types in the Spin provided assembler. For example, you can access a delay line with an integer literal and it means an integer offset, but the same text would be interpreted as a fixed point real value for other operations. By requiring all fixed point real literals to include a decimal, there is no ambiguity. For example:
These two separate valid statements should probably be treated differently. I also liked the idea that you could specify an argument (eg s1.14) by the actual integer that will be used, not by the converted value - but in that case you can always provide an unambiguous hex or binary representation.
Unfortunately, my code breaks a lot of Spin examples where they mix integer literals and fixed point literals throughout the code, and maybe consistency in the scanner/parser is not that valuable to users.
I'll have a look at the commit.
Thanks for the comment!
Thanks a lot for the response; I think I understand what you mean. I'm not sure if the commit attached makes a lot of sense to be honest. It was mostly a quick experiment to see if it would work to get a successful roundtrip from ROM through a decompiler I'm using and back again, for a particular program I'm trying to tweak.