Changeset 561 for sbliveos2/trunk/lib32
- Timestamp:
- Jul 28, 2011, 11:16:56 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/lib32/debug.c
r151 r561 50 50 51 51 char hextab[]="0123456789ABCDEF"; 52 53 #ifdef DEBUG //--------------------------- CharOut - 54 void CharOut(char c) 55 { 56 _asm { 57 58 mov dx, MAGIC_COMM_PORT // address of PS/2's first COM port 59 add dx, UART_LINE_STAT 60 61 ReadyCheck: 62 in al, dx // wait for comm port ready signal 63 64 DELAY 65 DELAY 66 DELAY 67 68 test al, 020h 69 jz ReadyCheck 70 71 // Send the character 72 73 add dx, UART_DATA - UART_LINE_STAT 74 mov al,c 75 out dx, al 76 77 DELAY 78 DELAY 79 DELAY 80 } 81 } 82 #endif 83 84 #ifdef DEBUG //------------------------- StringOut - 85 void StringOut(char *DbgStr) 86 { 87 while (*DbgStr) 88 CharOut(*DbgStr++); 89 90 if (fLineTerminate) 91 { 92 CharOut(CR); // append carriage return, 93 CharOut(LF); // linefeed 94 } 95 } 96 #endif 97 52 98 53 99 //-------------------- DecLongToASCII - … … 373 419 } 374 420 375 #ifdef DEBUG //------------------------- StringOut -376 void StringOut(char *DbgStr)377 {378 while (*DbgStr)379 CharOut(*DbgStr++);380 381 if (fLineTerminate)382 {383 CharOut(CR); // append carriage return,384 CharOut(LF); // linefeed385 }386 }387 #endif388 389 421 #ifdef DEBUG 390 422 //#define MAGIC_COMM_PORT 0x3f8 // pulled from word ptr 40:0 … … 405 437 #endif 406 438 407 #ifdef DEBUG //--------------------------- CharOut -408 void CharOut(char c)409 {410 _asm {411 412 mov dx, MAGIC_COMM_PORT // address of PS/2's first COM port413 add dx, UART_LINE_STAT414 415 ReadyCheck:416 in al, dx // wait for comm port ready signal417 418 DELAY419 DELAY420 DELAY421 422 test al, 020h423 jz ReadyCheck424 425 // Send the character426 427 add dx, UART_DATA - UART_LINE_STAT428 mov al,c429 out dx, al430 431 DELAY432 DELAY433 DELAY434 }435 }436 #endif
Note:
See TracChangeset
for help on using the changeset viewer.