Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF (EN)

299 PRINT# Purpose This records numbers and words on cassette or disc. In other words it stores data on a file. Numbers and strings are stored in a special internal format. Before this statement is used the file must have been opened using the OPENIN , OPENOUT or OPENUP statements. See chapter 31 on file handling for more information. Example PRINT# file, X,Y,Z,A$,"Monday",33 Description A statement which writes data to files. All values are written in a special internal format: Integer variables are written as &40 followed by the twos complement representation of the integer in four bytes, most significant byte first.

Real variables are written as &FF followed by four bytes of mantissa and one byte exponent. The mantissa is sent lowest significant bit (LSB) first. 31 bits represent the magnitude of the mantissa and 1 bit the sign. The exponent byte is in twos complement excess 128 form. String variables are written as &00 followed by a 1 byte ‘byte count’ followed by the characters in the string in reverse order. Syntax PRINT# {, ? }