page 60,132 name yyyymmdd title YYYYMMDD 1.5 Comment û Please report bugs and problems to: Roedy Green Canadian Mind Products #101 - 2536 Wark Street Victoria, BC Canada V8T 4G8 tel:(250) 361-9093 mailto:roedyg@mindprod.com http://mindprod.com YYYYMMDD.com Displays date in form YYYY-MM-DD without a CrLf You can put an optional separator on the command line. If you wanted ISO 8601:1988 international standard yyyy-mm-dd format, On the command line, or in a bat file type: YYYYMMDD - gives 2000-12-31 YYYYMMDD none gives 20001231 YYYYMMDD space gives 2000 12 31 YYYYMMDD . gives 2000.12.31 YYYYMMDD / gives 2000/12/31 YYYYMMDD gives 00-12-31 Version History: 1.0 2001-01-05 based on YYMMDD.asm 1.1 2001-01-05 add separator to command line. 1.2 2008-02-07 change name of disribution file 1.5 2009-03-13 add ANT build script. change default from / to . version numbers 1.3 1.4 skipped to bring in sync with YYMMDD. bundled with YYMMDD */ ;============================================================== ; R E G I S T E R C O N V E N T I O N S Subroutines may trash any registers they please except CS: DS: ES: SS: and of course the outputs. û ; end of comment ;============================================================== stack segment stack ; keep MS link happy by providing null stack stack ends ;============================================================== CODE segment PARA ; start off in code. ;============================================================== data segment word ; provide a separate DATA segment ; Even though it appears in the source ; before the code, it the COM file it ; will appear at the end. This is as dodge ; to avoid forward references that confuse ; MASM. Separator db '-','$' ; separator we use on date, - is is iso default ;"$$" means none. ; embedded but not displayed CopyrightMsg label byte db 13,10 db '°±²Û YYYYMMDD 1.5 Û²±°',13,10 db 'Copyright: (c) 2001-2017 Roedy Green, Canadian Mind Products',13,10 db '#101 - 2536 Wark Street, Victoria, BC Canada V8T 4G8',13,10 db 'tel:(250) 361-9093 mailto:roedyg@mindprod.com http://mindprod.com',13,10 db 'May be freely distributed and used for any purpose except military.',13,10 db '$' Data ends ;============================================================== com group code,data ; force data segment to go at the end assume CS:com,DS:com,ES:com,SS:com ; seg regs cover everything org 100H ; in Code segment ;============================================================== ; P R O C E D U R E S Main proc near ; see page 384 Ray Duncan's Advanced MS DOS call getSep ; decide on separator to display date with. mov ah,02ah ; get date DOS function int 21h ; year is returned in CX ; month is returned in DH ; Day is returned in DL mov ax,cx ; display year mov cx,4 ; 4 digits call SayNDigits call SaySep ; separate YYYY-MM sub ax,ax ; display month, 2 digits mov al,dh mov cx,2 call SayNDigits call SaySep ; separate MM-DD sub ax,ax mov al,dl ; display day of month, 2 digits mov cx,2 call SayNDigits mov ax, 4c00h ; ERRORLEVEL = 0 int 21h ; normal exit to dos Main endp ;============================================================== include ymdinc.asm ;============================================================== CODE ends ; end of code segment end Main