CLEAR Standalone physical memory clear program 20-MAY-1982 19:57:46 VAX-11 Macro V02.46 Page 1 02 20-MAY-1982 19:57:34 SYS$SYSROOT:[ARCEXE.SOURCE]CLEAR.M(1) 0000 1 .title clear Standalone physical memory clear program for VAX 11/780 0000 2 .ident \02\ 0000 3 0000 4 ; Written by Frank Roberson - April 81 0000 5 ; System Development Corporation 0000 6 ; 4810 Bradford Blvd. NW 0000 7 ; Huntsville, AL 35805 0000 8 ; (205) 837-7610 0000 9 0000 10 ; Modified: 0000 11 ; Frank Roberson 0000 12 ; May 1982 0000 13 ; Modify comments. 0000 14 0000 15 ; This program is designed to satisfy security requirements 0000 16 ; by zeroing all physical memory on the VAX. The program 0000 17 ; will find out how much physical memory is on the machine 0000 18 ; and clear it all. 0000 19 0000 20 ; Build this program by using the following commands: 0000 21 0000 22 ; MACRO CLEAR 0000 23 ; LINK/SYSTEM=0 CLEAR 0000 24 0000 25 ; ************************************************************** 0000 26 ; *THIS PROGRAM HAS NOT BEEN APPROVED BY ANY GOVERNMENT AGENCY!* 0000 27 ; ************************************************************** 0000 28 0000 29 .library /SYS$LIBRARY:LIB/ 0000 30 $io780def 0000 31 $prdef 0000 32 0000 33 .macro hexout number,buffer 0000 34 pushab buffer 0000 35 pushl number 0000 36 calls #2,btoa 0000 37 .endm 0000 38 0000 39 .macro print message 0000 40 pushab message 0000 41 calls #1,prt 0000 42 .endm 0000 43 00000000 44 .psect memclear,page 5E 00000294'EF 9E 0000 45 start: movab stack+99,sp ;Set up the stack pointer. 50 D4 0007 46 clrl r0 ;Get a zero. 38 50 DA 0009 47 mtpr r0,#pr$_mapen ;Disable memory mapping. 52 20000000 8F D0 000C 48 movl #io780$al_iobase,r2 ;Start of I/O address space. 52 00002000 8F C0 0013 49 addl2 #io780$al_pernex,r2 ;Get to memory configuration registers. 53 62 D0 001A 50 movl (r2),r3 ;Get Memory Configuration Register A. 54 53 07 09 EF 001D 51 extzv #9,#7,r3,r4 ;Get memory size. (number of 64K's) 54 D6 0022 52 incl r4 ;So we get the real number. 55 54 10 78 0024 53 ashl #16,r4,r5 ;Number of bytes of physical memory. 0028 54 hexout r5,sizea ;Fill in how memory this machine has. 0037 55 hexout #memstart,sizeb ;Fill in where clear starts. 004A 56 print size ;Say all that stuff. 0057 57 ; movl #100,r7 ;Pass count. CLEAR Standalone physical memory clear program 20-MAY-1982 19:57:46 VAX-11 Macro V02.46 Page 2 02 20-MAY-1982 19:57:34 SYS$SYSROOT:[ARCEXE.SOURCE]CLEAR.M(1) 57 0A D0 0057 58 movl #10,r7 ;Pass count. 56 00000298'EF 7E 005A 59 1$: movaq memstart,r6 ;Address of where to start the clear. 66 00000229'EF 7D 0061 60 10$: movq ones,(r6) ;Set a quad word to all one's. 66 7C 0068 61 clrd (r6) ;Clear the quad word. 66 73 006A 62 tstd (r6) ;Verify that it is clear. 27 12 006C 63 bnequ 30$ ;Bad news! 56 08 C0 006E 64 addl2 #8,r6 ;Go to next quad word. 55 56 D1 0071 65 cmpl r6,r5 ;Are we at the end yet? EB 12 0074 66 bnequ 10$ ;Do the next quad word. 0076 67 print ding ;Ring the bell after every pass. 57 D7 0083 68 decl r7 ;Decrement the pass count D3 12 0085 69 bnequ 1$ ;Branch if more passes to do. 0087 70 20$: print ok_msg ;Say everything is ok. 00 0094 71 21$: halt 0095 72 30$: print bad_msg ;Say everything is NOT ok. 00 00A2 73 halt 00A3 74 ;+ 00A3 75 ; Routine to print ASCIZ string on console. 00A3 76 ; Input: 00A3 77 ; 4(ap) address of ASCIZ string. 00A3 78 ; 00A3 79 ; Output: 00A3 80 ; ASCII characters on OPA0: 00A3 81 ;- 0006 00A3 82 prt: .word ^M ;Save r1 and r2. 51 04 AC D0 00A5 83 movl 4(ap),r1 ;Get address of start of string. 50 81 9A 00A9 84 10$: movzbl (r1)+,r0 ;Get a character. 01 12 00AC 85 bneq 20$ ;If non-zero then not at end yet. 04 00AE 86 ret ;Back from whence we came. 52 22 DB 00AF 87 20$: mfpr #Pr$_txcs,r2 ;Get printer status. F9 52 07 E1 00B2 88 bbc #7,r2,20$ ;If bit is clear then not ready. 23 50 DA 00B6 89 mtpr r0,#pr$_txdb ;Output the character. EE 11 00B9 90 brb 10$ ;Try for next one. 00BB 91 ; 00BB 92 ; Convert binary to hexadecimal ASCII. 00BB 93 ; 00BB 94 ; Input: 00BB 95 ; 4(ap) - longword to be converted. 00BB 96 ; 8(ap) - address of buffer to store output 00BB 97 ; 00BB 98 ; Output: 00BB 99 ; ASCII representation of 4(ap) 00BB 100 ; 000E 00BB 101 btoa: .word ^M ;Save r1, r2 and r3. 50 04 AC D0 00BD 102 movl 4(ap),r0 ;Get number to convert. 53 08 AC D0 00C1 103 movl 8(ap),r3 ;Get buffer address. 51 08 9A 00C5 104 movzbl #8,r1 ;Number of characters to convert. 52 50 04 1C EF 00C8 105 10$: extzv #28,#4,r0,r2 ;Get a nibble. Start at LSB. 63 00000219'EF42 90 00CD 106 movb digits[r2],(r3) ;Get ASCII digit and store in buffer. 50 50 04 9C 00D5 107 rotl #4,r0,r0 ;Shift the number to the next nibble. 53 D6 00D9 108 incl r3 ;Move to next place in output buffer. 51 D7 00DB 109 decl r1 ;Check for 8 characters. E9 12 00DD 110 bneq 10$ ;Not yet. 04 00DF 111 ret ;All done. 00E0 112 0D'0A 7F'7F'7F'7F'7F'7F'7F'7F'7F'7F' 00E0 113 size: .byte +127[10],10,13[3] ;Pad front of message with nulls. 0D'0D' 00EC CLEAR Standalone physical memory clear program 20-MAY-1982 19:57:46 VAX-11 Macro V02.46 Page 3 02 20-MAY-1982 19:57:34 SYS$SYSROOT:[ARCEXE.SOURCE]CLEAR.M(1) 73 65 63 6F 72 70 20 73 69 68 54 20 00EE 114 .ascii \ This processor has \ 20 73 61 68 20 72 6F 73 00FA 20'20'20'20'20'20'20'20' 0102 115 sizea: .byte 32[8] ;Place to put memory size. 68 70 20 66 6F 20 73 65 74 79 62 20 010A 116 .ascii \ bytes of physical memory.\ 72 6F 6D 65 6D 20 6C 61 63 69 73 79 0116 2E 79 0122 0D 0A 0124 117 .byte 10,13 65 68 74 20 74 75 62 20 6C 6C 41 20 0126 118 .ascii \ All but the first \ 20 74 73 72 69 66 20 0132 20'20'20'20'20'20'20'20' 0139 119 sizeb: .byte 32[8] ;Place to put length of this program. 65 6D 20 66 6F 20 73 65 74 79 62 20 0141 120 .ascii \ bytes of memory will be cleared/declassified. \ 65 62 20 6C 6C 69 77 20 79 72 6F 6D 014D 63 65 64 2F 64 65 72 61 65 6C 63 20 0159 20 2E 64 65 69 66 69 73 73 61 6C 0165 0D 0A 0170 121 .byte 10,13 61 72 67 6F 72 70 20 73 69 68 54 20 0172 122 .ascii \ This program occupies that portion. \ 74 20 73 65 69 70 75 63 63 6F 20 6D 017E 2E 6E 6F 69 74 72 6F 70 20 74 61 68 018A 20 0196 00 0D'0D'0D'0A 0197 123 .byte 10,13[3],0 00 07 019C 124 ding: .byte 7,0 61 65 6C 63 20 79 72 6F 6D 65 4D 20 019E 125 ok_msg: .ascii \ Memory clear/declassify complete.\ 79 66 69 73 73 61 6C 63 65 64 2F 72 01AA 2E 65 74 65 6C 70 6D 6F 63 20 01B6 00 0D'0D'0D'0A 01C0 126 .byte 10,13[3],0 7F'7F'7F'7F'7F'7F'7F'7F'7F'7F' 01C5 127 bad_msg:.byte +127[10] ;Pad front of message with nulls. 65 6C 69 61 66 20 72 61 65 6C 43 20 01CF 128 .ascii \ Clear failed! \ 20 20 21 64 01DB 66 20 36 52 20 65 6E 69 6D 61 78 45 01DF 129 .ascii \Examine R6 for failing address.\ 61 20 67 6E 69 6C 69 61 66 20 72 6F 01EB 2E 73 73 65 72 64 64 01F7 07'07'07'07'07'07'07'07'07'07'07'07' 01FE 130 .byte 7[20],10,13[5],0 0D'0D'0D'0A 07'07'07'07'07'07'07'07' 020A 00 0D'0D' 0216 42 41 39 38 37 36 35 34 33 32 31 30 0219 131 digits: .ascii \0123456789ABCDEF\ 46 45 44 43 0225 FFFFFFFF FFFFFFFF 0229 132 ones: .quad ^Xffffffffffffffffff 00000295 0231 133 stack: .blkb 100 ;A few bytes for the stack. 0295 134 .align quad 000002A0 0298 135 memstart: .blkq 1 ;Start clearing memory here. 02A0 136 .end start CLEAR Standalone physical memory clear program 20-MAY-1982 19:57:46 VAX-11 Macro V02.46 Page 4 Symbol table 20-MAY-1982 19:57:34 SYS$SYSROOT:[ARCEXE.SOURCE]CLEAR.M(1) BAD_MSG 000001C5 R 03 PR$_RXDB = 00000021 BTOA 000000BB R 03 PR$_SBIER = 00000034 DIGITS 00000219 R 03 PR$_SBIFS = 00000030 DING 0000019C R 03 PR$_SBIMT = 00000033 IO780$AL_IOBASE= 20000000 PR$_SBIQC = 00000036 IO780$AL_NNEX = 00000010 PR$_SBIS = 00000031 IO780$AL_PERNEX= 00002000 PR$_SBISC = 00000032 IO780$AL_UB0SP = 20100000 PR$_SBITA = 00000035 MEMSTART 00000298 R 03 PR$_SBR = 0000000C OK_MSG 0000019E R 03 PR$_SCBB = 00000011 ONES 00000229 R 03 PR$_SID = 0000003E PR$S_SID_ECO = 00000009 PR$_SID_TYP730 = 00000003 PR$S_SID_PL = 00000003 PR$_SID_TYP750 = 00000002 PR$S_SID_SN = 0000000C PR$_SID_TYP780 = 00000001 PR$S_SID_TYPE = 00000008 PR$_SID_TYP7VV = 00000004 PR$V_SID_ECO = 0000000F PR$_SID_TYPMAX = 00000004 PR$V_SID_PL = 0000000C PR$_SIRR = 00000014 PR$V_SID_SN = 00000000 PR$_SISR = 00000015 PR$V_SID_TYPE = 00000018 PR$_SLR = 0000000D PR$_ACCR = 00000029 PR$_SSP = 00000002 PR$_ACCS = 00000028 PR$_TBCHK = 0000003F PR$_ASTLVL = 00000013 PR$_TBDR = 00000024 PR$_CADR = 00000025 PR$_TBIA = 00000039 PR$_CAER = 00000027 PR$_TBIS = 0000003A PR$_CMIERR = 00000017 PR$_TODR = 0000001B PR$_CRBT = 00000043 PR$_TXCS = 00000022 PR$_CSRD = 0000001D PR$_TXDB = 00000023 PR$_CSRS = 0000001C PR$_UBRESET = 00000037 PR$_CSTD = 0000001F PR$_USP = 00000003 PR$_CSTS = 0000001E PR$_WCSA = 0000002C PR$_CSWP = 00000042 PR$_WCSD = 0000002D PR$_ESP = 00000001 PRT 000000A3 R 03 PR$_ICCS = 00000018 SIZE 000000E0 R 03 PR$_ICR = 0000001A SIZEA 00000102 R 03 PR$_IPL = 00000012 SIZEB 00000139 R 03 PR$_ISP = 00000004 STACK 00000231 R 03 PR$_KSP = 00000000 START 00000000 R 03 PR$_MAPEN = 00000038 PR$_MCESR = 00000026 PR$_MCTL1 = 00000044 PR$_MCTL2 = 00000045 PR$_MDCR1 = 00000049 PR$_MEAR = 00000048 PR$_MECCR = 0000004B PR$_MEDR = 0000004A PR$_MGEN = 00000046 PR$_MTBER = 00000047 PR$_NICR = 00000019 PR$_P0BR = 00000008 PR$_P0LR = 00000009 PR$_P1BR = 0000000A PR$_P1LR = 0000000B PR$_PAMACC = 00000040 PR$_PAMLOC = 00000041 PR$_PCBB = 00000010 PR$_PME = 0000003D PR$_RXCS = 00000020 CLEAR Standalone physical memory clear program 20-MAY-1982 19:57:46 VAX-11 Macro V02.46 Page 5 Psect synopsis 20-MAY-1982 19:57:34 SYS$SYSROOT:[ARCEXE.SOURCE]CLEAR.M(1) +----------------+ ! Psect synopsis ! +----------------+ PSECT name Allocation PSECT No. Attributes ---------- ---------- --------- ---------- . ABS . 00000000 ( 0.) 00 ( 0.) NOPIC USR CON ABS LCL NOSHR NOEXE NORD NOWRT NOVEC BYTE . BLANK . 00000000 ( 0.) 01 ( 1.) NOPIC USR CON REL LCL NOSHR EXE RD WRT NOVEC BYTE $ABS$ 00000000 ( 0.) 02 ( 2.) NOPIC USR CON ABS LCL NOSHR EXE RD WRT NOVEC BYTE MEMCLEAR 000002A0 ( 672.) 03 ( 3.) NOPIC USR CON REL LCL NOSHR EXE RD WRT NOVEC PAGE +------------------------+ ! Performance indicators ! +------------------------+ Phase Page faults CPU Time Elapsed Time ----- ----------- -------- ------------ Initialization 26 00:00:00.04 00:00:00.13 Command processing 24 00:00:00.20 00:00:00.47 Pass 1 303 00:00:01.56 00:00:02.03 Symbol table sort 0 00:00:00.08 00:00:00.08 Pass 2 77 00:00:00.42 00:00:00.53 Symbol table output 14 00:00:00.07 00:00:00.07 Psect synopsis output 5 00:00:00.02 00:00:00.02 Cross-reference output 0 00:00:00.00 00:00:00.00 Assembler run totals 454 00:00:02.40 00:00:03.34 The working set limit was 394 pages. 7703 bytes (16 pages) of virtual memory were used to buffer the intermediate code. There were 10 pages of symbol table space allocated to hold 94 non-local and 8 local symbols. 136 source lines were read in Pass 1, producing 14 object records in Pass 2. 11 pages of virtual memory were used to define 10 macros. +--------------------------+ ! Macro library statistics ! +--------------------------+ Macro library name Macros defined ------------------ -------------- SYS$SYSROOT:[SYSLIB]LIB.MLB;1 1 SYS$SYSROOT:[SYSLIB]STARLET.MLB;1 4 TOTALS (all libraries) 5 150 GETS were required to define 5 macros. There were no errors, warnings or information messages. /LIST CLEAR