]> wirehaze git hosting - BOS.git/blobdiff - kernel/int/debug.asm

wirehaze git hosting

new indentation style
[BOS.git] / kernel / int / debug.asm
index ae2d6fe69f06676f5cdfd2d9e39fb553642872f7..19620642f0343b9ce7ec0415ba5bf5c617c54063 100755 (executable)
 ;----------------;\r
 ;   variables    ;\r
 ;----------------;\r
 ;----------------;\r
 ;   variables    ;\r
 ;----------------;\r
-         dbg_head        db   'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»',0\r
-         dbg_head2       db   'º BOS 0.05 - ERROR: ',0\r
-         dbg_head3       db   'º                                  º',0\r
-         dbg_press       db   'º  Press any key to continue...    º',0\r
-         dbg_restart     db   'º Press a key to restart the PC... º',0\r
-         dbg_footer      db   'ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ',0\r
-         dbg_close_row   db   ' º',0\r
-         dbg_keypress    db   1                      ; 0 = restart,  1 = wait for key\r
-         dbg_error       db   ' none.        ',0     ; error msg to show, max 14 chars\r
+    dbg_head      db   'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»',0\r
+    dbg_head2     db   'º BOS 0.05 - ERROR: ',0\r
+    dbg_head3     db   'º                                  º',0\r
+    dbg_press     db   'º  Press any key to continue...    º',0\r
+    dbg_restart   db   'º Press a key to restart the PC... º',0\r
+    dbg_footer    db   'ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ',0\r
+    dbg_close_row db   ' º',0\r
+    dbg_keypress  db   1                              ; 0 = restart,  1 = wait for key\r
+    dbg_error     db   ' none.        ',0             ; error msg to show, max 14 chars\r
 \r
 \r
-     ;--------------------------------------;\r
-     ;  I'll start with the common regs..   ;\r
-     ;--------------------------------------;\r
-         debug_eax       db   'º EAX: 0x', 0\r
-         debug_ebx       db   '  EBX: 0x', 0\r
-         debug_ecx       db   'º ECX: 0x', 0\r
-         debug_edx       db   '  EDX: 0x', 0\r
-         debug_esp       db   'º ESP: 0x', 0\r
-         debug_ebp       db   '  EBP: 0x', 0\r
-         debug_esi       db   'º ESI: 0x', 0\r
-         debug_edi       db   '  EDI: 0x', 0\r
+    ;--------------------------------------;\r
+    ;  I'll start with the common regs..   ;\r
+    ;--------------------------------------;\r
+    debug_eax     db   'º EAX: 0x', 0\r
+    debug_ebx     db   '  EBX: 0x', 0\r
+    debug_ecx     db   'º ECX: 0x', 0\r
+    debug_edx     db   '  EDX: 0x', 0\r
+    debug_esp     db   'º ESP: 0x', 0\r
+    debug_ebp     db   '  EBP: 0x', 0\r
+    debug_esi     db   'º ESI: 0x', 0\r
+    debug_edi     db   '  EDI: 0x', 0\r
 \r
 \r
-     ;-------------------;\r
-     ;  state to print   ;\r
-     ;-------------------;\r
-         state_eax       dd   0\r
-         state_ebx       dd   0\r
-         state_ecx       dd   0\r
-         state_edx       dd   0\r
-         state_esp       dd   0\r
-         state_ebp       dd   0\r
-         state_esi       dd   0\r
-         state_edi       dd   0\r
+    ;-------------------;\r
+    ;  state to print   ;\r
+    ;-------------------;\r
+    state_eax     dd   0\r
+    state_ebx     dd   0\r
+    state_ecx     dd   0\r
+    state_edx     dd   0\r
+    state_esp     dd   0\r
+    state_ebp     dd   0\r
+    state_esi     dd   0\r
+    state_edi     dd   0\r
 \r
 \r
-     ;-----------------------------------;\r
-     ;  "fake stack" to save regs on..   ;\r
-     ;-----------------------------------;\r
-         stack_eax       dd   0\r
-         stack_eax2      dd   0\r
-         stack_ebx       dd   0\r
-         stack_edx       dd   0\r
+    ;-----------------------------------;\r
+    ;  "fake stack" to save regs on..   ;\r
+    ;-----------------------------------;\r
+    stack_eax     dd   0\r
+    stack_eax2    dd   0\r
+    stack_ebx     dd   0\r
+    stack_edx     dd   0\r
 \r
     ;-------------------------------;\r
     ;  original cursor placment..   ;\r
     ;-------------------------------;\r
 \r
     ;-------------------------------;\r
     ;  original cursor placment..   ;\r
     ;-------------------------------;\r
-         state_cursor    dw   0\r
+    state_cursor  dw   0\r
 \r
     ;-------------------------------------------------;\r
     ;  mostly in debug purpose, and in lack of MM..   ;\r
     ;-------------------------------------------------;\r
 \r
     ;-------------------------------------------------;\r
     ;  mostly in debug purpose, and in lack of MM..   ;\r
     ;-------------------------------------------------;\r
-    scr_buffer: times 180 dd   0                     ; 720 = box buffer size (char+attrib)\r
+    scr_buffer: times 180 dd   0                      ; 720 = box buffer size (char+attrib)\r
 \r
 \r
 ;--------------------------------------------;\r
 ;   dump regs..  does not use the stack.     ;\r
 ;--------------------------------------------;\r
 dump_regs:\r
 \r
 \r
 ;--------------------------------------------;\r
 ;   dump regs..  does not use the stack.     ;\r
 ;--------------------------------------------;\r
 dump_regs:\r
-         mov     [state_eax], eax\r
-         mov     [state_ebx], ebx\r
-         mov     [state_ecx], ecx\r
-         mov     [state_edx], edx\r
-         mov     [state_esp], esp\r
-         mov     [state_ebp], ebp\r
-         mov     [state_esi], esi\r
-         mov     [state_edi], edi\r
+        mov    [state_eax], eax\r
+        mov    [state_ebx], ebx\r
+        mov    [state_ecx], ecx\r
+        mov    [state_edx], edx\r
+        mov    [state_esp], esp\r
+        mov    [state_ebp], ebp\r
+        mov    [state_esi], esi\r
+        mov    [state_edi], edi\r
 \r
 \r
-         call    .get_cur\r
-         mov     [state_cursor], bx\r
+        call   .get_cur\r
+        mov    [state_cursor], bx\r
 \r
 \r
-         mov     dx, 0                               ; row counter\r
-         mov     esi, (0xB8000+840)\r
-         mov     edi, scr_buffer\r
-     .big_loop:\r
-         mov     cx, 0                               ; col counter\r
-     .small_loop:\r
-         movsb                                       ; copy creen content\r
-         inc     cx                                  ; increase counter\r
-         cmp     cx, 72                              ; have we copied 72 bytes?\r
-         je      .end_small                          ; if we have, end small loop\r
-         jmp     .small_loop                         ; if not continue with next byte\r
-     .end_small:\r
-         inc     dx                                  ; increase row count\r
-         cmp     dx, 10                              ; check if all ten is copied\r
-         je      .end_big                            ; if it is, end.\r
-         add     esi, 88                             ; else continue with next row\r
-         jmp     .big_loop\r
+        mov    dx, 0                                  ; row counter\r
+        mov    esi, (0xB8000+840)\r
+        mov    edi, scr_buffer\r
+    .big_loop:\r
+        mov    cx, 0                                  ; col counter\r
+    .small_loop:\r
+        movsb                                         ; copy creen content\r
+        inc    cx                                     ; increase counter\r
+        cmp    cx, 72                                 ; have we copied 72 bytes?\r
+        je     .end_small                             ; if we have, end small loop\r
+        jmp    .small_loop                            ; if not continue with next byte\r
+    .end_small:\r
+        inc    dx                                     ; increase row count\r
+        cmp    dx, 10                                 ; check if all ten is copied\r
+        je     .end_big                               ; if it is, end.\r
+        add    esi, 88                                ; else continue with next row\r
+        jmp    .big_loop\r
      .end_big:\r
 \r
      .end_big:\r
 \r
-         mov     bx, 420                             ; row 5 char 20\r
-         call    .set_cur\r
-         mov     ebp, dbg_head\r
-         call    .print\r
-         mov     bx, 500                             ; row 6 char 20\r
-         call    .set_cur\r
-         mov     ebp, dbg_head2\r
-         call    .print\r
-         mov     ebp, dbg_error\r
-         call    .print\r
-         mov     ebp, dbg_close_row\r
-         call    .print\r
-         mov     bx, 580                             ; row 7 char 20\r
-         call    .set_cur\r
-         mov     ebp, dbg_head3\r
-         call    .print\r
+        mov    bx, 420                                ; row 5 char 20\r
+        call   .set_cur\r
+        mov    ebp, dbg_head\r
+        call   .print\r
+        mov    bx, 500                                ; row 6 char 20\r
+        call   .set_cur\r
+        mov    ebp, dbg_head2\r
+        call   .print\r
+        mov    ebp, dbg_error\r
+        call   .print\r
+        mov    ebp, dbg_close_row\r
+        call   .print\r
+        mov    bx, 580                                ; row 7 char 20\r
+        call   .set_cur\r
+        mov    ebp, dbg_head3\r
+        call   .print\r
 \r
 \r
 \r
 \r
-         mov     bx, 660                             ; row 8 char 20\r
-         call    .set_cur\r
-         mov     ebp, debug_eax\r
-         call    .print\r
-         mov     eax, [state_eax]                    ; eax\r
-         call    .print_hex32\r
-         mov     ebp, debug_ebx\r
-         call    .print\r
-         mov     eax, [state_ebx]                    ; ebx\r
-         call    .print_hex32\r
-         mov     ebp, dbg_close_row\r
-         call    .print\r
+        mov    bx, 660                                ; row 8 char 20\r
+        call   .set_cur\r
+        mov    ebp, debug_eax\r
+        call   .print\r
+        mov    eax, [state_eax]                       ; eax\r
+        call   .print_hex32\r
+        mov    ebp, debug_ebx\r
+        call   .print\r
+        mov    eax, [state_ebx]                       ; ebx\r
+        call   .print_hex32\r
+        mov    ebp, dbg_close_row\r
+        call   .print\r
 \r
 \r
-         mov     bx, 740                             ; row 9 char 20\r
-         call    .set_cur\r
-         mov     ebp, debug_ecx\r
-         call    .print\r
-         mov     eax, [state_ecx]                    ; ecx\r
-         call    .print_hex32\r
-         mov     ebp, debug_edx\r
-         call    .print\r
-         mov     eax, [state_edx]                    ; edx\r
-         call    .print_hex32\r
-         mov     ebp, dbg_close_row\r
-         call    .print\r
+        mov    bx, 740                                ; row 9 char 20\r
+        call   .set_cur\r
+        mov    ebp, debug_ecx\r
+        call   .print\r
+        mov    eax, [state_ecx]                       ; ecx\r
+        call   .print_hex32\r
+        mov    ebp, debug_edx\r
+        call   .print\r
+        mov    eax, [state_edx]                       ; edx\r
+        call   .print_hex32\r
+        mov    ebp, dbg_close_row\r
+        call   .print\r
 \r
 \r
-         mov     bx, 820                             ; row 10 char 20\r
-         call    .set_cur\r
-         mov     ebp, debug_esp\r
-         call    .print\r
-         mov     eax, [state_esp]                    ; esp\r
-         call    .print_hex32\r
-         mov     ebp, debug_ebp\r
-         call    .print\r
-         mov     eax, [state_ebp]                    ; ebp\r
-         call    .print_hex32\r
-         mov     ebp, dbg_close_row\r
-         call    .print\r
+        mov    bx, 820                                ; row 10 char 20\r
+        call   .set_cur\r
+        mov    ebp, debug_esp\r
+        call   .print\r
+        mov    eax, [state_esp]                       ; esp\r
+        call   .print_hex32\r
+        mov    ebp, debug_ebp\r
+        call   .print\r
+        mov    eax, [state_ebp]                       ; ebp\r
+        call   .print_hex32\r
+        mov    ebp, dbg_close_row\r
+        call   .print\r
 \r
 \r
