flat assembler
Message board for the users of flat assembler.
Index
> DOS > MEMID 0.5 -- detect DPMI, VCPI, EMS, XMS and their versions |
Author |
|
rugxulo 17 Jul 2007, 19:27
EDIT: This current version (0.5) does not have the older bug mentioned later in the thread.
Code: ; MEMID5.ASM -- rugxulo AT gmail DOT com ; public domain ("nenies proprajxo") ; ; Check out FASM: http://board.flatassembler.net org 100h BREAK equ int3 ;SPLIT equ aam macro SPLIT { mov cl,4 shl ax,cl shr al,cl } macro UPPERCASE b { cmp b,'a' jb @f cmp b,'z' ja @f and b,0DFh @@: } macro ERR a { cmp byte [opt],a jnz @f mov word [error],bp @@: } macro HELP { mov dx,help_msg call puts mov byte [error],255 } CR=13 LF=10 TAB=9 Opts: mov si,80h mov cl,byte[si] xor ch,ch jcxz is286 @@: inc si cmp byte [si],20h loope @b @@: cmp byte [si],'/' jnz @f inc si jmp @b @@: UPPERCASE byte [si] push ax mov al,byte [si] mov byte [opt],al pop ax cmp byte [si],'?' jnz @f mov byte [si],'H' @@: cmp byte [si],'H' jnz @f HELP jmp Fino @@: is286: mov ax,sp cmp ax,sp jnz VCPI PMODE: smsw ax test al,1 jz DPMI mov dx,pmode_msg call puts mov bp,1 ERR 'P' DPMI: mov ax,1687h int 2Fh test ax,ax jnz VCPI mov bp,dx cmp bp,100h jnz @f mov bp,100 @@: push dx dx mov dx,dpmi_msg call puts pop ax xor ah,ah aam xchg ah,al pop bx xor bl,bl or ax,bx call ver ERR 'D' VCPI: mov ax,3567h int 21h mov ax,es test ax,ax jnz @f test bx,bx jz EMM386 @@: mov ax,0DE00h int 67h test ax,ax jnz EMM386 mov dx,vcpi_msg call puts xchg ax,bx call adjust call ver ERR 'V' EMM386: mov ax,3D00h mov dx,emm386_id int 21h jc XMS xchg ax,bx mov ax,4400h int 21h jc XMS test dx,80h jz XMS EMS: mov ah,40h int 67h test ah,ah jnz XMS mov dx,emm386_msg call puts mov ah,46h int 67h SPLIT call adjust call ver ERR 'E' XMS: mov ax,4300h int 2Fh cmp al,80h jnz crlf mov dx,xms_msg call puts mov ax,4310h int 2Fh mov word [xms_addr],bx mov word [xms_addr+2],es xor ah,ah call dword [xms_addr] call adjust call ver ERR 'X' crlf: mov dl,13 call putc mov dl,10 call puts2 Fino: mov ah,4Ch mov al,byte [error] int 21h puts: mov ah,9 puts2: int 21h ret putc: mov ah,2 jmp puts2 ver: xchg dx,ax or dx,'00' xchg dh,dl call putc mov dl,'.' call putc xchg dh,dl call putc mov dl,' ' call putc ret adjust: push ax aad mov bp,ax pop ax ret error dw 4C00h help_msg db CR,LF,'MEMID 0.5 -- returns errorlevel',CR,LF,CR,LF db '/h',TAB,'help', TAB,'255', CR,LF db '/p',TAB,'Pmode?',TAB,'0 | 1', CR,LF db '/d',TAB,'DPMI?', TAB,'90 | 100',CR,LF db '/v',TAB,'VCPI?', TAB,'10 | ??', CR,LF db '/e',TAB,'EMS?', TAB,'32 | 40', CR,LF db '/x',TAB,'XMS?', TAB,'20 | 30', CR,LF,'$' pmode_msg db 'PMODE $' dpmi_msg db 'DPMI $' vcpi_msg db 'VCPI $' emm386_id db 'EMMXXXX0',0 emm386_msg db 'EMS $' xms_msg db 'XMS $' xms_addr rb 4 opt rb 1 ; EOF DOSBox 0.70 wrote:
WinXP wrote:
Get the API specs for these interfaces (in plain text) from here: http://ftp.lanet.lv/ftp/mirror/x2ftp/msdos/programming/specs/00index.html
Last edited by rugxulo on 23 Apr 2008, 20:28; edited 2 times in total |
|||||||||||
17 Jul 2007, 19:27 |
|
Picnic 18 Jul 2007, 14:29
It's nice rugxulo, thanks
|
|||
18 Jul 2007, 14:29 |
|
DOS386 22 Jul 2007, 22:40
DOS wrote:
Quote: Voila ^^^ I had a similar thing on other forum ... before it all got kicked |
|||
22 Jul 2007, 22:40 |
|
MHajduk 23 Jul 2007, 08:03
rugxulo wrote: ; public domain, free for any use ("nenies proprajxo") |
|||
23 Jul 2007, 08:03 |
|
Japheth 23 Jul 2007, 14:07
Good! There is a small inconsistency in there, however: if EMS is OFF (no EMMXXXX0 device exists). VCPI can still be enabled.
|
|||
23 Jul 2007, 14:07 |
|
rugxulo 25 Jul 2007, 03:10
MHajduk wrote:
Jes (malgraux mia malofta uzo). Cxu ankaux vi scipovas gxin cxu nur vi konas gxin pro la pola doktoro kiu kreis gxin? |
|||
25 Jul 2007, 03:10 |
|
MHajduk 25 Jul 2007, 07:54
ruĝulo
rugxulo wrote: Jes (malgraux mia malofta uzo). Cxu ankaux vi scipovas gxin cxu nur vi konas gxin pro la pola doktoro kiu kreis gxin? BTW. ruĝulo, are you red-haired (ginger)? |
|||
25 Jul 2007, 07:54 |
|
rugxulo 26 Jul 2007, 21:32
|
|||
26 Jul 2007, 21:32 |
|
Japheth 27 Jul 2007, 05:59
rugxulo wrote:
It's very simple, just use the NOEMS option. It this option would also disable VCPI, no protected-mode program can be executed then. |
|||
27 Jul 2007, 05:59 |
|
rugxulo 31 Jul 2007, 02:02
Updated / hopefully fixed this. (Seems like VCPI.DOC is wrong, oh well.)
Japheth, I now see that this is similar to your own \TEST\DPMI.EXE from HXRT.ZIP (but yours provides more info, of course). Hopefully mine is also correct now. |
|||
31 Jul 2007, 02:02 |
|
DOS386 04 Sep 2007, 20:40
Japheth wrote:
> There is a small inconsistency in there, however: if EMS is OFF (no EMMXXXX0 device exists But it "works" for me (some JEMM versions at least) Nevertheless, fixed and improved: Download now : http://board.flatassembler.net/download.php?id=3252 (2 KiB) |
|||
04 Sep 2007, 20:40 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.