Here is the complete code... I think it is failing hardware, but I have thought that before.
The story is I spent a couple of days soldering a couple of LaserPings to a slip ring and mounting the thing to a Parallax feedback 360 servo... assuming that the code would be a no brainer... first I couldn't get the smart pins to cooperate.. then I couldn't get the edge detectors to cooperate... and now I am reduced to this:) The idea is that when you make momentary contact with 3.3v... the moment is spit out to serial, with the first clock and the total period reported AND the LED lights up during contact... this actually does work!!! But seeing that LED stay dimly lit has me befuzzled.
there is probably a ret at the end of the code of label?
Mike
I am just another Code Monkey.
A determined coder can write COBOL programs in any language. -- Author unknown.
Press any key to continue, any other key to quit
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
The _RET_ only executes if not preempted by a branch. This means that '_RET_ DJNZ X,#loop' will only RETurn when the looping is done. In your example, the CALL would always take precedence over the _RET_.
Now here's another one. I've been setting the carry with "modc 1 wc" but I'm told it should be "modc %1111 wc" however this test with MODZ says only the lsb is used.
First, the test word in TAQOZ which is simply called MODZ at the high level.
' MODZ ( n -- set )
_MODZ altd tos,#0
modz 0 wz
mov tos,#0
if_z mov tos,#1
ret
So it will return a 1 if the z is set.
Now the test....
Now here's another one. I've been setting the carry with "modc 1 wc" but I'm told it should be "modc %1111 wc" however this test with MODZ says only the lsb is used.
First, the test word in TAQOZ which is simply called MODZ at the high level.
' MODZ ( n -- set )
_MODZ altd tos,#0
modz 0 wz
mov tos,#0
if_z mov tos,#1
ret
So it will return a 1 if the z is set.
Now the test....
The _RET_ only executes if not preempted by a branch. This means that '_RET_ DJNZ X,#loop' will only RETurn when the looping is done. In your example, the CALL would always take precedence over the _RET_.
Thanks Chip. Actually if we had though about it earlier, it could have been simple to make it work. Just don't push the call's return address onto the stack. This way, the call's return would bypass this call's return address, and go directly to the previous return address. Saves 2 clocks to boot
Comments
Here is the complete code... I think it is failing hardware, but I have thought that before.
The story is I spent a couple of days soldering a couple of LaserPings to a slip ring and mounting the thing to a Parallax feedback 360 servo... assuming that the code would be a no brainer... first I couldn't get the smart pins to cooperate.. then I couldn't get the edge detectors to cooperate... and now I am reduced to this:) The idea is that when you make momentary contact with 3.3v... the moment is spit out to serial, with the first clock and the total period reported AND the LED lights up during contact... this actually does work!!! But seeing that LED stay dimly lit has me befuzzled.
I presume that this is invalid
Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com
Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
It would just require the verilog to NOT push the new return address onto the stack. I wonder if Chip thought about this?
Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com
Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
there is probably a ret at the end of the code of label?
Mike
A determined coder can write COBOL programs in any language. -- Author unknown.
Press any key to continue, any other key to quit
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
The _RET_ only executes if not preempted by a branch. This means that '_RET_ DJNZ X,#loop' will only RETurn when the looping is done. In your example, the CALL would always take precedence over the _RET_.
First, the test word in TAQOZ which is simply called MODZ at the high level. So it will return a 1 if the z is set.
Now the test.... Only the lsb was recognized.
Tachyon Forth - compact, fast, forthwright and interactive
--->CLICK THE LOGO for more links<---
P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
Brisbane, Australia
Using %0001 means z = !c & !z.
But that's kinda scary that we are using all these instructions that haven't been documented yet!
Tachyon Forth - compact, fast, forthwright and interactive
--->CLICK THE LOGO for more links<---
P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
Brisbane, Australia
So modz %1100 wz copies C into Z. But what if we don't use wz?
Tachyon Forth - compact, fast, forthwright and interactive
--->CLICK THE LOGO for more links<---
P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
Brisbane, Australia
Z state wold remain unchanged.
Tachyon Forth - compact, fast, forthwright and interactive
--->CLICK THE LOGO for more links<---
P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
Brisbane, Australia
Thanks Chip. Actually if we had though about it earlier, it could have been simple to make it work. Just don't push the call's return address onto the stack. This way, the call's return would bypass this call's return address, and go directly to the previous return address. Saves 2 clocks to boot
Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com
Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
What do you think this instruction does? Nope! It inverts Z! So in the test below you will see NZNZNZNZNZ...
Here are the tests...
Postedit:
I have just seen the above discussion with ccodes.
Not sure about anything other than 0000 and 1111 anymore. No time now tho'.
Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com
Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)