32.bit com

From: rjb (nonesuch_at_here.com)
Date: 05/19/04


Date: Tue, 18 May 2004 22:00:19 +0000 (UTC)

I've downloaded a package called 32bit.com by Maxwell Sayles, which is a
startup program for running code under DPMI. Here are the first few
instructions:-

  ; resize our segment
  mov ah,4Ah
  mov bx,1687h ; number of para
  int 21h

  ; test for DPMI
  xchg ax,bx
  int 2Fh
  sub ax,bx ; performs installation check and test for 32-bit host
  jnb ErrorExit

  ; push DPMI mode-switch entry address for call
  push es
  push di

  ; set DPMI data switch area to immediately after our 64kb
  mov ax,ds
  add ax,1000h
  mov es,ax

  ; request 32-bit protected mode
  xchg ax,bx ; AX = 0x0001
  call d [esp] ; call DPMI mode-switch entry point

I understand the first three instructions. Bx will return with the size of
free memory available. At the start of the second sequence AX takes that
value and hands its own value (which is 4A08 when I stepped it in Debug) to
BX. Now I've looked up int 2F in Ralf Brown's list to see where this program
is going to jump to, and I'm absolutely lost. The several pages of
possibilities for int 2F gives me no clue where this program is going. Why
should AX be holding a block-size on entry to an interrupt, and how does
that qualify as an "installation check"? Can anyone help?

rjb



Relevant Pages

  • Re: 32.bit com
    ... I'll give my own version of DPMI mode switch. ... mov ax,sp; SS:SP end of loaded assembly program ... int 21h; perform resizing ... strore values as offset/segment (this is a real mode far call): ...
    (alt.lang.asm)
  • GVBE02: Code Addendum
    ... \ This is the DOS DPMI version of the compiler in Rick van Norman's ... vbeinfo-obj HeapAllot VBEInfo[] ... bx push \ save TOS ... bx dosmem_segment #) mov ...
    (comp.lang.forth)
  • Re: 32-bit version posted, demonstrates possible PMODE memory leak, was, gcc as a linker....
    ... I wrote it in assembly the way I would've for DJGPP C and DPMI. ... rm_EDI equ rm_call+00h ... mov esi,msg; set esi to msg ... set values in real mode call structure for DPMI simulate int ...
    (comp.os.msdos.djgpp)
  • Re: Vmode question
    ... > DPMI is just a standard approved a long time ago. ... > for DOS sessions when Windows is running. ... > mov ax, 1687h ... > int 2fh ...
    (alt.lang.asm)
  • Two Click disassembly/reassembly
    ... mov(99, ecx); ... push D$ecx*4+Data04005190 ... lea eax D$Data040021B0 ...
    (alt.lang.asm)