source: xtideuniversalbios/trunk/Assembly_Library/Src/Util/Reboot.asm @ 245

Last change on this file since 245 was 245, checked in by aitotat@…, 12 years ago

Changes to Assembly Library:

  • Added functions to reboot computer.
  • Added JMP_DELAY macro.
File size: 1.3 KB
Line 
1; Project name  :   Assembly Library
2; Description   :   Functions for rebooting computer.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; Reboot_ComputerWithBootFlagInAX
9;   Parameters:
10;       AX:     Boot Flag
11;   Returns:
12;       Nothing, function never returns
13;--------------------------------------------------------------------
14Reboot_ComputerWithBootFlagInAX:
15    LOAD_BDA_SEGMENT_TO dx, bx
16    mov     [BDA.wBoot], ax         ; Store boot flag
17    ; Fall to Reboot_AT
18
19
20;--------------------------------------------------------------------
21; Reboot_AT
22;   Parameters:
23;       Nothing
24;   Returns:
25;       Nothing, function never returns
26;--------------------------------------------------------------------
27Reboot_AT:
28    mov     al, 0FEh                ; System reset (AT+ keyboard controller)
29    out     64h, al                 ; Reset computer (AT+)
30    mov     al, 10
31    call    Delay_MicrosecondsFromAX
32    ; Fall to Reboot_XT
33
34
35;--------------------------------------------------------------------
36; Reboot_XT
37;   Parameters:
38;       Nothing
39;   Returns:
40;       Nothing, function never returns
41;--------------------------------------------------------------------
42Reboot_XT:
43    xor     ax, ax
44    push    ax
45    popf                            ; Clear FLAGS (disables interrupt)
46    mov     ds, ax
47    mov     es, ax
48    mov     ss, ax
49    jmp     WORD 0FFFFh:0h          ; XT reset
Note: See TracBrowser for help on using the repository browser.