Hi.

BSET and BCLR in 4e4th where renamed to CSET and CCLR. They are  
MSP430 specific code since the MSP supports bit set and bit clear  
instructions at any address.

Michael


;U Bit manipulation words  
------------------------------------------------------
;  based on http://www.forth.org/svfig/Len/bits.htm

;U SET    mask addr --      set bit from mask in addr (cell); use  
even adr!
     HEADER  wset,3,'SET',DOCODE
       BIS     @PSP,0(TOS)  ; manipulate the bits
       ADD     #2,PSP       ; 2drop
       MOV     @PSP+,TOS
       NEXT

;U CSET    mask addr --      set bit from mask in addr (byte)
     HEADER  cset,4,'CSET',DOCODE
       BIS.B   @PSP,0(TOS)
       ADD     #2,PSP
       MOV     @PSP+,TOS
       NEXT

;U CLR  mask addr --      reset bit from mask in addr (cell); use  
even adr!
     HEADER  wclr,3,'CLR',DOCODE
       BIC     @PSP,0(TOS)
       ADD     #2,PSP
       MOV     @PSP+,TOS
       NEXT

;U CCLR  mask addr --      reset bit from mask in addr (byte)
     HEADER  cclr,4,'CCLR',DOCODE
       BIC.B   @PSP,0(TOS)
       ADD     #2,PSP
       MOV     @PSP+,TOS
       NEXT

;U CTOGGLE    mask addr --        flip bit from mask in addr (byte)
     HEADER  ctoggle,7,'CTOGGLE',DOCODE
       XOR.B   @PSP,0(TOS)
       ADD     #2,PSP
       MOV     @PSP+,TOS
       NEXT

;U CGET       mask addr -- flag    test bit from mask in addr (byte)
     HEADER  cget,4,'CGET',DOCODE
       BIT.B   @PSP,0(TOS)
       JZ cget1
       MOV #-1,TOS
       JMP cget2
cget1:MOV #0, TOS
cget2:ADD     #2,PSP
       NEXT

---

Am 13.05.2012 um 22:35 schrieb Jan Kromhout:

>
> Hello
>
> 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?
>
> Regards,
>
>
> Jan kromhout
> Sacharovlaan 3
> 3223HM Hellevoetsluis-NL
> ---------------------------------------------------------------------- 
> --------
> 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


------------------------------------------------------------------------------
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