Why did DOS use dollar-terminated strings?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












According to a few tutorials I am seeing, DOS used dollar-terminated strings to write to the terminal. This seems to also be documented here on INT 21H.



AH = 09h - WRITE STRING TO STANDARD OUTPUT
Entry: DS:DX -> '$'-terminated string
Return: AL = 24h
Notes: ^C/^Break are checked


You can see this from the code in this tutorial here. What was the reason for going with dollar-terminated strings rather than NUL-terminated strings like C?










share|improve this question



















  • 1




    That comes from CP/M.
    – mannaggia
    54 mins ago














up vote
1
down vote

favorite












According to a few tutorials I am seeing, DOS used dollar-terminated strings to write to the terminal. This seems to also be documented here on INT 21H.



AH = 09h - WRITE STRING TO STANDARD OUTPUT
Entry: DS:DX -> '$'-terminated string
Return: AL = 24h
Notes: ^C/^Break are checked


You can see this from the code in this tutorial here. What was the reason for going with dollar-terminated strings rather than NUL-terminated strings like C?










share|improve this question



















  • 1




    That comes from CP/M.
    – mannaggia
    54 mins ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











According to a few tutorials I am seeing, DOS used dollar-terminated strings to write to the terminal. This seems to also be documented here on INT 21H.



AH = 09h - WRITE STRING TO STANDARD OUTPUT
Entry: DS:DX -> '$'-terminated string
Return: AL = 24h
Notes: ^C/^Break are checked


You can see this from the code in this tutorial here. What was the reason for going with dollar-terminated strings rather than NUL-terminated strings like C?










share|improve this question















According to a few tutorials I am seeing, DOS used dollar-terminated strings to write to the terminal. This seems to also be documented here on INT 21H.



AH = 09h - WRITE STRING TO STANDARD OUTPUT
Entry: DS:DX -> '$'-terminated string
Return: AL = 24h
Notes: ^C/^Break are checked


You can see this from the code in this tutorial here. What was the reason for going with dollar-terminated strings rather than NUL-terminated strings like C?







ms-dos assembly






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago

























asked 1 hour ago









Evan Carroll

2729




2729







  • 1




    That comes from CP/M.
    – mannaggia
    54 mins ago












  • 1




    That comes from CP/M.
    – mannaggia
    54 mins ago







1




1




That comes from CP/M.
– mannaggia
54 mins ago




That comes from CP/M.
– mannaggia
54 mins ago










1 Answer
1






active

oldest

votes

















up vote
7
down vote













The short answer is that DOS was designed to be similar to CP/M, and drawing a quote from here:




While 8-bit programs could not run on 16-bit computers, Intel
documented how the original software developer could mechanically
translate an 8-bit program into a 16-bit program. Only the developer
of the program with possession of the source code could make this
translation. I designed DOS so the translated program would work the
same as it had with CP/M – translation compatibility. The key to
making this work was implementing the CP/M API.




Or course this brings up the question as to why CP/M used the dollar sign.



This discussion says CP/M got the idea from DEC, which used the RAD50 character encoding. With only 40 characters (50 octal), you only have uppercase, digits, space, peroid, dollar, and percent.




Both CP/M and RT-11 are evolved from earlier DEC OS's, most notably
OS/8 (on the PDP-8) and DOS-11 (on the PDP-11). The most obvious
feature of all of these OS's is the presence of "PIP"




So DEC probably chose dollar because it didn't have many options, CP/M got it from DEC, and DOS got it from CP/M.






share|improve this answer








New contributor




Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • I'm really impressed by the RAD50 information. I'll mark this answer as chosen if no one else has anything to do add. It looks like you went down a good rabbit hole from DOS to CP/M to find that.
    – Evan Carroll
    41 mins ago










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "648"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f7638%2fwhy-did-dos-use-dollar-terminated-strings%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
7
down vote













The short answer is that DOS was designed to be similar to CP/M, and drawing a quote from here:




While 8-bit programs could not run on 16-bit computers, Intel
documented how the original software developer could mechanically
translate an 8-bit program into a 16-bit program. Only the developer
of the program with possession of the source code could make this
translation. I designed DOS so the translated program would work the
same as it had with CP/M – translation compatibility. The key to
making this work was implementing the CP/M API.




Or course this brings up the question as to why CP/M used the dollar sign.



This discussion says CP/M got the idea from DEC, which used the RAD50 character encoding. With only 40 characters (50 octal), you only have uppercase, digits, space, peroid, dollar, and percent.




Both CP/M and RT-11 are evolved from earlier DEC OS's, most notably
OS/8 (on the PDP-8) and DOS-11 (on the PDP-11). The most obvious
feature of all of these OS's is the presence of "PIP"




