Created
May 12, 2012 00:52
-
-
Save mafice/2663412 to your computer and use it in GitHub Desktop.
serialport
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define IOPORT_SERIALPORT_BASE 0x03f8 | |
| void serialport_sendString (const char* str){ | |
| unsigned int i; | |
| asm_out8(IOPORT_SERIALPORT_BASE+1, 0x00); | |
| asm_out8(IOPORT_SERIALPORT_BASE+3, 0x80); | |
| asm_out8(IOPORT_SERIALPORT_BASE+0, 0x03); | |
| asm_out8(IOPORT_SERIALPORT_BASE+1, 0x00); | |
| asm_out8(IOPORT_SERIALPORT_BASE+3, 0x03); | |
| asm_out8(IOPORT_SERIALPORT_BASE+2, 0xc7); | |
| asm_out8(IOPORT_SERIALPORT_BASE+4, 0x0b); | |
| for(i=0; str[i] != '\0'; i++){ | |
| asm_out8(IOPORT_SERIALPORT_BASE, str[i]); | |
| while(!((asm_in8(IOPORT_SERIALPORT_BASE+5)>>5)&1)); | |
| } | |
| return; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment