File Type $A0 (160)
Auxiliary Type $0000

Full Name: WordPerfect Word Processing File
Short Name: WordPerfect Document

Written by Matt Deatherage (January 1989)

Files of this type and auxiliary type contain WordPerfect(TM) documents.


WordPerfect(TM) for the Apple IIe and IIc provide more than 110 word processing features. In addition to a 50,000-word spelling checker and a thesaurus, the program offers footnotes, headers and footers, mail-merge, macros, search and replace, on-line help, file management, and dozens of formatting features.

WordPerfect for the Apple IIGS includes all these features and more. The program has a mouse interface with pull-down menus and allows for the editing multiple documents. Users can edit an unlimited number of documents at the same time and can take advantage of any memory available.

For more information on WordPerfect, contact:

WordPerfect, Inc.
1555 North Technology Way
Orem, Utah 84057
Attention: Apple II WordPerfect Technical Support
Telephone: (801) 225-5000

The WordPerfect file format is copyrighted (C) 1984, 1985, 1986, 1987 and 1988 by WordPerfect Corporation and is printed here with permission.

File Structure

WordPerfect files are ASCII files. The text is neither encrypted nor compacted. There is no end-of-file character, and padding past the end of a document with garbage may cause WordPerfect to crash.

Formatting or function codes are embedded as they occur in the text. No code is used for beginning of file or end of file. When creating WordPerfect files from other programs, keep in mind the following:

Function Codes

All function codes are listed in hexadecimal. All except the first five have the high bit set. Function codes above $C0 are discussed under "Multi-Byte Functions."

Code: Command
$09: Tab
$0A: Hard New Line
$0B: Soft New Page
$0C: Hard New Page
$0D: Soft New Line

$80: No operation
$81: Turn right justification on
$82: Turn right justification off
$83: End of centered text
$84: End of aligned or flushed right text
$85: (Used in other WordPerfect Corporation Products)
$86: Center page from top to bottom
$87: (Used in other WordPerfect Corporation Products)
$88: (Used in other WordPerfect Corporation Products)
$89: Tab after the right margin
$8A: Widow/orphan on
$8B: Widow/orphan off
$8C: Hard end of line and soft end of page
$8D: Footnote number (appears only inside of footnotes)
$8E: Reserved
$8F: Reserved
$90: (Used in other WordPerfect Corporation Products)
$91: (Used in other WordPerfect Corporation Products)
$92: (Used in other WordPerfect Corporation Products)
$93: (Used in other WordPerfect Corporation Products)
$94: Underline on
$95: Underline off
$96: Reverse video on
$97: Reverse video off
$98: (Used in other WordPerfect Corporation Products)
$99: Overstrike
$9A: Cancel hyphenation of following word
$9B: (Used in other WordPerfect Corporation Products)
$9C: Bold off
$9D: Bold on
$9E: Hyphenation off
$9F: Hyphenation on
$A0: Hard space
$A1: (Used in other WordPerfect Corporation Products)
$A2: (Used in other WordPerfect Corporation Products)
$A3: (Used in other WordPerfect Corporation Products)
$A4: (Used in other WordPerfect Corporation Products)
$A5: (Used in other WordPerfect Corporation Products)
$A6: (Used in other WordPerfect Corporation Products)
$A7: (Used in other WordPerfect Corporation Products)
$A8: (Used in other WordPerfect Corporation Products)
$A9: Hard hyphen in line
$AA: Hard hyphen at end of line
$AB: Hard hyphen at end of page
$AC: Soft hyphen
$AD: Soft hyphen at end of line
$AE: Soft hyphen at end of page
$AF: (Used in other WordPerfect Corporation Products)
$B0: (Used in other WordPerfect Corporation Products)
$B1: (Used in other WordPerfect Corporation Products)
$B2: (Used in other WordPerfect Corporation Products)
$B3: (Used in other WordPerfect Corporation Products)
$B4: (Used in other WordPerfect Corporation Products)
$B5: (Used in other WordPerfect Corporation Products)
$B6: (Used in other WordPerfect Corporation Products)
$B7: (Used in other WordPerfect Corporation Products)
$B8: (Used in other WordPerfect Corporation Products)
$B9: (Used in other WordPerfect Corporation Products)
$BA: (Used in other WordPerfect Corporation Products)
$BB: (Used in other WordPerfect Corporation Products)
$BC: Superscript
$BD: Subscript
$BE: Advance 1/2 line up
$BF: Advance 1/2 line down

