Guest User

syscalls.asm

a guest
Nov 7th, 2011
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;---------------------------------------
  2. ; Routines des appels systèmes INT 0X80
  3. ;---------------------------------------
  4. interr:
  5.     PUSHA
  6.     CMP EAX, 3      ; Appel READ
  7.     JE .read
  8.     CMP EAX, 4      ; Appel WRITE
  9.     JE .write
  10.     JMP .fin
  11. ;-------------------------------
  12. ;         Service READ
  13. ;-------------------------------
  14. .read
  15.     CMP EBX, 0
  16.     JE .stdin
  17.     JMP .fin
  18.  
  19. .stdin              ; Read Clavier (0)
  20.     ; Doit réaliser la copie du buffer clavier vers
  21.     ; le buffer donné (ECX) du nombre de caractères donné (EDX)
  22.     JMP .fin
  23.  
  24. ;-------------------------------
  25. ;        Service WRITE
  26. ;-------------------------------
  27. .write
  28.     CMP EBX, 1
  29.     JGE .stdout
  30.     JMP .fin
  31.  
  32. .stdout             ; Write Ecran (1 ou 2)
  33.     MOV ESI, ECX
  34.     MOV ECX, EDX
  35.     CALL print80
  36.     JMP .fin
  37.  
  38. .fin                ; Fin de l'interruption
  39.     POPA
  40.     MOV     AL,0x20
  41.     OUT     0X20,AL ; fin d'interrupt pour le PIC
  42.     IRET
  43.  
  44.  
Advertisement
Add Comment
Please, Sign In to add comment