Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
A:
NOP
JMP A
This will do nothing, a lot. If you defined the label "A" in one node, you can't reference it from another. This means you can reuse labels between nodes without conflict. Check out the second example program in section 3 of the manual for a more complex example using labels.
also needed to see if number is equal, smaller or larger than 0
Moves values more than or equal to 0 down, else just get new value from up to acc
S: mov up acc
JEZ A
JGZ A
jmp s
a:
Mov acc down
The first part of the code is marked as START. It stores a value from the UP port into ACC. The next three lines are jumps to different labels, based on what was just read. It is looking to see if the value read was either greater or less than 0.
The first test goes to POSITIVE. If the value is greater than 0, the current line will change to the code written POSITIVE: and move a value right. If, instead the value were not greater than 0, it would skip the JZL POSITIVE line altogether.
It would then go to the JLZ NEGATIVE line. This will test for ACC being less than 0. Again, this will either jump to the NEGATIVE label, or just skip the jump command altogether and proceed.
In the case that ACC is not less than zero (and, since the only way would could have gotten to the JZL line in the first place was by passing the JGZ line, we know that ACC is 0) the current line will proceed to the JMP START line.
This line is really important, since it stops the code from just running the POSITIVE section on its own. That makes the current line reset back up to the top. This is why the top description says "Zero values are discarded".
I hope that helps.