I'm writing a DOS program, and I need to know the largest file number that can be returned. i.e. the value of FILES= in config.sys. Without reading the CONFIG.SYS file or calling INT 21 OPEN until I get error 4, how can I determine what that value is?
Btw Google fails me, I've already tried that
Name:
Anonymous2006-09-22 11:12
Do it the traditional way: decide on your own limit and tell your users to make sure FILES is larger than that.
Hah.
Name:
Anonymous2006-09-22 13:48
>>1
A... DOS program? Anonymous is hardcore. Anyways, do as >>2, nobody ever cared and everybody assumed you'd have enough open files.
Seriously, OSes with open files limit lower than 2^32 are obnoxious and disgusting.
Name:
Anonymous2006-09-22 15:27
Thanks, I just picked 0x13 as the highest as I found that DOS programs only have 20 file handles in the table by default, unless they make a call to expand it (up to the value in FILES=).
It's a DOS TSR linked to a Windows VDD, the purpose of which is to take a printout intended for a dot matrix printer and print it using the windows API to the default laser printer, while also adding in an equivalent of the pre-printed stationary they use on the old printers. To do this I trap the open, write and close int21 calls to certain special filename patterns. The handle I use needs not to clash with the ones that DOS may return, which is why I was looking for a way to determine the highest valid one.
I haven't programmed DOS assembler for years (and never before for money!) so this is a quite a strange nostalgic experience.
Name:
Anonymous2006-09-23 1:31
Do a barrel.rol
Name:
Anonymous2006-09-23 3:59
tap z or r twice
Name:
Anonymous2006-09-23 4:30
>>4
Nice. Good job on doing something both interesting and oldskool!
What do you mean The REPL Anyways debuggers are awesome I have to answer correctly to the txt file say every hour or so I thought that Emacs is being rewritten in PERL 1.