Now that the list seems to be open again I will try to resend this for the THIRD time. My apologies if you get duplicates.
Iain Hibbert wrote: > > > Hello.com: > > sure, I am not sure how to use this debug but I made it up as I went > along, couple of reboots later and it does seem to work. I worked out > enough to disassemble the code and you load the address of the string > into one register, then load a number 9 into another then cause an > interrupt (21) to make it print (?) then another (20) to exit (?) > (I find this wasting of interrupt time to be very distasteful btw) > (small endian m/c is a bit funny too!). what is the 9 for? and the last > byte (24) ? I'm glad you figured out the operation of debug. It will be useful in the future for quick and dirty tests. <g> This is NOT indended as a putdown, just an honest observation: Anyone with enough patience to learn/tolerate the syntax can write a program without any idea what it is doing at either the OS or the machine level. That's bad IMO. Wasting of interrupt time ? That's what those functions are for - to be used. How the do you think "C" does it ? Exactly the same! It calls DOS. But it usually takes a couple of kilobytes detour on the way. :( The 09 is the DOS Int 21 function identifier. It tell DOS I want to print a "$" terminated string. (That's what the 24 is for) Yes, Int 20 is exit. What do you mean by "small endian m over c ? > so, write *that* program in C (I have no C compiler on this) and compile > it to the .o stage, then link it with no startup code or libraries and > tell us how big that program is, rather than the one you wrote that > looked similar but used high level libraries. Maybe you can do better > than 8k second time around :) *I* didn't do that, BORLAND DID. It was their demo. > btw I dont know the difference between a .com and a .exe program! The short answer is a .COM loads at a specific address determined by DOS and all references to both code and data are NORMALLY contained within the 64k bytes beginning 100h below the load point. All segment registers point to the same segment. A .COM is limited (usually) to 64kb max, but there are ways around this. An .EXE usually has its code and data spread all over the box. As far as I know, there is no total size limit. Suits "C" code. <g> - Clarence Verge -- - Help stamp out FATWARE. As a start visit: http://home.arachne.cz/ - The internet is infected - Windows is a VIRUS !! -- - Clarence Verge. -- Using Arachne 1.66 on DSL.