Multi-Byte Functions

Multi-byte function codes mark commands which require more than one byte. They mark both the beginning and end of such functions in the file. The length is indicated for most functions, but some have a variable length. In these cases, programs should scan for the second occurrence of the function code to indicate the end of the function.

Code: Command [Length]
Format
$C0: Margin Reset [6]
Byte: $C0
Byte: Old left margin
Byte: Old right margin
Byte: New left margin
Byte: New right margin
Byte: $C0
$C1: Spacing reset [4]
Byte: $C1
Byte: Old spacing
Byte: New spacing
Byte: $C1
Note: Spacing values are stored in half-line increments.
$C2: Left margin release [3]
Byte: $C2
Byte: Number of spaces to go left
Byte: $C2
$C3: Center the following text [5]
Byte: $C3
Byte: Type of center:
0 = between margins
1 = around current column
Byte: Center column number
Byte: Starting column number
Byte: $C3
Bytes: Centered text
Byte: $83
$C4: Align or flush right [5]
Byte: $C4
Byte: Align character (see below)
Byte: Align column number
Byte: Starting column number
Byte: $C4
Bytes: Aligned text
Byte: $84
Note: If the alignment character is $0A (hard new line) then this is a flush right and the alignment column number is the right margin; otherwise, the alignment column number is the next tab stop.
$C5: Reset hyphenation zone (hotzone) [6]
Byte: $C5
Byte: Old left hotzone
Byte: Old right hotzone
Byte: New left hotzone
Byte: New right hotzone
Byte: $C5
$C6: Set page number position [4]
Byte: $C6
Byte: Old position code
Byte: New position code
Codes:
0 = None
1 = Top Left
2 = Top Center
3 = Top Right
4 = Top Left and Right
5 = Bottom Left
6 = Bottom Center
7 = Bottom Right
8 = Bottom Left and Right
Byte: $C6
$C7: Set page number [6]
Byte: $C7
Byte: Old number, high byte
Byte: Old number, low byte
Byte: New number, high byte
Byte: New number, low byte
Byte: $C7
Note: The page numbers are words with the bytes in the "wrong" order.
$C8: Set page number column positions [8]
Byte: $C8
Byte: Old left position
Byte: Old center position
Byte: Old right position
Byte: New left position
Byte: New center position
Byte: New right position
Byte: $C8
$C9: Set tabs [42]
Byte: $C9
20 Bytes: Old tab table
20 Bytes: New tab table
Byte: $C9
Note: Each bit in the tab table represents one position, from bit 0 to bit 159.
$CA: Conditional end of page [3]
Byte: $CA
Byte: Number of single-spaced lines not to be broken
Byte: $CA
$CB: Set pitch and/or font [6]
Byte: $CB
Byte: Old pitch
Byte: Old font
Byte: New pitch
Byte: New font
Byte: $CB
Note: If the pitch is negative, then it is proportional.
$CC: Set temporary margin (indent) [4]
Byte: $CC
Byte: Old temporary margin
Byte: New temporary margin
Byte: $CC
$CD: End of temporary margin [3]
Byte: $CD
Byte: Temporary margin
Byte: $CD
$CE: Set top margin [4]
Byte: $CE
Byte: Old top margin
Byte: New top margin
Byte: $CE
$CF: Suppress page characteristics [3]
Byte: $CF
Byte: Suppress code (Any combination valid):
Bit: Meaning
0: all suppressed
1: Page numbers suppressed.
2: Page number moved to bottom.
3: All headers suppressed
4: Header A suppressed
5: Header B suppressed
6: Footer A suppressed
7: Footer B suppressed
Byte: $CF
$D0: Set form length [6]
Byte: $D0
Byte: Old form length
Byte: Old number of text lines
Byte: New form length
Byte: New number of text lines
Byte: $D0
$D1: Header/footer [Variable]
Byte: $D1
Byte: Old def byte (see below)
Byte: Number of half-lines used by old header/footer
2 bytes: $FF
Byte: Left margin
Byte: Right margin
Bytes: ASCII Text
Byte: $FF
Byte: Number of half-lines used by new header/footer
Byte: New def byte (see below)
Byte: $D1

