Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 21R CX
8
W
QCopy and paste the above in a file called weekday.scr
Then the command to compile (lol) is
debug < weekday.scrhttp://computing.net/dos/wwwboard/forum/4900.html

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 programR CX - edit register CX
8 - set 8 bytes to write
W - write program from memory to file
Q - quitany questions?

DOS function 2Ah = GET DATE
AL=Day of week
CX=Year
DH=Month
DL=DayDOS 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.

![]() |
dir>list.txt with long fi...
|
Globally change password ...
|

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