Re: [Amforth] how to use bitmask:

2019-06-17 Thread Matthias Trute
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

Re: [Amforth] how to use bitmask:

2019-06-17 Thread Erich Wälde
Hello Jan, > I need to do a bitmask on register. > > These are the constants, and mask > > $24 constant ddrb > $25 constant portb > > \ bit masks > %000100 constant mSS ( PB2 ) > %10 constant mSCK ( PB5 ) > > I wont > 1. to set the bits in ddrb with the bitmask mSS > 2. to clear bits in port

Re: [Amforth] how to use bitmask:

2019-06-17 Thread Peter C. Hauser
Jan, For a general idea on masks you might want to consult p. 92 of "Starting Forth". If I remember correctly "bitmask:" will create a bitmask, but not do the bit-setting for you. One has to write to the registers to do that (not sure anymore if it is just "c!" or a special version of store fo

[Amforth] how to use bitmask:

2019-06-17 Thread Jan Kromhout via Amforth-devel
Hello, I need to do a bitmask on register. These are the constants, and mask $24 constant ddrb $25 constant portb \ bit masks %000100 constant mSS ( PB2 ) %10 constant mSCK ( PB5 ) I wont 1. to set the bits in ddrb with the bitmask mSS 2. to clear bits in portb with the bitmask mSCK In