The format of the def byte is as follows:
Bits 0-1: Type
0 = Header A
1 = Header B
2 = Footer A
3 = Footer B
Bits 2-7: Occurrence
0 = Never
1 = All pages
2 = Odd pages
4 = Even pages
Note: The low-order two bits of the old def byte (the old types) must be correct.
$D2: Footnote [Variable]
Byte: $D2
Byte: Footnote number
Byte: Number of half-lines
Byte: $FF
Byte: Left margin
Byte: Right margin
Bytes: ASCII Text
Byte: $D2
Note: WordPerfect versions 1.0 and 1.1 use this function code. Versions 2.0 and later use function code $E2 instead.
$D3: Set Footnote Number [4]
Byte: $D3
Byte: Old footnote number
Byte: New footnote number
Byte: $D3
Note: WordPerfect versions 1.0 and 1.1 use this function code. Versions 2.0 and later use function code $E4 instead.
$D4: (Used in other WordPerfect Corporation Products) [4]
$D5: Set lines per inch [4]
Byte: $D5
Byte: Old LPI code
Byte: New LPI code
Byte: $D5
Note: Only 6 or 8 lines per inch is valid.
$D6: Set extended tabs [6]
Byte: $D6
Byte: Old starting position
Byte: Old increment
Byte: New starting position
Byte: New increment
Byte: $D6
Note: The starting column position must be at least 160.
$D7: (Used in other WordPerfect Corporation Products) [Variable]
$D8: Set alignment character [4]
Byte: $D8
Byte: Old alignment character
Byte: New alignment character
Byte: $D8
$D9: Set left margin release [4]
Byte: $D9
Byte: Old number of columns to go left
Byte: New number of columns to go left
Byte: $D9
$DA: Set underline mode [4]
Byte: $DA
Byte: Old mode (see below)
Byte: New mode (see below)
Byte: $DA

