Carriage return, abbreviated CR (ASCII 13, "\r" or 0Dh) and line feed, abbreviated LF (ASCII 10, "\n" or 0Ah) are characters which go back to old teletype terminals, which were basically just typewriters hooked up to a computer. Instead of a screen or display, the terminal printed out the text on a paper roll.
- A carriage return moved the carriage (which had the paper feed) back to the beginning of a line.
- A line feed advanced the paper feed by one line.
In order to start writing at the beginning of a new line, the teleprinter had to do both actions. Modern day operating systems have adapted these characters to represent line breaks ("enter" keys). But not all of them use the same sequence:
- Windows uses the combination CR LF as a line terminator ("\r\n").
- Unix / Linux and Mac OS X use just a single LF ("\n").
- Older Mac operating systems use a single CR ("\r").
Some higher level programming languages have made this less confusing by automatically doing the right thing. For example, in C a single "\n" maps to the correct sequence depending on the operating system it is compiled for.
In assembly, you should just experiment a bit by printing either 0Dh, 0Ah (Windows-style) or just plain 0Ah (*nix-style).