So DEC probably chose dollar because it didn't have many options, CP/M got it from DEC, and DOS got it from CP/M.






share|improve this answer








New contributor




Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • I'm really impressed by the RAD50 information. I'll mark this answer as chosen if no one else has anything to do add. It looks like you went down a good rabbit hole from DOS to CP/M to find that.
    – Evan Carroll
    41 mins ago














up vote
7
down vote













The short answer is that DOS was designed to be similar to CP/M, and drawing a quote from here:




While 8-bit programs could not run on 16-bit computers, Intel
documented how the original software developer could mechanically
translate an 8-bit program into a 16-bit program. Only the developer
of the program with possession of the source code could make this
translation. I designed DOS so the translated program would work the
same as it had with CP/M – translation compatibility. The key to
making this work was implementing the CP/M API.




Or course this brings up the question as to why CP/M used the dollar sign.



This discussion says CP/M got the idea from DEC, which used the RAD50 character encoding. With only 40 characters (50 octal), you only have uppercase, digits, space, peroid, dollar, and percent.




Both CP/M and RT-11 are evolved from earlier DEC OS's, most notably
OS/8 (on the PDP-8) and DOS-11 (on the PDP-11). The most obvious
feature of all of these OS's is the presence of "PIP"




So DEC probably chose dollar because it didn't have many options, CP/M got it from DEC, and DOS got it from CP/M.






share|improve this answer








New contributor




Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • I'm really impressed by the RAD50 information. I'll mark this answer as chosen if no one else has anything to do add. It looks like you went down a good rabbit hole from DOS to CP/M to find that.
    – Evan Carroll
    41 mins ago












up vote
7
down vote










up vote
7
down vote









The short answer is that DOS was designed to be similar to CP/M, and drawing a quote from here:




While 8-bit programs could not run on 16-bit computers, Intel
documented how the original software developer could mechanically
translate an 8-bit program into a 16-bit program. Only the developer
of the program with possession of the source code could make this
translation. I designed DOS so the translated program would work the
same as it had with CP/M – translation compatibility. The key to
making this work was implementing the CP/M API.




Or course this brings up the question as to why CP/M used the dollar sign.



This discussion says CP/M got the idea from DEC, which used the RAD50 character encoding. With only 40 characters (50 octal), you only have uppercase, digits, space, peroid, dollar, and percent.




Both CP/M and RT-11 are evolved from earlier DEC OS's, most notably
OS/8 (on the PDP-8) and DOS-11 (on the PDP-11). The most obvious
feature of all of these OS's is the presence of "PIP"




So DEC probably chose dollar because it didn't have many options, CP/M got it from DEC, and DOS got it from CP/M.






share|improve this answer








New contributor




Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









The short answer is that DOS was designed to be similar to CP/M, and drawing a quote from here:




While 8-bit programs could not run on 16-bit computers, Intel
documented how the original software developer could mechanically
translate an 8-bit program into a 16-bit program. Only the developer
of the program with possession of the source code could make this
translation. I designed DOS so the translated program would work the
same as it had with CP/M – translation compatibility. The key to
making this work was implementing the CP/M API.




Or course this brings up the question as to why CP/M used the dollar sign.



This discussion says CP/M got the idea from DEC, which used the RAD50 character encoding. With only 40 characters (50 octal), you only have uppercase, digits, space, peroid, dollar, and percent.




Both CP/M and RT-11 are evolved from earlier DEC OS's, most notably
OS/8 (on the PDP-8) and DOS-11 (on the PDP-11). The most obvious
feature of all of these OS's is the presence of "PIP"




So DEC probably chose dollar because it didn't have many options, CP/M got it from DEC, and DOS got it from CP/M.







share|improve this answer








New contributor




Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 50 mins ago









Eugene Styer

17114




17114




New contributor




Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Eugene Styer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • I'm really impressed by the RAD50 information. I'll mark this answer as chosen if no one else has anything to do add. It looks like you went down a good rabbit hole from DOS to CP/M to find that.
    – Evan Carroll
    41 mins ago
















  • I'm really impressed by the RAD50 information. I'll mark this answer as chosen if no one else has anything to do add. It looks like you went down a good rabbit hole from DOS to CP/M to find that.
    – Evan Carroll
    41 mins ago















I'm really impressed by the RAD50 information. I'll mark this answer as chosen if no one else has anything to do add. It looks like you went down a good rabbit hole from DOS to CP/M to find that.
– Evan Carroll
41 mins ago




I'm really impressed by the RAD50 information. I'll mark this answer as chosen if no one else has anything to do add. It looks like you went down a good rabbit hole from DOS to CP/M to find that.
– Evan Carroll
41 mins ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f7638%2fwhy-did-dos-use-dollar-terminated-strings%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke