In: Computer Science
1. How to create a newline subroutine in micro assembly language that sends the CR and LF codes to putchUSART0 (write down the full code in micro assembly language). Terminal programs move the cursor to the beginning of a line with a Carriage Return (CR) code 0x0D and down a line with the Line Feed (LF) code 0x0A.
Solution:
CR and LF are control characters or bytecode that can be used to mark a line break in a text file. CR = Carriage Return (\ r, 0x0D in hexadecimal, 13 in decimal) - moves the cursor to the beginning of the line without advancing to the next line. LF = Line Feed (\ n,0x0A in hexadecimal, 10 in decimal) - moves the cursor down to the next line without returning to the beginning of the line. A CR immediately followed by a LF (CRLF, \ r\ n, or 0x0D0A) moves the cursor down to the next line and then to the beginning of the line.
EG : NEW LINE INSERTED BETWEEN THE WORDS OF "HELLO" AND "WORLD"
Newline frequently called line ending, end of line (EOL), line feed or line break is a control character or sequence of control characters in a character encoding specification eg : ASCII or EBCDIC) that is used to signify the end of a line or text and the start of a new one. some text editors set this special character when pressing enter key. the concepts of line feed LF nd CR carriage return are closely associated and can be considered either separately or together. In the physical media of typewriters and printers , two axes of motion are down and across are needed to create a new line on the page.
CR = Carriage Return, U+000D
LF = Line Feed, U+000A
When writing to a file, device node or socket/ fifo in text mode, '\n' is transparently translated to the native newline sequence used by the system, which may be longer than one character. when reading in text mode, the native newline sequence is translated back to '\n'. In binary mode, no translation is performed, and the internal representation produced by '\n' is output directly.
Carriage Return by itself provided the ability to overprint the line with new text. This could be used to produce bold or accented characters, underscores, struck - out text and some composite symbols.
#please consider my effort and give me a like....thank u....