Hi Jan, > I need to do a bitmask on register.
The simplest operations are the ones documented in the source file \ Use it this way: \ PORTD 7 portpin: PD.7 ( define portD pin #7) \ PD.7 high ( turn portD pin #7 on, i.e. set it high- level) \ PD.7 low ( turn portD pin #7 off, i.e. set it low- level) \ PD.7 <ms> pulse ( turn portD pin #7 for <ms> high and low) \ the following words are for "real" IO pins only \ PD.7 pin_output ( set DDRD so that portD pin #7 is output) \ PD.7 pin_input ( set DDRD so that portD pin #7 is input) \ PD.7 pin_high? ( true if pinD pin #7 is high) \ PD.7 pin_low? ( true if pinD pin #7 is low) \ These word use only one bit. > In bitnames.frt there is a word bitmask: How can I use it to do > the two actions above? Note that the hex coding is used (a single F means $f) \ multi bit operation \ PORTD F bitmask: PD.F ( define the lower nibble of port d ) \ PD.F pin@ ( get the lower nibble bits ) \ 5 PD.F pin! ( put the lower nibble bits, do not change the others ) A bitmask operates on all bits that are 1 in the bitmask. All others are unaffected, c! would overwrite all bits. Matthias _______________________________________________ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel