Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include "c99int.h"
  2.  
  3. #define MAX_X 80
  4. #define MAX_Y 25
  5.  
  6. static volatile char *const VGABUF = (volatile char*) 0xb8000;
  7.  
  8. static void vga_write(const char *s, int8_t linea, uint8_t color){
  9.   volatile char *buf = VGABUF;
  10.   int pos_y = linea;
  11.   if(linea < 0){
  12.     pos_y = 80 + linea;
  13.   }
  14.   buf += pos_y*80*2;
  15.   while(*s != 0){
  16.     *buf++ = *s++;
  17.     *buf++ = color;
  18.   }
  19. }
  20.  
  21. void comienzo(void) {
  22.  
  23.   vga_write("OK", 0, 47);
  24.   vga_write("HOLA", 1, 224 );
  25.  
  26.   while (1)
  27.     asm("hlt");
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement