flat assembler
Message board for the users of flat assembler.
Index
> DOS > how to determine if .com runs under DOS |
Author |
|
revolution 23 Feb 2010, 08:23
Perhaps you can call a harmless int 0x21 function (like get_version) and see if you get a proper response.
|
|||
23 Feb 2010, 08:23 |
|
DOS386 23 Feb 2010, 08:35
revolution wrote: Perhaps you can call a harmless int 0x21 function (like get_version) and see if you get a proper response. Bad idea ... "get_version" usually returns garbage But you can peek the date http://www.ctyme.com/intr/rb-2686.htm after confirming that INT $21 target is non-ZERO. Also you can check other values inside the PSP. _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
23 Feb 2010, 08:35 |
|
revolution 23 Feb 2010, 08:43
DOS386 wrote: Bad idea ... "get_version" usually returns garbage |
|||
23 Feb 2010, 08:43 |
|
bitshifter 23 Feb 2010, 08:52
How about passing a special value in a register (from booter).
Use a register that DOS normally sets to zero, and make it nonzero. Now program can check for special value and determine who it is... |
|||
23 Feb 2010, 08:52 |
|
zhak 23 Feb 2010, 12:38
hm... interesting idea about setting a register. i.e. some magic number can be passed in ax, or in a pair of registers (ax:cx, for example) to double-check and exclude possible collisions
OFFTOPIC: DOS386's signature always makes me smile )) I'm a QA engineer and I hate high-level languages, so this "bug" is double-funny ) |
|||
23 Feb 2010, 12:38 |
|
nop 25 Feb 2010, 04:35
@zhak offtopic
hehe i hate hlls too and even 100kb is tiny by todays bloatware standards! maybe dos386 should change his sig to 1Mb or 10Mb or even 100Mb |
|||
25 Feb 2010, 04:35 |
|
zhak 25 Feb 2010, 10:50
yes, nobody takes care of software package size today. i laughed very loud some time ago when i loaded intel's web site and saw a banner stating that new Core processors are COMPATIBLE WITH VISTA!!! hahaha its now OS should be supported by hardware, not vice versa.
but, on the other hand, this possibly doesn't allow engineers to relax and they keep inventing more powerful hardware. anyway, sometimes i wish it were late 80's - early 90's when i write system code... things used to be a lot more easier that days ) |
|||
25 Feb 2010, 10:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.