Could someone give me some background on what the instruction "call crlf" does? I am having some trouble finding good resources on whether or not I need this in my code. Thanks.
-
I'm not sure if it's an instruction: http://stackoverflow.com/questions/1552749/difference-between-cr-lf-lf-and-cr-line-break-types – dammkewl Jul 17 '14 at 07:33
-
1Look up `CALL` in the [Intel Software Developer Manual](http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html?iid=tech_vt_tech+64-32_manuals). `crlf` is some subroutine which you haven't shown us, so we can't possibly know what it does. By its name I'd guess that it prints a carriage return and a linefeed, but there's no way of knowing without seeing the code. – Michael Jul 17 '14 at 07:34
-
Ahh, I think I see now that this is an instruction to carry a line down or new line. It may be a specific direction to call within 32 bit x86 programming? – user3819671 Jul 17 '14 at 07:37
-
carriage return `CR` and line feed `LF` i.e `\r\n`, it's a method that just prints a `newline` [see here](http://www.answers.com/topic/crlf-computer-jargon) – James Jul 17 '14 at 07:37
-
Thank you James. I feel like there weren't too many concrete answers to the question before I asked. I don't really understand why this is getting negative feedback as a question, but thats fine. Thanks for all of your responses! :) – user3819671 Jul 17 '14 at 07:46
2 Answers
It's a procedure call to a procedure called "crlf". What does it do is anybody's guess; but it probably has to do with a newline sequence on Windows-based platforms. CR stands for character #13 aka carriage return, and LF is #10, line feed. In Windows, lines are terminated with CR/LF character pair. Some non-Windows tools respect them, too; notably, this is a line separator in some prominent Internet protocols such as HTTP.
The procedure prints CR/LF on the console, or stores them in some string buffer, or something. Without its code, it's impossible to tell.

- 59,826
- 25
- 160
- 281
Could someone give me some background on what the instruction "call crlf" does?
When you use the instruction call
in assembly, you are jumping
to an address
, executing from there until you hit a ret
instruction and returning to where you called from, generally people call these labels and the associated code subroutines, methods, functions, procedures
e.t.c.
Also depending on how the subroutines are implemented will depend on the calling conventions (how and where you pass arguments and get return values) that you will need to follow.
CRLF
is likely a label
(meaning a symbolic representation of an address)
Which probably stands for carriage return
& line feed
.
Which stands for ascii '\r'
& '\n'
.
Which stands for hex 0xd
& 0xa
respectively.
The differences between '\r' & '\n'
Mac
uses'\r' CR
for newlines.Unix/Linux
use'\n' LF
for newlines.Windows
uses"\r\n" CRLF
proof Windows does this is in this dump of a file called text.txt
that contains 2 presses of the enter
key;
c:\Users\James\Desktop>dump text.txt
0D 0A 0D 0A 0A -- -- -- -- -- -- -- -- -- -- -- | .....-----------
and quickly on a Linux VM;
james@james-VirtualBox:~Files$ hexdump -C text.txt
00000000 0a 0a |...|
00000002
I don't have a mac
so i can't prove they use '\r'
for newlines.
For Background (where it comes from)
Basically you need to think about typewriters
& printers
- see this googled image;
-
1) "On a typewriter or computer printer, the action that returns it to the beginning of the line."
2) "The control character (0x0D in ASCII, abbreviated as CR) that originally signaled a device to perform a carriage return, but now merely indicates the end of a line of text."
-
1) "On a typewriter, the action of the carriage roller to push the page up one, two or one and a half lines (as set elsewhere) when executing a carriage return."
2) "The character (0x0a in ASCII) which advances the paper by one line in a teletype or printer"

- 1,009
- 10
- 11