Computing.Net > Forums > Disk Operating System > COM file for date extraction

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

COM file for date extraction

Reply to Message Icon

Name: Sir_roman
Date: October 31, 2003 at 06:33:48 Pacific
OS: Win2K SP3
CPU/Ram: 866/1 Gig
Comment:

I was attempting to truncate the day from the DATE /T in shell or some derivative. I stumbled across the posting below and got it to work the way I want. However, I don't immediately understand the entries in the script that subsequently became the COM file. Can anyone shed some light on it.


Hi,
Below is the code to make a small com file that will get the day of the week. (using debug)
N WEEKDAY.COM
A 100
MOV AH, 2A
INT 21
MOV AH, 4C
INT 21

R CX
8
W
Q

Copy and paste the above in a file called weekday.scr

Then the command to compile (lol) is
debug < weekday.scr

http://computing.net/dos/wwwboard/forum/4900.html



Sponsored Link
Ads by Google

Response Number 1
Name: bitbyte
Date: October 31, 2003 at 07:09:44 Pacific
Reply:


N WEEKDAY.COM - N... name of file to create
A 100 - A... adresss for assemblercode (.com files start always at 100h)
MOV AH, 2A - set dos function
INT 21 - run dos function (interrupt)
MOV AH, 4C - set dos function to end program with errorlevel
INT 21 - end the program

R CX - edit register CX
8 - set 8 bytes to write
W - write program from memory to file
Q - quit

any questions?


0

Response Number 2
Name: JackG
Date: October 31, 2003 at 10:43:33 Pacific
Reply:

DOS function 2Ah = GET DATE

AL=Day of week
CX=Year
DH=Month
DL=Day

DOS function 4Ch = Terminate a Process (EXIT)

Where Environment variable ERRORLEVEL set to AL


Clear as mud. The current day of week is moved into the variable ERRORLEVEL as the programs EXIT code.



0

Response Number 3
Name: Roman
Date: November 10, 2003 at 10:42:32 Pacific
Reply:

Thanks for the response Jack. Yep, clear as mud in the Mississippi. No, actually it tells me a lot.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


dir>list.txt with long fi... Globally change password ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: COM file for date extraction

DOS files for self extracting/zip files www.computing.net/answers/dos/dos-files-for-self-extractingzip-files/3795.html

norton ghost file for dos www.computing.net/answers/dos/norton-ghost-file-for-dos/9195.html

Mouse.Com File www.computing.net/answers/dos/mousecom-file-/8230.html