-         mov     bx, 900                             ; row 11 char 20\r
-         call    .set_cur\r
-         mov     ebp, debug_esi\r
-         call    .print\r
-         mov     eax, [state_esi]                    ; esi\r
-         call    .print_hex32\r
-         mov     ebp, debug_edi\r
-         call    .print\r
-         mov     eax, [state_edi]                    ; edi\r
-         call    .print_hex32\r
-         mov     ebp, dbg_close_row\r
-         call    .print\r
+        mov    bx, 900                                ; row 11 char 20\r
+        call   .set_cur\r
+        mov    ebp, debug_esi\r
+        call   .print\r
+        mov    eax, [state_esi]                       ; esi\r
+        call   .print_hex32\r
+        mov    ebp, debug_edi\r
+        call   .print\r
+        mov    eax, [state_edi]                       ; edi\r
+        call   .print_hex32\r
+        mov    ebp, dbg_close_row\r
+        call   .print\r
 \r
 \r
-         mov     bx, 980                             ; row 12 char 20\r
-         call    .set_cur\r
-         mov     ebp, dbg_head3\r
-         call    .print\r
-         mov     bx, 1140                            ; row 14 char 20\r
-         call    .set_cur\r
-         mov     ebp, dbg_footer\r
-         call    .print\r
-         mov     bx, 1060                            ; row 13 char 20\r
-         call    .set_cur\r
+        mov    bx, 980                                ; row 12 char 20\r
+        call   .set_cur\r
+        mov    ebp, dbg_head3\r
+        call   .print\r
+        mov    bx, 1140                               ; row 14 char 20\r
+        call   .set_cur\r
+        mov    ebp, dbg_footer\r
+        call   .print\r
+        mov    bx, 1060                               ; row 13 char 20\r
+        call   .set_cur\r
 \r
 \r
-         cmp     [dbg_keypress], 1\r
-         je      .wait_key\r
+        cmp    [dbg_keypress], 1\r
+        je     .wait_key\r
 \r
      ;----------------------------------;\r
      ;  wait for scancode and restart   ;\r
      ;----------------------------------;\r
 \r
      ;----------------------------------;\r
      ;  wait for scancode and restart   ;\r
      ;----------------------------------;\r
-         mov     ebp, dbg_restart\r
-         call    .print\r
-         mov     bx, 1093                            ; row 13 char 46\r
-         call    .set_cur\r
+        mov    ebp, dbg_restart\r
+        call   .print\r
+        mov    bx, 1093                               ; row 13 char 46\r
+        call   .set_cur\r
 \r
      .no_new1:\r
 \r
      .no_new1:\r
-         mov     al, [kbd_head]\r
-         mov     ah, [kbd_tail]\r
-         cmp     ah, 63\r
-         jne     .check1\r
-         cmp     al, 0\r
-         je      .no_new1\r
-         mov     [kbd_tail], 0\r
-         jmp     .done_check1\r
+        mov    al, [kbd_head]\r
+        mov    ah, [kbd_tail]\r
+        cmp    ah, 63\r
+        jne    .check1\r
+        cmp    al, 0\r
+        je     .no_new1\r
+        mov    [kbd_tail], 0\r
+        jmp    .done_check1\r
      .check1:\r
      .check1:\r
-         mov     bl, ah\r
-         inc     bl\r
-         cmp     bl, al\r
-         je      .no_new1\r
-         inc     [kbd_tail]\r
+        mov    bl, ah\r
+        inc    bl\r
+        cmp    bl, al\r
+        je     .no_new1\r
+        inc    [kbd_tail]\r
      .done_check1:\r
 \r
      .done_check1:\r
 \r
-         mov     esi, kbd_buffer\r
-         movzx   eax, [kbd_tail]\r
-         add     esi, eax\r
-         mov     ah, byte [esi]                      ; ah = scancode\r
-         cmp     ah, 0xFA                            ; check for some stuff..\r
-         je      .no_new1\r
-         cmp     ah, 0xE0\r
-         je      .no_new1\r
-         cmp     ah, 0xE1\r
-         je      .no_new1\r
-         test    ah, 0x80\r
-         jnz     .no_new1\r
+        mov    esi, kbd_buffer\r
+        movzx  eax, [kbd_tail]\r
+        add    esi, eax\r
+        mov    ah, byte [esi]                         ; ah = scancode\r
+        cmp    ah, 0xFA                               ; check for some stuff..\r
+        je     .no_new1\r
+        cmp    ah, 0xE0\r
+        je     .no_new1\r
+        cmp    ah, 0xE1\r
+        je     .no_new1\r
+        test   ah, 0x80\r
+        jnz    .no_new1\r
 \r
 \r
