-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathINIBUF
executable file
·57 lines (46 loc) · 1.34 KB
/
INIBUF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
% === INIBUF === % 10.10.88 VERSION 7
%---------------------------%
%- CIRCLE BUFFER MANAGER -%
%---------------------------%
LOCALS LBUFF
DATA GETPTR,PUTPTR
EQUALS BUFSIZ=300
EQUALS HDWBUF=42 %òáúíåò âõæåòá ÷ ëáòôå LP55.02 = 20(?)
EQUALS REDMRK=BUFSIZ-HDWBUF %çòáîéãá "ëòáóîïê úïîù".
BUFFERS BUFFER(BUFSIZ+1)
% EQUALS EOBUFF=!BUFFER+BUFSIZ
****************P
REGISTERS DIST=%1,DISTX=%2
PROGRAM INIBUF()
GETPTR='!BUFFER' ; PUTPTR='!BUFFER'
RETURN
PROGRAM GETBUF()
(IF GETPTR<>PUTPTR
R0:=@GETPTR
IF GETPTR(+1)='!BUFFER+BUFSIZ' THEN GETPTR='!BUFFER'
ELSE
R0:=0
)IF
RETURN
PROGRAM PUTBUF()
@PUTPTR:=R0
IF PUTPTR(+1)='!BUFFER+BUFSIZ' THEN PUTPTR='!BUFFER'
RETURN
PROGRAM TSTFUL(DIST,DISTX)
DISTX=PUTPTR-GETPTR
IF DIST(DISTX)<0 THEN DIST='BUFSIZ'-DISTX %ðåòå÷ïòáþé÷áåí
IF DIST>='REDMRK' THEN R0=1 ELSE R0=0 %õóôáîá÷ìé÷áåí æìáç
RETURN
PROGRAM TSTEMP()
R0=0 ; IF GETPTR=PUTPTR THEN R0=1
RETURN
PROGRAM FLUSH()
@PUTPTR:=0 %ôåòíéîáôïò
(IF PUTPTR<<GETPTR %2 ëõóëá ÷ âõæåòå ?
SYSCALL DPC '!BUFFER' %÷ùäáåí <***TO......
. CLRB !BUFFER+BUFSIZ *ôåòíéîáôïò 2-çï ëõóëá
)IF
SYSCALL DPC GETPTR %÷ùäáåí FROM****...>
* GETPTR=PUTPTR ëïìøãå÷ïê âõæåò òåöåô ãåðïþëé DPC
GETPTR='!BUFFER' ; PUTPTR='!BUFFER' %ìéîåêîùê âõæåò
RETURN