Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. /* ** por compatibilidad se omiten tildes **
  2. ================================================================================
  3. TRABAJO PRACTICO 3 - System Programming - ORGANIZACION DE COMPUTADOR II - FCEN
  4. ================================================================================
  5. */
  6.  
  7. #include "syscall.h"
  8.  
  9. void handler(void);
  10.  
  11. void task() {
  12. char* task_id = "Tarea A1";
  13. syscall_talk(task_id);
  14. syscall_setHandler(handler);
  15.  
  16. int register res asm("eax");
  17.  
  18. uint32_t last_x,last_y;
  19. uint32_t x = last_x;
  20. uint32_t y = last_y;
  21.  
  22. //char*message = "x: ,y: ";
  23. char* message[5] = {
  24. "# # ##### #### # # #### #### ",
  25. "# # # # # # # # # #",
  26. "##### ##### # ## #### # #",
  27. "# # # # # # # # # #",
  28. "# # # # #### # # #### #### ",
  29. };
  30.  
  31. while(1) {
  32.  
  33. while(x == last_x && y == last_y){
  34. syscall_where(&x,&y);
  35. }
  36.  
  37. if()
  38. //uint16_t* ptr = (uint32_t*)0xB8000;
  39. //syscall_where(ptr+1,ptr+1);
  40. /*for(uint8_t yy = 0;yy < 50;yy++){
  41. for(uint8_t xx = 0;xx < 80/2;xx++){
  42. syscall_where(ptr,ptr+1);
  43. ptr+=2;
  44. }
  45. }*/
  46.  
  47. for(uint8_t m = 0;m < 5;m++){
  48. uint8_t x_char = 0;
  49. while(message[m][x_char] != 0){
  50. if(message[m][x_char] == '#'){
  51. uint16_t* video_ptr = (uint16_t*) 0XB8000;
  52. video_ptr += (m+5) * 80 + x_char+10;
  53.  
  54. syscall_where((uint32_t*)video_ptr,(uint32_t*)video_ptr);
  55. }
  56. x_char++;
  57. }
  58. }
  59.  
  60. last_x = x;
  61. last_y = y;
  62. }
  63. }
  64.  
  65. void handler() {
  66. //int register res asm("eax");
  67. /*
  68. char* a = "handler ";
  69. a[8] = res%10+'0';
  70. syscall_talk(a);
  71. breakpoint();*/
  72. uint32_t x,y;
  73. syscall_where(&x,&y);
  74. char*message = "x: ,y: ";
  75.  
  76. message[2] = x/10 + '0';
  77. message[3] = x%10 + '0';
  78. message[7] = y/10 + '0';
  79. message[8] = y%10 + '0';
  80. syscall_talk(message);
  81. syscall_informAction(Center);
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement