Hi,

I have some questions and I need some advice. For all questions the term Pmode refers to Tran's Pmode 2.51. I am converting ms-dos app.

1. If I am going to convert ms-dos code
like the one below to Pmode does the
conversion I made look ok?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Clear input buffer addressed by DI,
;length CX, no registers affected
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
clear macro ;
push ax ;
push cx ;
push di ;
mov al,32 ;
push es ;
push ds ;
pop es ;
rep stosb ;
pop es ;
pop di ;
pop cx ;
mov ax,920h ;Write character and attribute at cursor position
push bx ;AL = character to display
mov bx,14 ;BL = attribute
int 10h ;CX = number of times to write character
pop bx ;
pop ax ;
endm ;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Pmode conversion:
;Clear input buffer addressed by EDI,
;length CX, no registers affected
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
clear macro ;
push eax ;
push ecx ;
push edi ;
mov al,32 ;
push es ;
push ds ;
pop es ;
rep stosb ;
pop es ;
pop edi ;
pop ecx ;
mov v86r_cx,cx ;Write character and attribute at cursor position
mov v86r_ax,920h ;AL = character to display
mov v86r_bx,14 ;BL = attribute
mov al,10h ;CX = number of times to write character
int 33h ;
pop eax ;
endm ;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



2. I need some advise on setting up interrupts
and using them in Pmode.

From the Example3.asm from Pmode I see how
to set up a protected mode handler and the
real mode callback, but I need to know how
to pass the irq to ms-dos from my protected
mode irq handler if I need to. Like the
ms-dos code below would do?


PC_CLOCK: ;
DB 0EAH ;Go to PC clock interrupt handler
CLK_LOW DW 0 ;FAR Jump to Dos Timer
CLK_HI DW 0 ;


3. Will the completed app run better then the
real mode version using Pmode inside of
Windows XP? It already runs ok in
Windows 9x and Me, but there is
no room for growth because
it uses segments.

Thanks for any help and or pointers.

JohnU789
Posted on 2004-11-10 12:22:12 by JohnU789
What does int 33h do?
Posted on 2004-11-10 20:43:40 by roticv
An INT 33h in protected mode will call a real mode interrupt handler. AL is
the interrupt number you want to call. The interrupt flag is disabled for the
real mode interrupt handler just as it is in real mode. Other than this, INT
33h works just like INT 32h with respect to virtual registers and the real
flags passed back from the handler.
Posted on 2004-11-10 21:20:23 by JohnU789
Since you are just writing to the screen, why don't you write directly to 0b8000h? Isn't it easier that way?
Posted on 2004-11-10 22:21:25 by roticv
No because it would break the app I want to convert into using Pmode.
If I can convert succesfully I can try out my ideas for the app without
waiting for a complete rewrite into say C++ and DirectX or something.
Posted on 2004-11-10 22:27:52 by JohnU789