flat assembler
Message board for the users of flat assembler.

Index > DOS > 0x100/100h/$100 dos com file tips and tricks, post your

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 12 Feb 2005, 13:06
Hi, im searching what there is in the first parameter of a dos com file, and i think there is more then me there search this, so please post yours answer of those things, like 0x82 is the command line arguments... Razz

_________________
LOOOL
Post 12 Feb 2005, 13:06
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 12 Feb 2005, 14:07
hy,
dos usually loads the com file to offset 256 of your segment,
that org 256 100h 0x100 is to align your code on that offset
Post 12 Feb 2005, 14:07
View user's profile Send private message Visit poster's website Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 12 Feb 2005, 14:44
i know there was 256(hidden console in windows - and com) but don't understand so much of what you say

_________________
LOOOL
Post 12 Feb 2005, 14:44
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 13 Feb 2005, 17:18
dos loads your com file to that address,
PSP is before it,
82h is command line parameters for example, its before your code, ds:82h so i guess you whould need a description of these addresses? Ralph Brown's interrupt list has some, if its not enough i could search my database for it if you'd like
Post 13 Feb 2005, 17:18
View user's profile Send private message Visit poster's website Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 13 Feb 2005, 18:18
... yes thanks...
Post 13 Feb 2005, 18:18
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 13 Feb 2005, 18:46
Post 13 Feb 2005, 18:46
View user's profile Send private message Visit poster's website Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 13 Feb 2005, 20:08
lol, when i was looking in there i didn't expect so many sites Very Happy thanks!
Post 13 Feb 2005, 20:08
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 14 Feb 2005, 01:06
you're welcome, hope you find what you were looking for
Post 14 Feb 2005, 01:06
View user's profile Send private message Visit poster's website Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog 15 Feb 2005, 00:28
I'll try the same explaination, maybe it will be graspable?
DOS command.com loads info about your .COM in the first
256 bytes then loads your .COM program.
Then, your .COM can access that info.
Assembly language programmers often use HEX address, & here is some.
MOV SI,80h ; command line input count address offset = 80h (DS=CS)
LODSB ;AL now holds the command line input count,
or ARGC which is ARGuement Count.
CS:81h = the space after the .COM's basename
and the command line input starts at CS:82h
which is usually 128 bytes long or so?
You can alter the data in the PSP such as command line input.
Adding a zero where the 13=cr is
will make an input file name an ASCIZ file name for loading the file
There is other stuff in the PSP too, such as DTA?
FIND FIRST & FIND NEXT file interrupts deliver the data to the PSP section at CS:158 decimal, or CS:0x9E
(unless DTA address is changed.)

Alot of memory is readable or writable
if GS=0
MOV AL,[GS:449h] ;get current video mode into AL from BIOS data
MOV EAX,[GS:0x046C] ;get tick counter = ticks since midnight
18 ticks per second (18.2 or something like that ? 18.2 hz)
So you can make a timer.

In the PSP you can jump to CS:0 to end the program.com
RET ; does the same thing since the return address of CS:0
is loaded on the stack at startup

You can move/copy the command line input to another memory
location and parse it. (check it for parameters or alter it.)

There is .COM PSP header address info available some where?
I might have it at/in:
http://bitdog.home.att.net/files/nasmenv.zip
http://bitdog.home.att.net/files/fasmenv.zip
named pspcom.txt in the HELP directory.

good luck......
Post 15 Feb 2005, 00:28
View user's profile Send private message Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 19 Feb 2005, 15:52
nice Bitdog, the zipped file, alot of learn Laughing

_________________
LOOOL
Post 19 Feb 2005, 15:52
View user's profile Send private message Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog 20 Feb 2005, 03:20
That should keep you buisy for a while, huh ????????
C:\fasm\inc16\
is full of simple includeable proc's to try/alter/use/abuse/etc
You might try making your own environment (like mine)
and use my stuff as a source. ie: look through my stuff &
when you find some proc that you can figgure out & use,
copy it to your own \INCLUDE\ directory/environment.
That way your env is not full of my useless junk.

The Fasmenv.zip is an old version.
Sorry I didn't get a new version out this winter Sad
Post 20 Feb 2005, 03:20
View user's profile Send private message Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 20 Feb 2005, 19:33
doesn't matter, good to learn of.. .Many interrupts Very Happy

