Trailing-Edge
-
PDP-10 Archives
-
BB-P363B-SM_1985
-
mcb/nml/nmum11.lst
There are no other files named nmum11.lst in the archive.
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27
NMUM11.M11 03-JAN-83 17:07 TABLE OF CONTENTS
51 MACRO Definitions
87 Local Data Definitions
115 SS$CTX - Switch Tasks Contrxt
182 SS$TNI - NMU Task Initialization
234 SAVALL - Save All Registers
273 SS$FIN - NMU Task Exiting Processing
311 SS$COR - Allocate another block from MEMBOT
360 $ADD32 - Add two 32 bit numbers
401 $SUB32 - Subtract two 32 bit numbers
442 $SGN32 - Return sign of 32 bit number
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 1
NMUM11.M11 03-JAN-83 17:07
1 .TITLE NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS
2 .IDENT /X01070/
3 .ENABLE LC ;LOWER CASE PLEASE!!
4 ;
5 ; COPYRIGHT (c) 1980, 1981, 1982
6 ; DIGITAL EQUIPMENT CORPORATION
7 ; Maynard, Massachusetts
8 ;
9 ; This software is furnished under a license and may be used
10 ; and copied only in accordance with the terms of such license
11 ; and with the inclusion of the above copyright notice. This
12 ; software or any other copies thereof may not be provided or
13 ; otherwise made available to any other person. No title to
14 ; and ownership of the software is hereby transferred.
15 ;
16 ; The information in this software is subject to change
17 ; without notice and should not be construed as a commitment
18 ; by DIGITAL EQUIPMENT CORPORATION.
19 ;
20 ; DIGITAL assumes no responsibility for the use or reliability
21 ; of its software on equipment which is not supplied by
22 ; DIGITAL.
23 ;
24 ;
25 ;++
26 ;
27 ; FACILITY: LSG DECnet Network Management
28 ;
29 ; ABSTRACT:
30 ;
31 ; This module contains all system specific assembly routines necessary
32 ; for support of common NML routines.
33 ;
34 ; ENVIRONMENT: MCB V3.x
35 ;
36 ; AUTHOR: Scott G. Robinson CREATION DATE: 29-DEC-80
37 ;
38 ; MODIFIED BY:
39 ;
40 ; 01 - Ensure Saving of all important registers
41 ; 02 - Change SS$MSG to SS.MES
42 ; 03 - Increase dynamic storage
43 ; 04 - Add 32-bit utility routines $ADD32, $SUB32, and $SGN32.
44 ; 05 - Whoops! the word meanings were reversed!
45 ; 06 - Set up *full* stack in SS$TNI.
46 ; Remove MEMSIZ to variable at MEMTOP.
47 ; 07 - Reduce size of allocatable memory from 10000. to 9980.
48 ;
49 ;--
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 2
NMUM11.M11 03-JAN-83 17:07 MACRO DEFINITIONS
51 .SBTTL MACRO Definitions
52 ;
53 ; System Macro Calls
54 ;
55 .MCALL ALUN$S,QIOW$S
56 ;
57 ; System Symbol Definitions
58 ;
59 ; NETDF$
60 ;
61 ; Local Macro Definitions
62 ;
63 ; PUSH and POP macros are used to manipulate elements onto and
64 ; from the stack.
65 ;
66 .MACRO PUSH ARG
67 .IRP A,<ARG>
68 .IF NB A
69 MOV A,-(SP) ;Push A onto stack
70 .IFF
71 CLR -(SP) ;Allocate a 0 word
72 .ENDC
73 .ENDM
74 .ENDM PUSH
75
76 .MACRO POP ARG
77 .IRP A,<ARG>
78 .IF NB A
79 MOV (SP)+,A ;Pop A off stack
80 .IFF
81 TST (SP)+ ;Remove word from stack
82 .ENDC
83 .ENDM
84 .ENDM POP
85 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 3
NMUM11.M11 03-JAN-83 17:07 LOCAL DATA DEFINITIONS
87 .SBTTL Local Data Definitions
88 ;
89 ; NMU Task Block for MCB Environments:
90 ;
91 .globl TB.STK,TB.CTX,TB.STR
92 ;
93 000000' .PSECT $OWN$,D
94 ;
95 ; Tasking State Variables
96 ;
97 000000' 000000 CURTSK:: .WORD 0 ;Currently executing Thread
98 000002' 000000 PRVTSK:: .WORD 0 ;Previously executing Thread
99 000004' 000000 SAVESP:: .WORD 0 ;Temporary for current SP
100 000006' 000000 SAVER0:: .WORD 0 ;Temporary for current R0
101 ;
102 ; The entire free space is kept in PSECT $$COR$
103 ;
104 ; The memory allocation algorithm needs to know what the
105 ; highest location allocated is. MEMTOP is both the highest address
106 ; that can be allocated and a variable pointing to available memory.
107 ;
108 000000' .PSECT $$COR$,D
109 000000' 023374 MEMBOT::.BLKW 9980.
110 046770' 000000' MEMTOP::.WORD MEMBOT
111 ;
112 046772' 000000 INTNST:: .WORD 0 ;Interrupt nesting count
113 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 4
NMUM11.M11 03-JAN-83 17:07 SS$CTX - SWITCH TASKS CONTRXT
115 .SBTTL SS$CTX - Switch Tasks Contrxt
116 000000' .PSECT $CODE$,I,RO
117
118 ;++
119 ; global routine SS$CTX(NEXT_TASK) : novalue
120 ;
121 ; FUNCTIONAL DESCRIPTION:
122 ;
123 ; SS$CTX saves the current task context in its TASK_BLOCK
124 ; and starts up another task from the NEXT_TASK BLOCK.
125 ; All registers are saved and restored when switching among
126 ; tasks.
127 ;
128 ; FORMAL PARAMETERS:
129 ;
130 ; NEXT_TASK - the next TASK_BLOCK to schedule
131 ;
132 ; IMPLICIT INPUTS:
133 ;
134 ; CURTSK - the currently running TASK_BLOCK
135 ; Misc locations in the TASK_BLOCKs
136 ;
137 ; IMPLICIT OUTPUTS:
138 ;
139 ; PRVTSK - set to the previous CURTSK
140 ; CURTSK - set to NEXT_TASK
141 ; Misc locations in the TASK_BLOCK
142 ;
143 ; COMPLETION CODES:
144 ;
145 ; None
146 ;
147 ; SIDE EFFECTS:
148 ;
149 ; None - all this is by design
150 ;
151 ;--
152 000000' SS$CTX:: ;Switch Task Context
153 000000' 010067 000006' MOV R0,SAVER0 ;Preserve R0
154 000004' 016700 000000' MOV CURTSK,R0 ;Save CURTSK and determine validity
155 000010' 010067 000002' MOV R0,PRVTSK ;
156 000014' 001003 BNE 10$ ;Valid so save context
157 000016' 016600 000002 MOV 2(SP),R0 ;Setup NEXT_TASK in R0
158 000022' 000412 BR 20$
159 000024' 016700 000006' 10$: MOV SAVER0,R0 ;Restore R0
160 000030' 004167 000142 JSR R1,SAVALL ;Save important registers on current stack
161 000034' 016700 000002' MOV PRVTSK,R0 ;Return R0 to CURRENT_TASK
162 000040' 010660 000000G MOV SP,TB.CTX(R0) ;Save context SP
163 000044' 016600 000020 MOV 16.(SP),R0 ;Get NEXT_TASK BLOCK address
164 000050' 016006 000000G 20$: MOV TB.CTX(R0),SP ;Setup new context
165 000054' 010067 000000' MOV R0,CURTSK ;Setup Current Task
166 ;---------------------------------
167 ; Debugging code
168 ;
169 .GLOBL SS.MES,TB.NAM
170 000060' 012746 000000G MOV #TB.NAM,-(SP) ;Print out Task Name
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 4-1
NMUM11.M11 03-JAN-83 17:07 SS$CTX - SWITCH TASKS CONTRXT
171 000064' 060016 ADD R0,(SP)
172 000066' 004767 000000G JSR PC,SS.MES
173 000072' 012716 000106' MOV #CRLF,(SP)
174 000076' 004767 000000G JSR PC,SS.MES
175 000102' 005726 TST (SP)+
176
177 ;---------------------------------
178 000104' 000207 RTS PC ; and return to it
179 000106' 015 012 000 CRLF: .byte 15,12,0,0
000111' 000
180 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 5
NMUM11.M11 03-JAN-83 17:07 SS$TNI - NMU TASK INITIALIZATION
182 .SBTTL SS$TNI - NMU Task Initialization
183 ; .PSECT $CODE$
184
185 ;++
186 ; global routine SS$TNI(TASK_BLOCK, STACK_SIZE) : novalue
187 ;
188 ; FUNCTIONAL DESCRIPTION:
189 ;
190 ; SS$TNI initializes the task block for execution. It
191 ; only initializes the stack.
192 ;
193 ; FORMAL PARAMETERS:
194 ;
195 ; TASK_BLOCK - the task block address
196 ; STACK_LENGTH - the length of the task stack
197 ;
198 ; IMPLICIT INPUTS:
199 ;
200 ; None
201 ;
202 ; IMPLICIT OUTPUTS:
203 ;
204 ; Misc locations in the TASK_BLOCK
205 ;
206 ; COMPLETION CODES:
207 ;
208 ; None
209 ;
210 ; SIDE EFFECTS:
211 ;
212 ; None - all this is by design
213 ;
214 ;--
215 .GLOBL US.FIN
216 000112' SS$TNI:: ;Initialize the task block
217 000112' PUSH <R0,R1> ;Save destroyed registers
218 000116' 010667 000004' MOV SP,SAVESP ;Save current stack pointer
219 000122' 016601 000010 MOV 8.(SP),R1 ;R1 = TASK_BLOCK
220 000126' 016600 000006 MOV 6.(SP),R0 ;R0 = Size of task stack in words
221 000132' 006300 ASL R0 ;R0 = Size of task stack in bytes
222 000134' 062700 000000G ADD #TB.STK,R0 ;R0 = Tasks Stack Offset
223 000140' 060100 ADD R1,R0 ;R0 = Task Block Stack Top
224 000142' 010006 MOV R0,SP ;; New Stack pointer Setup
225 000144' 012746 000000G MOV #US.FIN,-(SP) ;; Trap cases of task exit
226 000150' 016146 000000G MOV TB.STR(R1),-(SP);; Push starting address
227 000154' 004167 000016 JSR R1,SAVALL ;; Save Context
228 000160' 010661 000000G MOV SP,TB.CTX(R1) ;; Save Context pointer
229 000164' 016706 000004' MOV SAVESP,SP ;Restore original context
230 000170' POP <R1,R0> ;Restore original registers
231 000174' 000207 RTS PC ;Exit
232 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 6
NMUM11.M11 03-JAN-83 17:07 SAVALL - SAVE ALL REGISTERS
234 .SBTTL SAVALL - Save All Registers
235 ; .PSECT $CODE$
236
237 ;++
238 ; JSR R1,SAVALL
239 ;
240 ; FUNCTIONAL DESCRIPTION:
241 ;
242 ; SAVALL saves R0-R5 onto the stack.
243 ;
244 ; FORMAL PARAMETERS:
245 ;
246 ; None
247 ;
248 ; IMPLICIT INPUTS:
249 ;
250 ; None
251 ;
252 ; IMPLICIT OUTPUTS:
253 ;
254 ; None
255 ;
256 ; COMPLETION CODES:
257 ;
258 ; None
259 ;
260 ; SIDE EFFECTS:
261 ;
262 ; None
263 ;
264 ;--
265 000176' SAVALL: PUSH <R2,R3,R4,R5,R0,R1> ;Real R1 is already on Stack
266 ; R1 just saved is return address
267 000212' 016601 000014 MOV 12.(SP),R1 ;Restore Real R1
268 000216' 004736 JSR PC,@(SP)+ ;Call ourselves as Co-Routine
269 000220' POP <R0,R5,R4,R3,R2,R1> ;Restore all registers
270 000234' 000207 RTS PC
271 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 7
NMUM11.M11 03-JAN-83 17:07 SS$FIN - NMU TASK EXITING PROCESSING
273 .SBTTL SS$FIN - NMU Task Exiting Processing
274 ; .PSECT $CODE$
275
276 ;++
277 ; global routine SS$FIN : novalue
278 ;
279 ; FUNCTIONAL DESCRIPTION:
280 ;
281 ; SS$TNI initializes the task block for execution. It
282 ; only initializes the stack.
283 ;
284 ; FORMAL PARAMETERS:
285 ;
286 ; TASK_BLOCK - the task block address
287 ; STACK_LENGTH - the length of the task stack
288 ;
289 ; IMPLICIT INPUTS:
290 ;
291 ; None
292 ;
293 ; IMPLICIT OUTPUTS:
294 ;
295 ; Misc locations in the TASK_BLOCK
296 ;
297 ; COMPLETION CODES:
298 ;
299 ; None
300 ;
301 ; SIDE EFFECTS:
302 ;
303 ; None - all this is by design
304 ;
305 ;--
306 000236' NMU$FA:: ;!!!!TEMPORARILY !!!!
307 000236' 000004 IOT ;Blow up for now!
308 000240' 000207 RTS PC ;Exit
309 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 8
NMUM11.M11 03-JAN-83 17:07 SS$COR - ALLOCATE ANOTHER BLOCK FROM MEMBOT
311 .SBTTL SS$COR - Allocate another block from MEMBOT
312 ;++
313 ; global routine SS$COR(AMOUNT)
314 ;
315 ; FUNCTIONAL DESCRIPTION:
316 ;
317 ; SS$COR allocates AMOUNT of memory from the memory pool and updates
318 ; MEMTOP to reflect that allocation.
319 ;
320 ; FORMAL PARAMETERS:
321 ;
322 ; AMOUNT - the amount of memory to allocate
323 ;
324 ; IMPLICIT INPUTS:
325 ;
326 ; MEMTOP - the current top of memory
327 ;
328 ; IMPLICIT OUTPUTS:
329 ;
330 ; MEMTOP - updated to reflect the allocation
331 ;
332 ; Routine Value:
333 ;
334 ; Address of beginning of memory block or
335 ; 0 if the AMOUNT is unavailable
336 ;
337 ; SIDE EFFECTS:
338 ;
339 ; None
340 ;
341 ;--
342 ; .PSECT $CODE$,I,RO
343 .GLOBL $SAVE5
344 000242' SS$COR:: ;Try to allocate a block of memory
345 000242' 004167 000000G JSR R1,$SAVE5 ;Save a few registers
346 000246' 016601 000016 MOV 14.(SP),R1 ;AMOUNT to R1
347 000252' 016700 046770' MOV MEMTOP,R0 ;Current top of memory to R0
348 000256' 060001 ADD R0,R1 ;Add in amount of allocation
349 000260' 005201 INC R1 ;Round to Word Boundary
350 000262' 042701 000001 BIC #1,R1 ;..
351 000266' 022701 046770' CMP #MEMTOP,R1 ;Are we over memory?
352 000272' 101002 BHI 10$ ;No, so update allocation
353 000274' 005000 CLR R0 ;Yes, set return Value
354 000276' 000207 RTS PC ; and Exit
355 000300' 010167 046770' 10$: MOV R1,MEMTOP ;Set new top of memory
356 ;R0 is start of block
357 000304' 000207 RTS PC ;Exit
358 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 9
NMUM11.M11 03-JAN-83 17:07 $ADD32 - ADD TWO 32 BIT NUMBERS
360 .SBTTL $ADD32 - Add two 32 bit numbers
361 ;++
362 ; linkage ADD = jsr (register = 0, register = 1);
363 ; global routine $ADD32 (VAL1 : vector [2], VAL2 : vector [2]) : ADD
364 ;
365 ; FUNCTIONAL DESCRIPTION:
366 ;
367 ; This routine performs VAL2 = .VAL2 + .VAL1
368 ;
369 ; FORMAL PARAMETERS:
370 ;
371 ; VAL1 - address of 32-bit value
372 ; VAL2 - address of 32-bit value
373 ;
374 ; IMPLICIT INPUTS:
375 ;
376 ; None
377 ;
378 ; IMPLICIT OUTPUTS:
379 ;
380 ; None
381 ;
382 ; Routine Value:
383 ;
384 ; None
385 ;
386 ; SIDE EFFECTS:
387 ;
388 ; None
389 ;
390 ;--
391 ; .PSECT $CODE$,I,RO
392 .GLOBL $SAVE5
393 000306' $ADD32:: ;Add two 32 bit numbers
394 000306' 062021 ADD (R0)+,(R1)+
395 000310' 005511 ADC (R1)
396 000312' 061011 ADD (R0),(R1)
397 000314' 024041 CMP -(R0),-(R1)
398 000316' 000207 RETURN
399 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 10
NMUM11.M11 03-JAN-83 17:07 $SUB32 - SUBTRACT TWO 32 BIT NUMBERS
401 .SBTTL $SUB32 - Subtract two 32 bit numbers
402 ;++
403 ; linkage SUB = jsr (register = 0, register = 1);
404 ; global routine $SUB32 (VAL1 : vector [2], VAL2 : vector [2]) : SUB
405 ;
406 ; FUNCTIONAL DESCRIPTION:
407 ;
408 ; This routine performs VAL2 = .VAL2 - .VAL1
409 ;
410 ; FORMAL PARAMETERS:
411 ;
412 ; VAL1 - address of 32-bit value
413 ; VAL2 - address of 32-bit value
414 ;
415 ; IMPLICIT INPUTS:
416 ;
417 ; None
418 ;
419 ; IMPLICIT OUTPUTS:
420 ;
421 ; None
422 ;
423 ; Routine Value:
424 ;
425 ; None
426 ;
427 ; SIDE EFFECTS:
428 ;
429 ; None
430 ;
431 ;--
432 ; .PSECT $CODE$,I,RO
433 .GLOBL $SAVE5
434 000320' $SUB32:: ;Sub two 32 bit numbers
435 000320' 162021 SUB (R0)+,(R1)+
436 000322' 005611 SBC (R1)
437 000324' 161011 SUB (R0),(R1)
438 000326' 024041 CMP -(R0),-(R1)
439 000330' 000207 RETURN
440 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 11
NMUM11.M11 03-JAN-83 17:07 $SGN32 - RETURN SIGN OF 32 BIT NUMBER
442 .SBTTL $SGN32 - Return sign of 32 bit number
443 ;++
444 ; linkage SGN = jsr (register = 1);
445 ; global routine $SGN32 (VAL : vector [2]) : SGN
446 ;
447 ; FUNCTIONAL DESCRIPTION:
448 ;
449 ; This routine returns SIGN (.VAL)
450 ;
451 ; FORMAL PARAMETERS:
452 ;
453 ; VAL - address of 32-bit value
454 ;
455 ; IMPLICIT INPUTS:
456 ;
457 ; None
458 ;
459 ; IMPLICIT OUTPUTS:
460 ;
461 ; None
462 ;
463 ; Routine Value:
464 ;
465 ; -1 if .VAL lss 0
466 ; 0 if .VAL eql 0
467 ; +1 if .VAL gtr 0
468 ;
469 ; SIDE EFFECTS:
470 ;
471 ; None
472 ;
473 ;--
474 ; .PSECT $CODE$,I,RO
475 .GLOBL $SAVE5
476 000332' $SGN32:: ;Get sign of 32 bit number
477 000332' 005000 CLR R0
478 000334' 005761 000002 TST 2(R1)
479 000340' 002405 BLT 20$
480 000342' 003002 BGT 10$
481 000344' 005711 TST (R1)
482 000346' 001403 BEQ 30$
483 000350' 005200 10$: INC R0
484 000352' 000207 RETURN
485 000354' 005300 20$: DEC R0
486 000356' 000207 30$: RETURN
487 ;
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 12
NMUM11.M11 03-JAN-83 17:07 $SGN32 - RETURN SIGN OF 32 BIT NUMBER
489 ;
490 000001 .END
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 13
NMUM11.M11 03-JAN-83 17:07 CROSS REFERENCE TABLE -- USER SYMBOLS
CRLF 000106R 004 173 179#
CURTSK 000000RG 002 97# 154 165*
INTNST 046772RG 003 112#
MEMBOT 000000RG 003 109# 110
MEMTOP 046770RG 003 110# 347 351 355*
NMU$FA 000236RG 004 306#
PRVTSK 000002RG 002 98# 155* 161
SAVALL 000176R 004 160 227 265#
SAVER0 000006RG 002 100# 153* 159
SAVESP 000004RG 002 99# 218* 229
SS$COR 000242RG 004 344#
SS$CTX 000000RG 004 152#
SS$TNI 000112RG 004 216#
SS.MES= ****** G 169# 172 174
TB.CTX= ****** G 91# 162* 164 228*
TB.NAM= ****** G 169# 170
TB.STK= ****** G 91# 222
TB.STR= ****** G 91# 226
US.FIN= ****** G 215# 225
$ADD32 000306RG 004 393#
$SAVE5= ****** G 343# 345 392# 433# 475#
$SGN32 000332RG 004 476#
$SUB32 000320RG 004 434#
. = 000360R 004 109#
NMUM11 - NMU MCB SPECIFIC ASSEMBLY FUNCTIONS DNMAC X24.07-563 24-MAY-85 13:27 PAGE 14
NMUM11.M11 03-JAN-83 17:07 CROSS REFERENCE TABLE -- MACRO NAMES
ALUN$S 55#
POP 76# 230 269
PUSH 66# 217 265
QIOW$S 55#
. ABS. 000000 000 CON RW ABS LCL I
000000 001 CON RW ABS LCL I
$OWN$ 000010 002 CON RW REL LCL D
$$COR$ 046774 003 CON RW REL LCL D
$CODE$ 000360 004 CON RO REL LCL I
ERRORS DETECTED: 0
DEFAULT GLOBALS GENERATED: 0
NMUM11,NMUM11/CR=NMUM11
RUN-TIME: 1 .9 .2 SECONDS
RUN-TIME RATIO: 5/2=2.2
CORE USED: 5K (9 PAGES)