Newbie
zoid
Posts: 12
OK
got a hydra about a week ago, decided i needed prop manual 1.1....got that.
decided to jump in with both feet and type in and run the example pgm on pg 191,192 Hydra manual
The compiler has issues with the line(s)
and OUTA, #!debug_led_port_mask 'turn led off...
the error is "source/constant cannot be larger than 1FF" .... 9bits OK.... OUTA is 32 bits hence the error.
So I RTFM and it says use MUXx to truncate OUTA down to 8 bits or so
But the mux instructions [pgs 315-318 in prop1.1] set the masked bits to C,Z or not C,Z which are bits I can't predict ahead.
suggestions?
got a hydra about a week ago, decided i needed prop manual 1.1....got that.
decided to jump in with both feet and type in and run the example pgm on pg 191,192 Hydra manual
The compiler has issues with the line(s)
and OUTA, #!debug_led_port_mask 'turn led off...
the error is "source/constant cannot be larger than 1FF" .... 9bits OK.... OUTA is 32 bits hence the error.
So I RTFM and it says use MUXx to truncate OUTA down to 8 bits or so
But the mux instructions [pgs 315-318 in prop1.1] set the masked bits to C,Z or not C,Z which are bits I can't predict ahead.
suggestions?
Comments
You can't use an immediate value of larger than 9 bits. If you were working with a bit from 0 to 8 you could just do it using ANDN (and not) which is the equivalent of using AND #!(value).
The difference here is that ANDing off a single bit requires all the other bits to be on, resulting in a 32 bit value, like $FFFFFF7F. Using ANDN means you can use the inverse of that immediate value (in my example it's $00000080), and the ANDN instruction inverts it before doing the AND.
I don't have the manual you're using, so I can't comment on the specifics of what it's telling you.
Now, in your pasm statement, you are using a literal (by using #) which means that it is only 9 bits long.
So, you need to define your value as a 32 bit contstant at the end of your code (before any RES statements) by
ledmask long debug_led_port_mask
and in your code
ANDN OUTA,ledmask
and welcome to the forum
it's very easy to make a 100% sure setting or clearing a Z-flag
mov ...,#0 wz sets z-flag
mov ...,#1 wz clears z-flag
keep the questions coming
best regards
Stefan