_________________
LOOOL
Post 20 Feb 2005, 19:33
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 21 Feb 2005, 00:35
gumletis: you would be fool to learn many interrupts. you will learn the often-used ones anyway just by coding, and you don't need to remember other ones, that's just waste of your memory-space. You need to learn how to find out them.
Post 21 Feb 2005, 00:35
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 21 Feb 2005, 10:54
hmm, i've also, i know if i shall program a program that open and write or write, its some with 3D to 42 i need... Razz so its just from there i do it... or that not what you mean?
Post 21 Feb 2005, 10:54
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 03 Mar 2005, 16:03
hello
here you are, i have found the memory list while seperating 5GB data on my disk


Description: Memory list, in zip, useful memory addresses in PC
Download
Filename: MEMORY.ZIP
Filesize: 32.99 KB
Downloaded: 448 Time(s)



Last edited by Matrix on 04 Mar 2005, 03:04; edited 1 time in total
Post 03 Mar 2005, 16:03
View user's profile Send private message Visit poster's website Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 03 Mar 2005, 17:18
Thanks, can you please recompress it to zip? :p lol i know i only have zip decompressor

_________________
LOOOL
Post 03 Mar 2005, 17:18
View user's profile Send private message Reply with quote
liteonish



Joined: 24 Feb 2005
Posts: 26
liteonish 03 Mar 2005, 20:15
http://www.rarlabs.com/

WinRAR > WinZIP

_________________
I just own that much.
Post 03 Mar 2005, 20:15
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 04 Mar 2005, 03:19
Bitdog wrote:
I'll try the same explaination, maybe it will be graspable?
MOV AL,[GS:449h] ;get current video mode into AL from BIOS data
MOV EAX,[GS:0x046C] ;get tick counter = ticks since midnight
18 ticks per second (18.2 or something like that ? 18.2 hz)
So you can make a timer.



actually PIT is running at $1234DD Hz and you set the divisor for timer 1, and timer 2, 2 byte divisor latch gives you a maximum divisor of 2^16 = 65536, you divide $1234DD by 2^16 and get the divided frequency about = 18,2064971923828125 Hz
you can use PIT for timing without reprogramming it, the way i mentioned before in other threads, like that simple PC speaker sound player i wrote, and the PIT delay it is using.
it is a fairly accurate way of timing because PC has a quartz oscillator running at 14318172 Hz, (14.318172 MHz), which is divided by 12 to get $1234DD Hz = 1193181 Hz (1.193181 MHz)

Code:
oszcillátorok frekvenciái:
 f_decimál  f_hexa
  1 193 181 Hz  01234DDh PC PIT (Programmable Interval Timer) OPCC / 4
  4 772 724 Hz  048D374h OPCC (Original PC' s cpu clock )
 14 318 172 Hz  0DA7A5Ch PIT x 12 (PIT Quartz)
    115 200 Hz   01C200h BMAX (standard RS232 maximum baud rate) SSC / 16
  1 843 200 Hz  01C2000h SSC (standard serial clock) SSQ / 6
 11 059 200 Hz  0A8C000h SSQ (standard serial quartz)



Values for serial port divisor latch registers:
 Some baudrates (using standard 1.8432 Mhz clock mj.:11.0592 MHz/6):
       baudrate         divisor        DLM  DLL
      12.5   9216           24h  00h
      25     4608           12h  00h
      50     2304           09h  00h
      75     1536           06h  00h
     110     1047           04h  17h
     134,5    857           03h  59h
     150      768           03h  00h
     300      384           01h  80h
     551.2    209           00h  D1h
     600      192           00h  C0h
    1200       96           00h  60h
    1800       64           00h  40h
    2000       58           00h  3Ah
    2400       48           00h  30h
    3600       32           00h  20h
    4800       24           00h  18h
    7200       16           00h  10h
    9600       12           00h  0Ch
   19200        6           00h  06h
   38400        3           00h  03h
   57600        2           00h  02h
  115200        1           00h  01h  SSQ/96 = SSQ/6/16 = SSC/16
    
Post 04 Mar 2005, 03:19
View user's profile Send private message Visit poster's website Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog 21 Apr 2005, 06:51
In Bitdog's fasmenv.zip there are file open, read, write, etc macro's in:
C:\FASM\INC16\
look for fopen.mac fread.mac fclose.mac etc
they start with F for File
(in previous post, you wanted file int stuff ?)
Post 21 Apr 2005, 06:51
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1390
Location: Piraeus, Greece
Picnic 09 Sep 2007, 18:42
Bitdog wrote:

The Fasmenv.zip is an old version.
Sorry I didn't get a new version out this winter Sad

Still is very useful Bitdog, a small treasure for Dos.
I discover it yersteday.

Bitdog wrote:
full of simple includeable proc's to try/alter/use/abuse/etc

very nice of you Smile

_________________
Hobby BASIC Interpreter
Post 09 Sep 2007, 18: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:  
Goto page 1, 2  Next

< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.