forked from aburguera/YAP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AGENTLST.X68
83 lines (79 loc) · 2.88 KB
/
AGENTLST.X68
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
; =============================================================================
; AGENT MANAGEMENT
; EACH AGENT HAS A DATA BLOCK FROM DMM AS FOLLOWS:
; +0 - LONG : UPDATE SUBROUTINE POINTER
; +4 - LONG : PLOT SUBROUTINE POINTER
; +8:END : DATA (AGENT SPECIFIC)
; =============================================================================
; -----------------------------------------------------------------------------
AGLADD
; CREATES A NEW AGENT
; INPUT - A1 - POINTER TO AGENT INIT FUNCTION
; A2 - POINTER TO AGENT UPDATE FUNCTION
; A3 - POINTER TO AGENT PLOT FUNCTION
; D0 - AGENT TYPE (USED AS OWNED BY DMM)
; D1 - AGENT INITIALIZATION PARAMETER 1
; D2 - AGENT INITIALIZATION PARAMETER 2
; D3 - AGENT INITIALIZATION PARAMETER 3
; OUTPUT - NONE
; MODIFIES - NONE
; -----------------------------------------------------------------------------
MOVE.L A0,-(A7)
JSR DMMALLOC
CMP.L #0,A0
BEQ .END
MOVE.L A2,(A0)+
MOVE.L A3,(A0)+
JSR (A1)
.END MOVE.L (A7)+,A0
RTS
; -----------------------------------------------------------------------------
AGLUPD
; UPDATES THE AGENT LIST. PRIOR TO CALLING THE UPDATE FUNCTIONS, A0 IS SET
; TO THE DATA BLOCK OF THE CORRESPONDING SLOT.
; INPUT - NONE
; OUTPUT - NONE
; MODIFIES - NONE
; -----------------------------------------------------------------------------
MOVEM.L A0-A1,-(A7)
JSR DMMFIRST
.LOOP CMP.L #0,A0
BEQ .END
MOVE.L (A0),A1
ADD.L #8,A0
JSR (A1)
JSR DMMNEXT
BRA .LOOP
.END MOVEM.L (A7)+,A0-A1
RTS
; -----------------------------------------------------------------------------
AGLPLOT
; PLOTS THE AGENT LIST. PRIOR TO CALLING THE UPDATE FUNCTIONS, A0 IS SET
; TO THE DATA BLOCK OF THE CORRESPONDING SLOT.
; INPUT - NONE
; OUTPUT - NONE
; MODIFIES - NONE
; -----------------------------------------------------------------------------
MOVEM.L A0-A1,-(A7)
JSR DMMFIRST
.LOOP CMP.L #0,A0
BEQ .END
MOVE.L 4(A0),A1
ADD.L #8,A0
JSR (A1)
JSR DMMNEXT
BRA .LOOP
.END MOVEM.L (A7)+,A0-A1
RTS
; -----------------------------------------------------------------------------
AGLKILL EQU DMMFREE
; KILLS THE AGENT BY RELEASING ITS MEMORY
; INPUT - A0 POINTER WITHIN THE AGENT MEMORY
; OUTPUT - NONE
; MODIFIES - NONE
; NOTE - IT IS JUST A WRAPPER FOR DMMFREE
; -----------------------------------------------------------------------------
*~Font name~Courier New~
*~Font size~10~
*~Tab type~1~
*~Tab size~4~