For a plain textfile, the commands used to be unprintable control characters (the original use of the CTRL key). Those instructions were for a line printer or a teletype - single-font impact printers and some dot-matrix printers.
But now that Wordstar, Windows, and laser printers ruined everything (from this point of view), you have to insert formatting codes with a text editor. Each printer has its own set of instructions (many do not understand the concept of a line of type - they think in pixels). The print driver puts the correct adjustments to the text in when the text editor prints the page.
This is why old computers can't use new printers. The new printers can't understand the stream of text and control characters the old computers generate.
What's CF? Never heard of it.
If you are using an old inpact printer, the ASCII codes are:
letter A = hex 41 (for reference)
Carriage Return = hex 0D (old ctrl M)
Linefeed = Hex 0A (old ctrl J)
Backspace = Hex 08 (old ctrl H)
Formfeed (top of page) = Hex 0C (old ctrl L)
But on the IBM PC screen, these characters were used for special symbols.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
This printer might be a line printer. If so the character codes I mentioned above are valid.
The hard part is getting the codes into the printer with a program. Usually this is done through a printer driver. Do you have a driver for this printer?
There used to be a DOS Text Printer driver, but Microsoft, in it's infinite stupidity, seems to have removed it. For some reason, Microsoft doesn't seem to want people to use old equipment. But maybe you can find such a driver.
The alternative is using a program to write directly to the port. This requires the codes the printer actually uses, plus the character codes for the characters themselves. Often these are the ASCII or ISO chracter sets. This page has the character codes for ASCII:
http://www.asciitable.com/
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
Those instructions may be for assembly language programming or older compilers or BASIC interpreters.
The driver may automatically do the setup and font selection for you when you start Windows.
Your programming language should automatically send the carriage return and line feed for you when you print successive lines using the language. The driver makes sure the codes are the right ones.
The formfeed is the command your language uses to send the printer to a new page.
The rest will depend on what language you are writing the program in. What language are you using? The commands are different in each programming language.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
In vb, the char$ function lets you put in codes.
LPRINT automatically puts in the CR LF, unless you put a semicolon at the end of the statement.
char$(13) is carriage return
char$(10) is line feed
char$(12) is form feed
char$(27) is escape
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182