flat assembler
Message board for the users of flat assembler.

Index > DOS > int 21h/0Ah service: what are those "templates"?

Author
Thread Post new topic Reply to topic
DimonSoft



Joined: 03 Mar 2010
Posts: 655
Location: Belarus
DimonSoft
I've used the function for a long time but recently I've noticed that there's additional information in TechHelp. Here's the link: DOS Fn 0aH: Buffered String Input (see "Notes" section). The F3 and F5 keys really work as documented but I couldn't find a way to make the function use the initial buffer contents as a "template".

Could anyone, please, give more information on what these templates are and what values should be put to the input buffer in order to make the use of "templates"?
Post 17 Mar 2014, 11:12
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
DimonSoft,

I've made some tests and it seems that template should have trailing CR (not accounted by the len field as specified). Quick look at $Std_Con_Input_String in MS-DOS 6.0 sources reveals that it indeed expects CR there.
Post 17 Mar 2014, 11:56
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 655
Location: Belarus
DimonSoft
baldr wrote:
DimonSoft,

I've made some tests and it seems that template should have trailing CR (not accounted by the len field as specified). Quick look at $Std_Con_Input_String in MS-DOS 6.0 sources reveals that it indeed expects CR there.


Could you, please, give more information? First of all, what does this template actually do and how can a user make the use of it? Pressing F3 doesn't seem to work. Maybe I'm initializing the buffer the wrong way.
Post 17 Mar 2014, 13:51
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
DimonSoft,

Examine the following debug session:
Code:
-a 100
1418:0100 mov   ah, 0A
1418:0102 mov   dx, 200
1418:0105 int   21
1418:0107 ret
1418:0108
-e 200 20 0D "Hello, world!" 0D
-g 107
Hello, world!@
Goodbye, world!
AX=0A0D  BX=0000  CX=0000  DX=0200  SP=FFEE  BP=0000  SI=0000  DI=0000
DS=1418  ES=1418  SS=1418  CS=1418  IP=0107   NV UP EI PL NZ NA PO NC
1418:0107 C3            RET
-d 200 221
1418:0200  20 0F 47 6F 6F 64 62 79-65 2C 20 77 6F 72 6C 64    .Goodbye, world
1418:0210  21 0D 00 00 00 00 00 00-00 00 00 00 00 00 00 00   !...............
1418:0220  00 00                                             ..
-    
In e 200… command the first 0D is the len field contents (number of characters in "Hello, world!" text), second one is the trailing CR.

After g 107 command I've pressed F3 then F5 to show template buffer and start over; then I've typed "Goodb" which will replace "Hello", switched to insert mode with Ins, typed "ye" and pressed F3 again to append the rest of the template (namely ", world!"); Enter finished the input.
Post 17 Mar 2014, 18:46
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 655
Location: Belarus
DimonSoft
baldr wrote:
DimonSoft,

Examine the following debug session:
Code:
-a 100
1418:0100 mov   ah, 0A
1418:0102 mov   dx, 200
1418:0105 int   21
1418:0107 ret
1418:0108
-e 200 20 0D "Hello, world!" 0D
-g 107
Hello, world!@
Goodbye, world!
AX=0A0D  BX=0000  CX=0000  DX=0200  SP=FFEE  BP=0000  SI=0000  DI=0000
DS=1418  ES=1418  SS=1418  CS=1418  IP=0107   NV UP EI PL NZ NA PO NC
1418:0107 C3            RET
-d 200 221
1418:0200  20 0F 47 6F 6F 64 62 79-65 2C 20 77 6F 72 6C 64    .Goodbye, world
1418:0210  21 0D 00 00 00 00 00 00-00 00 00 00 00 00 00 00   !...............
1418:0220  00 00                                             ..
-    
In e 200… command the first 0D is the len field contents (number of characters in "Hello, world!" text), second one is the trailing CR.

After g 107 command I've pressed F3 then F5 to show template buffer and start over; then I've typed "Goodb" which will replace "Hello", switched to insert mode with Ins, typed "ye" and pressed F3 again to append the rest of the template (namely ", world!"); Enter finished the input.


Thanks, that's a great example. Everything works fine and now I have more information to tell my students. Thanks again.
Post 18 Mar 2014, 07:42
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.