Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!uunet!melpar!toppin From: toppin@melpar.UUCP (Doug Toppin) Newsgroups: comp.unix.questions Subject: 'adb' formatting of data files? Keywords: adb Message-ID: <217@melpar.UUCP> Date: 10 Jul 89 19:45:02 GMT Organization: E-Systems, Falls Church, VA Lines: 29 I know it is possible to use 'adb' to produce a formatted display of data files with very little 'code'. I have a data file composed of an unknown number of records of the following structure: struct { unsigned int a : 5; unsigned int b : 7; }; I want to use 'adb' to display the contents of each record. To do that I need to load the current record into an adb variable, for each field: mask off the bits from the other field, for the upper bit field, shift down and then for both, display the field. My problem is that I have not been able to do the load operation in a script. If I am operating on one record interactively I can do it with the following for the 'a' field: 0?u * load first record $v * show variables, <0 should have first record <0&224%31>a * using 'a' variable mask away all but the 7-bits, shift down 5-bits by dividing, output to 'a' $v * display variables to see value of 'a' I want to do this for an unknown number of records using an adb script but have not been able to do the same steps in the script. If anyone knows how to do this or knows of a reference please let me know. If I try to do something with '*0?' I get 'bad segment' error messages. I an running IBM Xenix 2 for the 286 and it does not have 'sdb'. thanks Doug Toppin uunet!melpar!toppin