-         call    reboot                              ; in commands.inc\r
+        call   reboot                                 ; in commands.inc\r
 \r
      ;--------------------------;\r
      ;  wait for key and quit   ;\r
      ;--------------------------;\r
      .wait_key:\r
 \r
      ;--------------------------;\r
      ;  wait for key and quit   ;\r
      ;--------------------------;\r
      .wait_key:\r
-         mov     ebp, dbg_press\r
-         call    .print\r
-         mov     bx, 1091                            ; row 13 char 51\r
-         call    .set_cur\r
+        mov    ebp, dbg_press\r
+        call   .print\r
+        mov    bx, 1091                               ; row 13 char 51\r
+        call   .set_cur\r
 \r
      .no_new2:\r
 \r
      .no_new2:\r
-         mov     al, [kbd_head]\r
-         mov     ah, [kbd_tail]\r
-         cmp     ah, 63                              ; if we are at the buffer end,\r
-         jne     .check2                             ; we must check that head != 0\r
-         cmp     al, 0\r
-         je      .no_new2                            ; we don't have new keys to read\r
-         mov     [kbd_tail], 0                       ; "increase" to 0 (loop buffer)\r
-         jmp     .done_check2\r
+        mov    al, [kbd_head]\r
+        mov    ah, [kbd_tail]\r
+        cmp    ah, 63                                 ; if we are at the buffer end,\r
+        jne    .check2                                ; we must check that head != 0\r
+        cmp    al, 0\r
+        je     .no_new2                               ; we don't have new keys to read\r
+        mov    [kbd_tail], 0                          ; "increase" to 0 (loop buffer)\r
+        jmp    .done_check2\r
      .check2:\r
      .check2:\r
-         mov     bl, ah\r
-         inc     bl                                  ; head should be +1 compared to tail\r
-         cmp     bl, al\r
-         je      .no_new2\r
-         inc     [kbd_tail]                          ; increase\r
+        mov    bl, ah\r
+        inc    bl                                     ; head should be +1 compared to tail\r
+        cmp    bl, al\r
+        je     .no_new2\r
+        inc    [kbd_tail]                             ; increase\r
      .done_check2:\r
      .done_check2:\r
-         mov     esi, kbd_buffer\r
-         movzx   eax, [kbd_tail]\r
-         add     esi, eax\r
-         mov     ah, byte [esi]                      ; ah = scancode\r
-         cmp     ah, 0xFA                            ; check for some stuff..\r
-         je      .no_new2\r
-         cmp     ah, 0xE0\r
-         je      .no_new2\r
-         cmp     ah, 0xE1\r
-         je      .no_new2\r
-         test    ah, 0x80\r
-         jnz     .no_new2\r
+        mov    esi, kbd_buffer\r
+        movzx  eax, [kbd_tail]\r
+        add    esi, eax\r
+        mov    ah, byte [esi]                         ; ah = scancode\r
+        cmp    ah, 0xFA                               ; check for some stuff..\r
+        je     .no_new2\r
+        cmp    ah, 0xE0\r
+        je     .no_new2\r
+        cmp    ah, 0xE1\r
+        je     .no_new2\r
+        test   ah, 0x80\r
+        jnz    .no_new2\r
 \r
 \r
-         mov     dx, 0                               ; restore screen as\r
-         mov     edi, (0xB8000+840)                  ; it was before.\r
-         mov     esi, scr_buffer                     ; same loops as above\r
-     .big_loop2:                                     ; but exchanged esi and edi\r
-         mov     cx, 0\r
+        mov    dx, 0                                  ; restore screen as\r
+        mov    edi, (0xB8000+840)                     ; it was before.\r
+        mov    esi, scr_buffer                        ; same loops as above\r
+     .big_loop2:                                      ; but exchanged esi and edi\r
+        mov    cx, 0\r
      .small_loop2:\r
      .small_loop2:\r
-         movsb\r
-         inc     cx\r
-         cmp     cx, 72\r
-         je      .end_small2\r
-         jmp     .small_loop2\r
+        movsb\r
+        inc    cx\r
+        cmp    cx, 72\r
+        je     .end_small2\r
+        jmp    .small_loop2\r
      .end_small2:\r
      .end_small2:\r
