Skip to content

Instantly share code, notes, and snippets.

@mafice
Created May 12, 2012 00:52
Show Gist options
  • Select an option

  • Save mafice/2663412 to your computer and use it in GitHub Desktop.

Select an option

Save mafice/2663412 to your computer and use it in GitHub Desktop.
serialport
#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