ASM and the |< operator
Mightor
Posts: 338
Hey there,
I noticed that for single PIN DIRA output assignments, the |< operator is used a lot. This wouldn't really work if you have to assign multiple values to DIRA, would it?
This would assign both pins 0 and 1 as outputs, right? This may be a total noob Q, but I'm still busy learning.
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| To know recursion, you must first know recursion.
I noticed that for single PIN DIRA output assignments, the |< operator is used a lot. This wouldn't really work if you have to assign multiple values to DIRA, would it?
DAT org entry mov dira, diraval diraval long %11
This would assign both pins 0 and 1 as outputs, right? This may be a total noob Q, but I'm still busy learning.
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| To know recursion, you must first know recursion.
Comments
You can also use OR to set pins in dira, especially useful if some vary:
mov dira, diraval ' lets say this sets up the basic pins
or dira, pins ' lets say pins is a mask that varies depending on the program.
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| To know recursion, you must first know recursion.
But when you want to set pin x and y it's easy to write:
x and y are constants, of course!
Note also, why they chose this funny glyph "|<": It resembles 1 <<
You could as well write:
ASM is quite fun to learn but I still have a long way to go [noparse]:)[/noparse]
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| To know recursion, you must first know recursion.