hi all,
I'm totally new to assembler programming. I got interested in this, because of a bios setting called "Alarm Resume". The idea is that you can turn on your pc automatically at a specified time. (or only resume from standby, i'm not sure).. on this page I found a bios interrupt call, that would do the trick.
my question is: How do i call this interrupt on a Windows XP system?

I tried this in masm32:

.586
.MODEL flat, stdcall

OPTION CASEMAP:NONE ;Case sensitive

Include windows.inc
Include kernel32.inc
Include masm32.inc

IncludeLib kernel32.lib
IncludeLib masm32.lib

Main PROTO

.CODE
Start:
Invoke Main
Invoke ExitProcess,0

Main Proc
mov AX, 5311h
mov BX, 0000h
mov CL, 02h
mov CH, 00h
mov DL, 0bh
mov DH, 09h
mov SI, 0710h
int 15h
RET
Main EndP

End Start

It compiles and makes an .exe console application successfully.. but when i execute, the program crashes.
Any ideas why this could happpen?
(In the docs of int 15h it says:
Notes: This function is supported via the INT 15, 16-bit protected mode, and 32-bit protected mode interfaces )
Posted on 2003-07-16 06:48:44 by Bucky
Hello Bucky,

You can't execute that code under windows. Under 9x you write a vxd to do it. For windows xp use wdm (windows driver model) see the SDK.

best regards,

czDrillard
Posted on 2003-07-16 09:38:29 by czDrillard
In Windows 9X, all Windows applications run as a 16-bit DPMI client. This means that if you call DPMI from a 32-bit address or using a 32-bit stack, it will crash. You have to use a little backdoor. This is the correct way to do it in Win9x (in NASM):

EXTERN VxdCall0
IMPORT VxdCall0 kernel32 1
push ebx
push edi
mov bx,0x15
sub esp,52
mov edi,esp
xor eax,eax
mov word ,0x710 ; SI
mov word ,0 ; BX
mov word ,0x90b ; DX
mov word ,2 ; CX
mov word ,0x5311 ; AX
mov word ,ax ; Flags
push eax ; No parameters
push dword 0x300 ; Simulate real mode interrupt
push dword 0x2a0029 ; Call DPMI
call VxdCall0
add esp,52
pop edi
pop ebx

Under XP I'm not sure. You might be able to do it from a 16-bit program.
Posted on 2003-07-18 13:52:00 by Sephiroth3