
DOWNLOAD

\ Filename: yreg332.f
\ Author: jack j. woehr jax@well.UUCP JAX on GEnie SYSOP, RCFB (303) 278-0364
\ Copyright (c) 1991, Vesta Technology, Inc.
\ ALL RIGHTS RESERVED.
\ Platform: SBC332 w/ VFSE
\ Purpose: Convention for naming special registers in Y-space for
\          access from high-level.
\ Dependencies: Platform; W@ W! (16-bit ops)
\               Some YREGs can only be addressed in supervisor mode.
\ References: MC68332 USER'S MANUAL [MC68332UM/AD] Motorola, 1990
\ $Log:   V:/vestasrc/forth/68332/tpuqsm/vcs/yreg332.f_v  $
\ 
\    Rev 1.0   28 Jul 1992 14:54:04   jax
\ Initial revision.
\ 
\

BASE @
HEX

\ Vesta SBC332 sets Y(A23)=1
F00000 CONSTANT YOFFSET

\ Make a constant including the '332 Y-bit
: YREG ( addr "name"  --) YOFFSET + ROM CREATE , RAM DOES> @ ABS>DATA ;

\ OR a bitmask into a YREG
: |YREG ( x yreg --)
     DUP >R W@ OR R> W! ;

\ NAND a bitmask out of a YREG
: ~&YREG ( x yreg --)
    SWAP INVERT OVER W@ AND SWAP W! ;

\ Set a bitmask hi or lo in a YREG
\ Some SIM registers only addressable in supervisor mode.
: SET-YREG ( x yreg flag --)
    IF |YREG ELSE ~&YREG THEN ;

BASE !
END-DOWNLOAD