The underline mode is defined as follows:
0 = Normal Underline
1 = Double Underline
2 = Single Underline Continuous
3 = Double Underline Continuous
$DB: Set sheet feeder bin number [4]
Byte: $DB
Byte: Old number
Byte: New number
Byte: $DB
Note: The number is zero based (bin #1 is stored as 0).
$DC: End of page function (WordPerfect inserts this and it changes with each version) [Variable]
Byte: $DC
Byte: Number of 1/2 lines at end of page, low 7 bits
Byte: Number of 1/2 lines at end of page, high 7 bits
Byte: Number of 1/2 lines used for footnotes
Byte*: Number of pages used for footnotes
Byte*: Number of footnotes on this page
Byte: CEOP Flag
Byte: Suppress code
Byte: $DC
Note: Bytes marked with an asterisk (*) are fields present only in WordPerfect 2.0 and later.
$DD: (Used in other WordPerfect Corporation Products) [24]
$DE: End of temporary margin [4]
Byte: $DE
Byte: Old left temporary margin
Byte: Old right temporary margin
Byte: $DE
$DF: Invisible characters (embedded printer command) [Variable]
Byte: $DF
Bytes: 7-bit text
Byte: $DF
$E0: Temporary margin [4]
Byte: $E0
Byte: New right temporary margin
Byte: New left temporary margin
Byte: $E0
$E1: (Used in other WordPerfect Corporation Products) [3]
$E2: New footnote/endnote (WordPerfect 2.0 and later) [Variable]
Byte: $E2
Byte: Def byte (see below)
Byte: Value A (see below)
Byte: Value B (see below)
Byte: Value C (see below)
Byte: Value D (see below)
Byte: Old footnote length in 1/2 lines
Byte: Number of lines on page 1
Byte: Number of lines on page 2
Byte: Number of lines on page 3
.
.
.
Byte: Number of lines on page N
Byte: Number of pages
Byte: $FF
Byte: Left margin
Byte: Right margin
Bytes: ASCII Text
Byte: $E2

The Def Byte is defined as follows:
Def Bit 0:
0 = use numbers
1 = use characters
Def Bit 1:
0 = footnote
1 = endnote
If Def Bit 0 = 0, then Values A and B are the footnote or endnote number taken together (see below.) If Def Bit 0 = 1, then Value A is the number of characters and Value B is the character.
Note: Values A and B (when taken together) and Values C and D (always) are 14-bit numbers split into 7-bit bytes, high order byte first.
Note: For endnotes, there is just a null between Value D and the $FF byte.
$E3: Footnote information/options [150]
Byte: $E3
74 Bytes: Old Footnote values
74 Bytes: New Footnote values
Byte: $E3

The footnote values are defined as follows:
Byte: Spacing in footnotes (in half-lines)
Byte: Spacing between footnotes (in half-lines)
Byte: Number of lines to keep together
Byte: Flag byte:
Bit 0: 1 if numbering starts on each page
Bits 1-2: (for footnotes)
0 = Use numbers
1 = Use characters
2 = Use letters
Bits 3-4: (for endnotes)
0 = Use numbers
1 = Use characters
2 = Use letters
Bits 5-6: 0 = No line separator
1 = 2" line
2 = Line from left to right margin
3 = 2" line and continued message
Bit 7:
0 = footnotes after text
1 = footnotes at bottom of page
Byte: Number of characters used in place of footnote numbers
5 Bytes: Characters used in place of footnote numbers (null terminated if less than five)
Byte: Number of displayable characters in string for footnote text
15 Bytes: String for footnote text
Byte: Number of displayable characters in string for endnote text
15 Bytes: String for endnote text
Byte: Number of displayable characters in string for footnote note
15 Bytes: String for footnote note
Byte: Number of displayable characters in string for endnote note
15 Bytes: String for endnote note
$E4: New set footnote (WordPerfect 2.0 and later) [6]
Byte: $E4
Byte: Old number,high byte
Byte: Old number,low byte
Byte: New number,high byte
Byte: New number,low byte
Byte: $E4
Note: The new number is zero based (stored as new number minus one).
Note: Footnote numbers are 14-bit numbers split into 7-bit bytes, high order byte first.
$E5: (Used in other WordPerfect Corporation Products) [23]
$E6: (Used in other WordPerfect Corporation Products) [11]
$E7: (Used in other WordPerfect Corporation Products) [3]
$E8: (Used in other WordPerfect Corporation Products) [3]
$E9: (Used in other WordPerfect Corporation Products) [Variable]
$EA: (Used in other WordPerfect Corporation Products) [Variable]
$EB: (Used in other WordPerfect Corporation Products) [32]
$EC: (Used in other WordPerfect Corporation Products) [4]
$ED: (Used in other WordPerfect Corporation Products) [Variable]
$EE: (Used in other WordPerfect Corporation Products) [44]
$EF: (Used in other WordPerfect Corporation Products) [18]
$F0: (Used in other WordPerfect Corporation Products) [6]
$F1: (Used in other WordPerfect Corporation Products) [106]
$F2: (Used in other WordPerfect Corporation Products) [Variable]
$F3: (Used in other WordPerfect Corporation Products) [100]

This and all of the other Apple II Technical Notes have been converted to HTML by Aaron Heiss as a public service to the Apple II community, with permission by Apple Computer, Inc. Any and all trademarks, registered and otherwise, are properties of their owners.