-         inc     dx\r
-         cmp     dx, 10\r
-         je      .end_big2\r
-         add     edi, 88\r
-         jmp     .big_loop2\r
+        inc    dx\r
+        cmp    dx, 10\r
+        je     .end_big2\r
+        add    edi, 88\r
+        jmp    .big_loop2\r
      .end_big2:\r
 \r
      .end_big2:\r
 \r
-         mov     bx, [state_cursor]\r
-         call    .set_cur\r
-         mov     [dbg_keypress], 1\r
-         mov     [dbg_error], ' '                    ; restore variables.\r
-         mov     [dbg_error+1], 'n'                  ; ugly..\r
-         mov     [dbg_error+2], 'o'\r
-         mov     [dbg_error+3], 'n'\r
-         mov     [dbg_error+4], 'e'\r
-         mov     [dbg_error+5], '.'\r
-         mov     [dbg_error+6], ' '\r
-         mov     [dbg_error+7], ' '\r
-         mov     [dbg_error+8], ' '\r
-         mov     [dbg_error+9], ' '\r
-         mov     [dbg_error+10], ' '\r
-         mov     [dbg_error+11], ' '\r
-         mov     [dbg_error+12], ' '\r
-         mov     [dbg_error+13], ' '\r
-         mov     [dbg_error+14], 0\r
-         ret\r
+        mov    bx, [state_cursor]\r
+        call   .set_cur\r
+        mov    [dbg_keypress], 1\r
+        mov    [dbg_error], ' '                       ; restore variables.\r
+        mov    [dbg_error+1], 'n'                     ; ugly..\r
+        mov    [dbg_error+2], 'o'\r
+        mov    [dbg_error+3], 'n'\r
+        mov    [dbg_error+4], 'e'\r
+        mov    [dbg_error+5], '.'\r
+        mov    [dbg_error+6], ' '\r
+        mov    [dbg_error+7], ' '\r
+        mov    [dbg_error+8], ' '\r
+        mov    [dbg_error+9], ' '\r
+        mov    [dbg_error+10], ' '\r
+        mov    [dbg_error+11], ' '\r
+        mov    [dbg_error+12], ' '\r
+        mov    [dbg_error+13], ' '\r
+        mov    [dbg_error+14], 0\r
+        ret\r
 \r
      ;-------------------------------;\r
      ;  subfunctions to inc cursor   ;\r
      ;-------------------------------;\r
      .set_cur:\r
 \r
      ;-------------------------------;\r
      ;  subfunctions to inc cursor   ;\r
      ;-------------------------------;\r
      .set_cur:\r
-         mov     [stack_eax2], eax\r
-         mov     [stack_edx], edx                    ; can it get any uglier?\r
-         mov     al, 0x0E\r
-         mov     ah, bh\r
-         mov     dx, 0x3D4\r
-         out     dx, ax\r
-         inc     ax\r
-         mov     ah, bl\r
-         out     dx, ax\r
-         mov     edx, [stack_edx]\r
-         mov     eax, [stack_eax2]\r
-         ret\r
+        mov    [stack_eax2], eax\r
+        mov    [stack_edx], edx                       ; can it get any uglier?\r
+        mov    al, 0x0E\r
+        mov    ah, bh\r
+        mov    dx, 0x3D4\r
+        out    dx, ax\r
+        inc    ax\r
+        mov    ah, bl\r
+        out    dx, ax\r
+        mov    edx, [stack_edx]\r
+        mov    eax, [stack_eax2]\r
+        ret\r
      .get_cur:\r
      .get_cur:\r
