Path: utzoo!attcan!uunet!husc6!mailrus!ames!pasteur!ucbvax!hplabs!hpfcdc!steve From: steve@hpfcdc.HP.COM (Steve Taylor) Newsgroups: comp.sys.hp Subject: Re: HP9836 BASIC -- HELP !! Message-ID: <5570098@hpfcdc.HP.COM> Date: 3 Jan 89 19:21:08 GMT References: <281@vmsa.technion.ac.il> Organization: HP Ft. Collins, Co. Lines: 30 Benjamin Cohen asks: } SUB Out_word(@GPIB,INTEGER Xbuf(*),N) } INTEGER Odata } FOR I=1 TO N } Odata=ROTATE(Xbuf(I),8) } OUTPUT @GPIB USING "#,W";Odata } NEXT I } SUBEND } This obviously is sending data to a GPIB device, but what would be the } equivalent in C? What does the ROTATE function do? It appears the program is sending data to a device which expects low-byte, high-byte, rather than high-byte, low-byte. Since ROTATE works on 16-bit quantities, the value of 8 means swap bytes. } What does the } output look like (binary word transfer or formatted ASCII)? As Sid Cowles says: i'd guess that the io-path, @gpib, was assigned with } format off since the output statement is using a 2 byte word ("W") format } with no end-of-line sequence. The "#" says no eol. The swap above also implies binary data. To be sure, look for the statement ASSIGN @Gpib TO ... in the calling portion of the program. FORMAT OFF is the default for devices. If it were formatted ASCII then the ASSIGN statement would include a FORMAT ON clause. I'm not familiar with DIL, so perhaps someone who is will give you the C equivalent. Regards, Steve Taylor