home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / noyau / tampon.asm < prev    next >
Assembly Source File  |  1994-05-23  |  992b  |  52 lines

  1. ;
  2. ;   Fonctions de gestion des buffers circulaires
  3. ;
  4. ;
  5. ;
  6.  
  7. .MODEL SMALL,OS_DOS
  8.  
  9. INCLUDE tampon.inc
  10.  
  11.  
  12. .CODE
  13. ; Procedure d'ajout de AL dans le buffer circulaire pointé par DS:SI
  14. Ajoute PROC
  15.     push ax
  16.     push si
  17.     ASSUME DS:@data;es:Nothing
  18.     mov SI,(TAMPON PTR [si]).LaQueue
  19.     mov [si],al
  20.     pop si
  21.     mov ax,(TAMPON PTR [si]).LaQueue
  22.     inc ax
  23.     cmp ax,(TAMPON PTR [si]).LaFin
  24.     jne Ajoute_Suite
  25.     mov ax,(TAMPON PTR [si]).Debut
  26. Ajoute_Suite:
  27.     mov (TAMPON PTR [si]).LaQueue,ax
  28.     pop ax
  29.     RET
  30. Ajoute ENDP
  31.  
  32. ; Procédure de retrait d'une valeur du buffer circulaire dans AL
  33. Retire PROC
  34.     push si
  35.     ASSUME DS:@data;es:Nothing
  36.     mov SI,(TAMPON PTR [si]).Tete
  37.     mov al,[SI]
  38.     pop si
  39.     push ax
  40.     mov ax,(TAMPON PTR [si]).Tete
  41.     inc ax
  42.     cmp ax,(TAMPON PTR [si]).LaFin
  43.     jne Retire_Suite
  44.     mov ax,(TAMPON PTR [si]).Debut
  45. Retire_Suite:
  46.     mov (TAMPON PTR [si]).Tete,ax
  47.     pop ax
  48.     RET
  49. Retire ENDP
  50.  
  51. END
  52.