#ifndef __APM__
#define __APM__
word APM_PowerOff(){
asm proc c;
asm mov ax,5301h; /*Do a real mode connection*/
asm mov bx,0; /*device = BIOS*/
asm int 15h;
asm jc error;
asm mov ax,5300h;
asm xor bx,bx;
asm int 15h;
asm mov cx, ax;
asm mov ax,530eh; /*Enable latest version of APM*/
asm mov bx,0; /*device = BIOS*/
asm int 15h;
asm jc error;
asm mov ax,530dh; /*Now engage and enable CPU management*/
asm mov bx,1; /*device = all*/
asm mov cx,1; /*enable*/
asm int 15h;
asm jc error;
asm mov ax,530fh;
asm mov bx,1; /*device = ALL*/
asm mov cx,1; /*enable*/
asm int 15h;
asm jc error;
asm mov ax,5307h; /*Do the power down*/
asm mov bx,1; /*device = ALL*/
asm mov cx,3; /*mode = OFF*/
asm int 15h; /*shutdown CPU*/
error: asm mov ax, 0FFFFh;
asm ret;
asm endp;
}
#endif
potrebujem pomoct s touto funkciou. Je to funkcia na vypnutie PC v mojom vlastnom operacnom systeme. Ked to dam do emulatora (vyrtualny PC) tak to ide v pohode a PC sa vypne ale na fyzickom (skutocnom) PC to nic nespravi ako je to mozne???