home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / EFFO / pd6.lzh / TST / bitfields.tst next >
Text File  |  1989-12-21  |  947b  |  54 lines

  1. .( Loading Bit Field test...) cr
  2.  
  3. #include bitfields.f83
  4.  
  5. bitfields
  6.  
  7. .( 1: Create a demo bit field definition) cr
  8.  
  9. bitfield.type STATUS-REG
  10.   bit    ERROR
  11. 3 bits   ERROR.CODE
  12.   nibble INDEX  
  13.   bit    INDIRECT
  14.   byte   OP.CODE
  15. bitfield.end
  16.  
  17.  
  18. .( 2: Print information about the fields) cr
  19.  
  20. ERROR .field cr
  21. ERROR.CODE .field cr
  22. INDEX .field cr
  23. INDEX .field cr
  24. OP.CODE .field cr
  25.  
  26.  
  27. .( 3: Access some data with the fields) cr
  28.  
  29. binary
  30.  
  31. 10101001000100111 ERROR get .
  32. 10101001000100111 ERROR.CODE get .
  33. 10101001000100111 INDEX get .
  34. 10101001000100111 INDIRECT get .
  35. 10101001000100111 OP.CODE get . cr
  36.  
  37.  
  38. .( 4: Change bit fields in some data) cr
  39.  
  40. 0        10101001000100111 ERROR put      ERROR get .
  41. 101      10101001000100111 ERROR.CODE put ERROR.CODE get .
  42. 1111     10101001000100111 INDEX put      INDEX get . 
  43. 1        10101001000100111 INDIRECT put   INDIRECT get . 
  44. 10101111 10101001000100111 OP.CODE put    OP.CODE get . cr
  45.  
  46. decimal
  47.  
  48. forth only
  49.  
  50.  
  51.  
  52.  
  53.  
  54.