-         mov     [stack_eax2], eax\r
-         mov     [stack_edx], edx\r
-         mov     dx, 0x3D4\r
-         mov     al, 0x0E\r
-         out     dx, al\r
-         inc     dx\r
-         in      al, dx\r
-         mov     bh, al\r
-         mov     al, 0x0F\r
-         dec     dx\r
-         out     dx, al\r
-         inc     dx\r
-         in      al, dx\r
-         mov     bl, al\r
-         mov     edx, [stack_edx]\r
-         mov     eax, [stack_eax2]\r
-         ret\r
-     ;--------------------------------;\r
-     ;  subfunction to print a char   ;\r
-     ;        bl = char, bh = attrib  ;\r
-     ;--------------------------------;\r
-     .print_char:\r
-         mov     [stack_eax], eax\r
-         mov     [stack_ebx], ebx\r
-         call    .get_cur\r
-         mov     eax, ebx\r
-         mov     ebx, [stack_ebx]\r
-         mov     [es:(eax*2 + 0xB8000)], bx\r
-         mov     ebx, eax\r
-         inc     bx\r
-         call    .set_cur\r
-         mov     ebx, [stack_ebx]\r
-         mov     eax, [stack_eax]\r
-         ret\r
+        mov    [stack_eax2], eax\r
+        mov    [stack_edx], edx\r
+        mov    dx, 0x3D4\r
+        mov    al, 0x0E\r
+        out    dx, al\r
+        inc    dx\r
+        in     al, dx\r
+        mov    bh, al\r
+        mov    al, 0x0F\r
+        dec    dx\r
+        out    dx, al\r
+        inc    dx\r
+        in     al, dx\r
+        mov    bl, al\r
+        mov    edx, [stack_edx]\r
+        mov    eax, [stack_eax2]\r
+        ret\r
+    ;--------------------------------;\r
+    ;  subfunction to print a char   ;\r
+    ;        bl = char, bh = attrib  ;\r
+    ;--------------------------------;\r
+    .print_char:\r
+        mov    [stack_eax], eax\r
+        mov    [stack_ebx], ebx\r
+        call   .get_cur\r
+        mov    eax, ebx\r
+        mov    ebx, [stack_ebx]\r
+        mov    [es:(eax*2 + 0xB8000)], bx\r
+        mov    ebx, eax\r
+        inc    bx\r
+        call   .set_cur\r
+        mov    ebx, [stack_ebx]\r
+        mov    eax, [stack_eax]\r
+        ret\r
      ;------------------------------------------;\r
      ;  subfunction to print 32-bit hex value   ;\r
      ;          IN: eax = value, bh = color.    ;\r
      ;------------------------------------------;\r
      .print_hex32:\r
      ;------------------------------------------;\r
      ;  subfunction to print 32-bit hex value   ;\r
      ;          IN: eax = value, bh = color.    ;\r
      ;------------------------------------------;\r
      .print_hex32:\r
-         mov     ecx, 8\r
+        mov    ecx, 8\r
      .print_it:\r
      .print_it:\r
-         rol     eax, 4\r
-         movzx   edx, al\r
-         and     edx, 0x0F\r
-         or      edx, 0x30\r
-         cmp     edx, 0x39\r
-         jna     .cont\r
-         add     edx, 7\r
+        rol    eax, 4\r
+        movzx  edx, al\r
+        and    edx, 0x0F\r
+        or     edx, 0x30\r
+        cmp    edx, 0x39\r
+        jna    .cont\r
+        add    edx, 7\r
      .cont:\r
      .cont:\r
-         mov     bl, dl\r
-         call    .print_char\r
-         loop    .print_it\r
-         ret\r
-     ;-----------------------------------------;\r
-     ;  subfunction to display asciiz string   ;\r
-     ;       Input: ebp = string               ;\r
-     ;-----------------------------------------;\r
-     .print:\r
-         mov     al, byte [ebp]\r
-         or      al, al\r
-         jz      .done\r
-         mov     bl, al\r
-         mov     bh, 0x40                            ; standard color for this...\r
-         call    .print_char\r
-         inc     ebp\r
-         jmp     .print\r
-     .done:\r
-         ret
\ No newline at end of file
+        mov    bl, dl\r
+        call   .print_char\r
+        loop   .print_it\r
+        ret\r
+    ;-----------------------------------------;\r
+    ;  subfunction to display asciiz string   ;\r
+    ;       Input: ebp = string               ;\r
+    ;-----------------------------------------;\r
+    .print:\r
+        mov    al, byte [ebp]\r
+        or     al, al\r
+        jz     .done\r
+        mov    bl, al\r
+        mov    bh, 0x40                               ; standard color for this...\r
+        call   .print_char\r
+        inc    ebp\r
+        jmp    .print\r
+    .done:\r
+        ret
\ No newline at end of file