Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/listings/tkb-vnp/wtsk.bpt
There are no other files named wtsk.bpt in the archive.
		DSK:WTSK.XRF[4,31]               31-Aug-79 15:08

   1	!<SAUTER.TKB20>WTSK.BLI.9, 20-Nov-78 06:57:21, Edit by SROBINSON
   2	MODULE WTSK (					!WRITE TASK FILE
   3			IDENT = 'X0.1-1A'
   4			) =
   5	BEGIN
   6	!
   7	!
   8	!
   9	! COPYRIGHT (C) 1978 BY
  10	! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
  11	!
  12	!
  13	! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
  14	! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
  15	! INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
  16	! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
  17	! OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
  18	! TRANSFERRED.
  19	!
  20	!
  21	! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
  22	! AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
  23	! CORPORATION.
  24	!
  25	! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
  26	! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
  27	!
  28	
  29	!++
  30	! FACILITY: TKB-20
  31	!
  32	! ABSTRACT:
  33	!
  34	!
  35	! THIS MODULE WRITES THE TASK FILE, IN RSX-11M VERSION 3 FORMAT.
  36	!
  37	!
  38	! ENVIRONMENT: TOPS-20 USER MODE
  39	!
  40	! AUTHOR: J. SAUTER, CREATION DATE: 14-MAR-78
  41	!
  42	! MODIFIED BY:
  43	!
  44	!	, : VERSION
  45	! 01	-
  46	!--
  47	
  48	!<BLF/PAGE>
		DSK:WTSK.XRF[4,31]               31-Aug-79 15:08

  49	!
  50	! TABLE OF CONTENTS:
  51	!
  52	
  53	FORWARD ROUTINE
  54	    GET11,					!GET A BYTE FROM PDP-11 CORE
  55	    WTSK : NOVALUE;				!WRITE TASK FILE
  56	
  57	!
  58	! INCLUDE FILES
  59	!
  60	
  61	LIBRARY 'VNP-LIB.L36';
  62	
  63	!REQUIRE 'BLOCKH.REQ';				!PREPARE TO DEFINE STORAGE BLOCKS
  64	!REQUIRE 'FILE.REQ';				!FILE DATA BLOCK
  65	!REQUIRE 'FILSW.REQ';				!SWITCH STORAGE BLOCK
  66	!REQUIRE 'BLOCKT.REQ';				!END OF STORAGE BLOCK DEFINITIONS
  67	
  68	!
  69	! MACROS:
  70	!
  71	!	NONE
  72	!
  73	! EQUATED SYMBOLS:
  74	!
  75	
  76	LITERAL
  77	    DEBUG = 0;
  78	
  79	!
  80	! OWN STORAGE:
  81	!
  82	!	NONE
  83	!
  84	! EXTERNAL REFERENCES:
  85	!
  86	
  87	EXTERNAL ROUTINE
  88	    ERRMSG : NOVALUE,				!TYPE AN ERROR MESSAGE
  89	    ERROR : NOVALUE,				!SIGNAL AN INTERNAL ERROR
  90	    OUTNUM : NOVALUE,				!WRITE A NUMBER ON A FILE
  91	    OUTPUT : NOVALUE;				!WRITE ON A FILE
  92	
		DSK:WTSK.XRF[4,31]               31-Aug-79 15:08

  93	ROUTINE GET11 (CORE_IMAGE, CORE_SIZE, ADDRESS) = 	!GET A BYTE FROM PDP-11 CORE
  94	
  95	!++
  96	! FUNCTIONAL DESCRIPTION:
  97	!
  98	!
  99	!	ROUTINE TO GET A BYTE OF DATA FROM SIMUALTED PDP-11 CORE
 100	!
 101	!
 102	! FORMAL PARAMETERS:
 103	!
 104	!	CORE_IMAGE - SIMULATED PDP-11 MEMORY
 105	!	CORE_SIZE - LENGTH OF SIMULATED PDP-11 MEMORY
 106	!	ADDRESS - PLACE TO GET THE BYTE FROM
 107	!
 108	! IMPLICIT INPUTS:
 109	!
 110	!	NONE
 111	!
 112	! IMPLICIT OUTPUTS:
 113	!
 114	!	NONE
 115	!
 116	! ROUTINE VALUE:
 117	!
 118	!	THE BYTE FROM THE SPECIFIED LOCATION
 119	!
 120	! SIDE EFFECTS
 121	!
 122	!	NONE
 123	!
 124	!--
 125	
 126	    BEGIN
 127	
 128	    BIND
 129		ROUTINE_NAME = UPLIT (%ASCIZ'GET11');
 130	
 131	    MAP
 132		CORE_IMAGE : REF VECTOR;
 133	
 134	    LOCAL
 135		ADDR1,
 136		ADDR2,
 137		BYTE_VAL,
 138		CORE_WORD;
 139	
 140	    IF (.ADDRESS GEQU .CORE_SIZE)
 141	    THEN
 142		BEGIN
 143		ERROR (UPLIT (%ASCIZ'ADDRESS OUT OF RANGE - GET11'));
 144		0;
 145		END
 146	    ELSE
 147		BEGIN
 148		ADDR1 = .ADDRESS/4;
		DSK:WTSK.XRF[4,31]               31-Aug-79 15:08

 149		ADDR2 = .ADDRESS MOD 4;
 150		CORE_WORD = .CORE_IMAGE [.ADDR1];
 151		BYTE_VAL = .CORE_WORD<(CASE .ADDR2 FROM 0 TO 3 OF
 152			SET
 153			[0] : 18;
 154			[1] : 26;
 155			[2] : 0;
 156			[3] : 8;
 157			TES), 8>;
 158		.BYTE_VAL
 159		END
 160	
 161	    END;					!OF GET11
 162	
		DSK:WTSK.XRF[4,31]               31-Aug-79 15:08

 163	GLOBAL ROUTINE WTSK (CORE_IMAGE, CORE_SIZE, LBL_IMAGE, LBL_SIZE, FILE_PTR, CHAN) : NOVALUE =
 164							!WRITE CORE IMAGE
 165	
 166	!++
 167	! FUNCTIONAL DESCRIPTION:
 168	!
 169	!
 170	!	ROUTINE TO WRITE OUT THE TASK FILE
 171	!
 172	!
 173	! FORMAL PARAMETERS:
 174	!
 175	!	CORE_IMAGE - SIMULATED PDP-11 MEMORY
 176	!	CORE_SIZE - LENGTH OF SIMULATED PDP-11 MEMORY
 177	!	LBL_IMAGE - POINTER TO THE TASK'S LABEL BLOCKS
 178	!	LBL_SIZE - LENGTH OF THE LABEL, IN BYTES
 179	!	FILE_PTR - POINTER TO THE FILE ON WHICH TO WRITE THE CORE IMAGE
 180	!	CHAN - CHANNEL ON WHICH THE FILE IS OPEN, IN BINARY MODE
 181	!
 182	! IMPLICIT INPUTS:
 183	!
 184	!	NONE
 185	!
 186	! IMPLICIT OUTPUTS:
 187	!
 188	!	NONE
 189	!
 190	! ROUTINE VALUE:
 191	!
 192	!	NONE
 193	!
 194	! SIDE EFFECTS
 195	!
 196	!	WRITES ON THE SPECIFIED FILE
 197	!
 198	!--
 199	
 200	    BEGIN
 201	
 202	    BIND
 203		ROUTINE_NAME = UPLIT (%ASCIZ'WTSK');
 204	
 205	    MAP
 206		CORE_IMAGE : REF VECTOR,
 207		LBL_IMAGE : REF VECTOR;
 208	
 209	    LOCAL
 210		BYTE_VAL;
 211	
 212	!
 213	! FIRST WRITE OUT THE LABEL BLOCKS
 214	!
 215	
 216	    INCR COUNTER FROM 0 TO .LBL_SIZE - 1 DO
 217		BEGIN
 218		BYTE_VAL = .LBL_IMAGE [.COUNTER];
		DSK:WTSK.XRF[4,31]               31-Aug-79 15:08

 219		OUTPUT (.CHAN, .BYTE_VAL);
 220		END;
 221	
 222	!
 223	! NOW WRITE OUT THE CORE IMAGE
 224	!
 225	
 226	    INCR COUNTER FROM 0 TO .CORE_SIZE - 1 DO
 227		BEGIN
 228		BYTE_VAL = GET11 (.CORE_IMAGE, .CORE_SIZE, .COUNTER);
 229		OUTPUT (.CHAN, .BYTE_VAL);
 230		END;
 231	
 232	    END;					!OF WTSK
 233	
 234	END
 235	
 236	ELUDOM
 237	! Local Modes:
 238	! Comment Start:!
 239	! Comment Column:36
 240	! Mode:Fundamental
 241	! Auto Save Mode:2
 242	! End:
		DSK:WTSK.XRF[4,31]               31-Aug-79 15:08

ADDR1		 135	 148#	 150
ADDR2		 136	 149#	 151
ADDRESS		  93	 140	 148	 149
BYTE_VAL	 137	 151#	 158	 210	 218#	 219	 228#
		 229
CHAN		 163	 219	 229
CORE_IMAGE	  93	 132	 150	 163	 206	 228
CORE_SIZE	  93	 140	 163	 226	 228
CORE_WORD	 138	 150#	 151
COUNTER		 216	 218	 226	 228
ERRMSG		  88*
ERROR		  89	 143
FILE_PTR	 163
GET11		  54	  93*	 228
LBL_IMAGE	 163	 207	 218
LBL_SIZE	 163	 216
OUTNUM		  90
OUTPUT		  91	 219	 229
ROUTINE_NAME	 129#	 203#
WTSK		   2#	  55#	 163*