diff --git a/.gitignore b/.gitignore index 9e00c11..ee4c6c1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ rom **/.D* **/*.log **/*.cmd +**/*.exe +**/*.com **/*.lib **/.*.swp **/*.obj diff --git a/Makefile b/Makefile index 6c6cf46..af639c3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ AS=aztec34_as CC=aztec34_cc AR=aztec34_lib +MASM=pcdev_masm +LINK=pcdev_link +EXE2BIN=pcdev_exe2bin CFLAGS=-I. -B +0 -D__CPM86__ STRIP=aztec34_sqz LDFLAGS=-lc86 @@ -11,7 +14,7 @@ RASM86=pcdev_rasm86 TOOLS=rm.cmd more.cmd write.cmd dump.cmd mode.cmd ls.cmd \ cls.cmd pause.cmd reboot.cmd tod.cmd ver.cmd touch.cmd wc.cmd \ atinit.cmd attime.cmd ciotest.cmd ball.cmd getch.cmd printenv.cmd \ - mem.cmd + mem.cmd dosver.com EXTRAS=clsansi.cmd PCETOOLS=pce/pceexit.cmd pce/pcever.cmd pce/pcemnt.cmd pce/pcetime.cmd \ pce/pceinit.cmd @@ -101,6 +104,15 @@ mem.obj: mem.a86 tinylib.a86 atinit.obj: atinit.a86 baselib.a86 tinylib.a86 atclock.a86 +dosver.com: dosver.exe + $(EXE2BIN) dosver.exe dosver.com + +dosver.exe: dosver.obj + $(LINK) dosver \; + +dosver.obj: dosver.asm + $(MASM) dosver \; + %.cmd: %.obj $(LINK86) $* '[$$sz]' @@ -113,6 +125,7 @@ atinit.obj: atinit.a86 baselib.a86 tinylib.a86 atclock.a86 clean: $(RM) *.o *.h86 *.log *.sym *.prn *.lst *.obj $(TOOLS) util.lib + $(RM) dosver.exe $(RM) cpmtest.img ccpmtest.img dostest.img hack.img (cd pce;make clean) diff --git a/README.md b/README.md index 49b06d8..b6381a6 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ For the status, (\\s: space, \\\\: \\, \\u: upper, \\l: lower) - CLS: Clear screen (clsansi is a vt100/ansi version as opposed to vt52 for PC) - PAUSE: submit tool waiting for a keystroke - TOD: Replacement for CP/M-86 without the 78-99 year constraint and date/time validation including leap years. It does not fix the visual issue of the century hard coded to 19. Patches exist for that. It has exactly the same behaviour as the original CP/M-86 tod.cmd tool. (CP/M-86 1.1 for PC/XT only) -- VER: Displays the BDOS version +- VER: Displays the BDOS version (DOSVER.COM is provided to display MS-DOS Compatibility on PC-MODE compatible OSes) - MEM: Displays the available and system memory - BALL: A simple CGA demo (CP/M-86 1.1 for PC/XT, DOS Plus and CCP/M-86 or Concurrent DOS BDOS > 3.1) (take on https://www.z80cpu.eu/mirrors/klaw/bouncy.zip) - GETCH: A simple keyboard scanner diff --git a/dosver.asm b/dosver.asm new file mode 100644 index 0000000..76bbe21 --- /dev/null +++ b/dosver.asm @@ -0,0 +1,65 @@ + +program segment + assume cs:program, ds:program + org 100h +_start: + mov cx,0Ch + int 0E0h + push ax + lea dx,[_header] + mov ah, 09h + int 21h + pop ax + cmp al,41h + jb _print_v1 + mov ah, 30h + int 21h + push ax + xor ah,ah + call _print_dec + mov dl, '.' + mov ah, 02h + int 21h + pop ax + mov al,ah + xor ah,ah + call _print_dec + lea dx,[_nl] + mov ah, 09h + int 21h + jmp _exit +_print_v1: + lea dx,[_v1] + mov ah, 09h + int 21h +_exit: + int 20h +_print_dec: + mov cx,0 + mov dx,0 +_print_dec_loop: + cmp ax,0 + je _print_dec_1 + mov bx,10 + div bx + push dx + inc cx + xor dx,dx + jmp _print_dec_loop +_print_dec_1: + cmp cx,0 + je _print_dec_exit + pop dx + add dx,48 + mov ah,02h + int 21h + dec cx + jmp _print_dec_1 +_print_dec_exit: + ret + +_header db "MS-DOS Level $" +_v1 db "1.1" +_nl db 13, 10, "$" +program ends + end _start