Not quite as pretty as your verilog versions ... but should work
;Datum[6:4] = 2
Datum.6=1
Datum.4=0
;IF PORTB[5:1] = 3 THEN
If (PORTB & $22) = $22 THEN
EDIT:
or
Code:IF PORTB.5 = 1 THEN IF PORTB.1 = 1 THEN ENDIF ENDIF
Not quite as pretty as your verilog versions ... but should work
;Datum[6:4] = 2
Datum.6=1
Datum.4=0
;IF PORTB[5:1] = 3 THEN
If (PORTB & $22) = $22 THEN
EDIT:
or
Code:IF PORTB.5 = 1 THEN IF PORTB.1 = 1 THEN ENDIF ENDIF
Last edited by paul borgmeier; - 2nd November 2006 at 04:47.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Ok I see your point, although those aren't quite equivalent yet. A verilog statement like Datum[6:4] = 2 would change all bits from bit 6 to bit 4 of Datum, turning Datum into X010XXXX where the X's are the previous bit values of Datum before the statement. So referring to Datum as Datum[6:4] is like having a new 3 bit variable where Datum[4] is the new bit 0, Datum[5] is the new bit 1 and Datum[6] is the new bit 2 to complete the three bit variable. But thanks I guess I'll have to work my way around with those sort of tricks. Thanks for your time, God bless.
As is clear from above, I have never used verilog ...., for completeness this not so pretty approach still works
Code:;Datum[6:4] = 2 Datum.6=0 Datum.5=1 Datum.4=0OR you could blast the first type with inline ASMCode:;IF PORTB[5:1] = 3 THEN If (PORTB & $3E) = $06 THEN
Others might have a cleaner method?Code:;Datum[6:4] = 2 Datum var byte ASM movlw 0x20 ; b00100000 new values xorwf _Datum, W andlw 0x70 ; b01110000 mask values xorwf _Datum, F ; bX010XXXX ENDASM
EDIT - added comments to ASM routine
Last edited by paul borgmeier; - 2nd November 2006 at 20:41.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Bookmarks