Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label .0 does not work #16

Open
yoyoma2 opened this issue Nov 20, 2019 · 1 comment
Open

Label .0 does not work #16

yoyoma2 opened this issue Nov 20, 2019 · 1 comment

Comments

@yoyoma2
Copy link

yoyoma2 commented Nov 20, 2019

Tested in the web/javascript version.

Steps:
g P/R
f LBL .0

Result:
The label 0 is created instead of the label .0

If your program uses both labels 0 and .0 it will fail.

Possible Cause:
In function decode_lbl(k), the following line:
i = Number(k) / f;
results in i=0 when k=0 regardless of f being 1 or 10.

Same problem with GTO:
The function decode_gto() has the same problem calculating x with x=0 and f=10
x /= f;

Nice simulator BTW!

@yoyoma2
Copy link
Author

yoyoma2 commented Jul 20, 2024

Here's a patch that makes this work in the javacript version. In the case of label .0 we store 0.01 to distinguish it from label 0 which already stores 0. I'm sure someone who knows this code and javascript could fix it in a much more elegant way.

labelDotZero.patch

Anyways a program can now use both label 0 and label .0 and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant