home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 19
/
CD_ASCQ_19_010295.iso
/
dos
/
prg
/
noyau
/
tampon.asm
< prev
next >
Wrap
Assembly Source File
|
1994-05-23
|
992b
|
52 lines
;
; Fonctions de gestion des buffers circulaires
;
;
;
.MODEL SMALL,OS_DOS
INCLUDE tampon.inc
.CODE
; Procedure d'ajout de AL dans le buffer circulaire pointé par DS:SI
Ajoute PROC
push ax
push si
ASSUME DS:@data;es:Nothing
mov SI,(TAMPON PTR [si]).LaQueue
mov [si],al
pop si
mov ax,(TAMPON PTR [si]).LaQueue
inc ax
cmp ax,(TAMPON PTR [si]).LaFin
jne Ajoute_Suite
mov ax,(TAMPON PTR [si]).Debut
Ajoute_Suite:
mov (TAMPON PTR [si]).LaQueue,ax
pop ax
RET
Ajoute ENDP
; Procédure de retrait d'une valeur du buffer circulaire dans AL
Retire PROC
push si
ASSUME DS:@data;es:Nothing
mov SI,(TAMPON PTR [si]).Tete
mov al,[SI]
pop si
push ax
mov ax,(TAMPON PTR [si]).Tete
inc ax
cmp ax,(TAMPON PTR [si]).LaFin
jne Retire_Suite
mov ax,(TAMPON PTR [si]).Debut
Retire_Suite:
mov (TAMPON PTR [si]).Tete,ax
pop ax
RET
Retire ENDP
END