Hi,

> I whas reading the German "das Fort magazin, vierte Dimension" and
> find two interesting commands for manupulating on a simple way
> individual bits with bset and bclr.
> 
> Why are these not implemented in amForth?. Is thebsource for these
> two available?

Within the core/words directory you can find three files:
bm_set.asm bm_clear.asm and bm_toggle.asm which should do,
what you expect (and they are compatible with the bitname.frt
structures and are implemented in assembly for speed reasons).

bm-set will set all bits at the specified RAM Address that
are set in the bitmask. bm-clear will clear all thoses bit
positions and bm-toggle, well you'll guess yourself ;)

I prefer the bitmask over a bitnumber simply because it
can deal with more bits in one operation. Expanding the
bitmask to more than 8bits is a little bit dangerous since
both the pure action of reading/writing and the order of
the read/write operations may be important in some cases.

The bclr and bset commands Michael mentioned are basically the
same, but we could not (yet) agree on a common name....

HTH
Matthias

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to