Home » Archimedes archive » Acorn User » AU 1994-06.adf » !QTM_Music » !QTMTrack/Extras/PrcsSpeed

!QTMTrack/Extras/PrcsSpeed

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-06.adf » !QTM_Music
Filename: !QTMTrack/Extras/PrcsSpeed
Read OK:
File size: 082E bytes
Load address: 0000
Exec address: 0000
File contents
    1REM     }  Real accurate timer  {
    2REM     }                       {
    3REM     }    LEN 1994  Phoenix    {
    4:
    5ON ERROR @%=&90A:REPORT:PRINT" at line ";ERL/10:END
    6@%=&0002020A
    7MODE0
    8PROCassm
    9PRINT"Processor usage monitor           � 1994 Phoenix/Quantum"
   10:
   11SYS "OS_ReadDynamicArea",1 TO rmaaddr%
   12IF rmaaddr%<>&1800000 THEN PRINT'"Sorry, this program only works on older machines":END
   13default%=&41440 :REM 36Mhz Arm3
   14av%=0
   15avcount%=0
   16OFF
   17REPEAT
   18A%=USR(settimer)
   19av%+=A%
   20avcount%+=1
   21pcnt=av%/avcount%/default%*100
   22PRINTTAB(0,2)"Last count (";avcount%;"): ";~A%
   23PRINTTAB(0,3)"Average counts: ";~av%/avcount%
   24PRINTTAB(0,5)"Average % processor used ";100-pcnt;"%"
   25PRINTTAB(0,6)"Average % processor free ";pcnt;"%"
   26UNTIL0
   27END
   28
   29
   30
   31DEF PROCassm
   32codelen%=4096
   33REM
   34DIM code% codelen%
   35j%=code%
   36REPEAT
   37REM IF (j% AND &F)=0 THEN PRINT"4wd, ";~j%,~code%:END
   38j%+=4
   39UNTIL (j% AND &F)=0
   40:
   41FOR opt%=8 TO 10 STEP 2
   42P%=j%:L%=code%+codelen%
   43[OPT opt%
   44.settimer
   45STMFD   R13!,{R1-R12,R14}
   46SWI     "OS_EnterOS"
   47TEQP    PC,#(1<<27) OR %11
   48:
   49MOV     R0,#&3200000
   50MOV     R1,#0
   51MOV     R2,#15                  ;15 times
   52MOV     R3,#&FF
   53MOV     R4,#0
   54.countdown
   55STRB    R3,[R0,#&50]            ;clunk the low byte of timer1
   56STRB    R3,[R0,#&54]            ;clonk the high byte of timer1
   57STRB    R3,[R0,#&58]            ;get it going then...
   58:
   59STRB    R4,[R0,#&50]            ;0 when finished
   60STRB    R4,[R0,#&54]            ;   "      "
   61:
   62.readloop
   63TEQP    PC,#(0<<27) OR %11
   64TEQP    PC,#(1<<27) OR %11
   65STRB    R0,[R0,#&5C]
   66LDRB    R5,[R0,#&50]
   67LDRB    R6,[R0,#&54]
   68ORRS    R5,R5,R6,LSL#8
   69ADDGT   R1,R1,#1
   70BGT     readloop
   71:
   72SUBS    R2,R2,#1
   73BNE     countdown
   74:
   75TEQP    PC,#0
   76:
   77MOV     R0,R1
   78LDMFD   R13!,{R1-R12,PC}
   79
   80
   81.readtimer
   82STMFD   R13!,{R1-R12,R14}
   83SWI     "OS_EnterOS"
   84MOV     R0,#&3200000
   85TEQP    PC,#(1<<27) OR %11
   86:
   87STRB    R0,[R0,#&5C]
   88LDRB    R3,[R0,#&50]
   89LDRB    R4,[R0,#&54]
   90:
   91TEQP    PC,#0
   92:
   93ORR     R0,R3,R4,LSL#8
   94LDMFD   R13!,{R1-R12,PC}
   95]
   96NEXT
   97ENDPROC
#�     }  Real accurate timer  {
#�     }                       {
#�     }    � 1994  Phoenix    {
:
%� � @%=&90A:�:�" at line ";�/10:�
@%=&0002020A
�0
	�assm
	?�"Processor usage monitor           � 1994 Phoenix/Quantum"

:
(ș "OS_ReadDynamicArea",1 � rmaaddr%
Q� rmaaddr%<>&1800000 � �'"Sorry, this program only works on older machines":�

!default%=&41440 :� 36Mhz Arm3
	av%=0
avcount%=0
�
�
A%=�(settimer)
av%+=A%
avcount%+=1
"pcnt=av%/avcount%/default%*100
+�0,2)"Last count (";avcount%;"): ";~A%
*�0,3)"Average counts: ";~av%/avcount%
2�0,5)"Average % processor used ";100-pcnt;"%"
.�0,6)"Average % processor free ";pcnt;"%"
�0
�



� �assm
 codelen%=4096
!�
"� code% codelen%
#j%=code%
$�
%7� IF (j% AND &F)=0 THEN PRINT"4wd, ";~j%,~code%:END
&	j%+=4
'� (j% � &F)=0
(:
)� opt%=8 � 10 � 2
*P%=j%:L%=code%+codelen%
+
[OPT opt%
,
.settimer
-STMFD   R13!,{R1-R12,R14}
.SWI     "OS_EnterOS"
/TEQP    PC,#(1<<27) � %11
0:
1MOV     R0,#&3200000
2MOV     R1,#0
3-MOV     R2,#15                  ;15 times
4MOV     R3,#&FF
5MOV     R4,#0
6.countdown
7ASTRB    R3,[R0,#&50]            ;clunk the low byte of timer1
8BSTRB    R3,[R0,#&54]            ;clonk the high byte of timer1
99STRB    R3,[R0,#&58]            ;get it going then...
::
;4STRB    R4,[R0,#&50]            ;0 when finished
<0STRB    R4,[R0,#&54]            ;   "      "
=:
>
.readloop
?TEQP    PC,#(0<<27) � %11
@TEQP    PC,#(1<<27) � %11
ASTRB    R0,[R0,#&5C]
BLDRB    R5,[R0,#&50]
CLDRB    R6,[R0,#&54]
D�RS    R5,R5,R6,LSL#8
EADDGT   R1,R1,#1
FBGT     readloop
G:
HSUBS    R2,R2,#1
IBNE     countdown
J:
KTEQP    PC,#0
L:
MMOV     R0,R1
NLDMFD   R13!,{R1-R12,PC}
O
P
Q.readtimer
RSTMFD   R13!,{R1-R12,R14}
SSWI     "OS_EnterOS"
TMOV     R0,#&3200000
UTEQP    PC,#(1<<27) � %11
V:
WSTRB    R0,[R0,#&5C]
XLDRB    R3,[R0,#&50]
YLDRB    R4,[R0,#&54]
Z:
[TEQP    PC,#0
\:
]�R     R0,R3,R4,LSL#8
^LDMFD   R13!,{R1-R12,PC}
_]
`�
a�
�
00000000  0d 00 01 23 f4 20 20 20  20 20 7d 20 20 52 65 61  |...#.     }  Rea|
00000010  6c 20 61 63 63 75 72 61  74 65 20 74 69 6d 65 72  |l accurate timer|
00000020  20 20 7b 0d 00 02 23 f4  20 20 20 20 20 7d 20 20  |  {...#.     }  |
00000030  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000040  20 20 20 20 20 7b 0d 00  03 23 f4 20 20 20 20 20  |     {...#.     |
00000050  7d 20 20 20 20 a9 20 31  39 39 34 20 20 50 68 6f  |}    . 1994  Pho|
00000060  65 6e 69 78 20 20 20 20  7b 0d 00 04 05 3a 0d 00  |enix    {....:..|
00000070  05 25 ee 20 85 20 40 25  3d 26 39 30 41 3a f6 3a  |.%. . @%=&90A:.:|
00000080  f1 22 20 61 74 20 6c 69  6e 65 20 22 3b 9e 2f 31  |." at line ";./1|
00000090  30 3a e0 0d 00 06 10 40  25 3d 26 30 30 30 32 30  |0:.....@%=&00020|
000000a0  32 30 41 0d 00 07 06 eb  30 0d 00 08 09 f2 61 73  |20A.....0.....as|
000000b0  73 6d 0d 00 09 3f f1 22  50 72 6f 63 65 73 73 6f  |sm...?."Processo|
000000c0  72 20 75 73 61 67 65 20  6d 6f 6e 69 74 6f 72 20  |r usage monitor |
000000d0  20 20 20 20 20 20 20 20  20 20 a9 20 31 39 39 34  |          . 1994|
000000e0  20 50 68 6f 65 6e 69 78  2f 51 75 61 6e 74 75 6d  | Phoenix/Quantum|
000000f0  22 0d 00 0a 05 3a 0d 00  0b 28 c8 99 20 22 4f 53  |"....:...(.. "OS|
00000100  5f 52 65 61 64 44 79 6e  61 6d 69 63 41 72 65 61  |_ReadDynamicArea|
00000110  22 2c 31 20 b8 20 72 6d  61 61 64 64 72 25 0d 00  |",1 . rmaaddr%..|
00000120  0c 51 e7 20 72 6d 61 61  64 64 72 25 3c 3e 26 31  |.Q. rmaaddr%<>&1|
00000130  38 30 30 30 30 30 20 8c  20 f1 27 22 53 6f 72 72  |800000 . .'"Sorr|
00000140  79 2c 20 74 68 69 73 20  70 72 6f 67 72 61 6d 20  |y, this program |
00000150  6f 6e 6c 79 20 77 6f 72  6b 73 20 6f 6e 20 6f 6c  |only works on ol|
00000160  64 65 72 20 6d 61 63 68  69 6e 65 73 22 3a e0 0d  |der machines":..|
00000170  00 0d 21 64 65 66 61 75  6c 74 25 3d 26 34 31 34  |..!default%=&414|
00000180  34 30 20 3a f4 20 33 36  4d 68 7a 20 41 72 6d 33  |40 :. 36Mhz Arm3|
00000190  0d 00 0e 09 61 76 25 3d  30 0d 00 0f 0e 61 76 63  |....av%=0....avc|
000001a0  6f 75 6e 74 25 3d 30 0d  00 10 05 87 0d 00 11 05  |ount%=0.........|
000001b0  f5 0d 00 12 12 41 25 3d  ba 28 73 65 74 74 69 6d  |.....A%=.(settim|
000001c0  65 72 29 0d 00 13 0b 61  76 25 2b 3d 41 25 0d 00  |er)....av%+=A%..|
000001d0  14 0f 61 76 63 6f 75 6e  74 25 2b 3d 31 0d 00 15  |..avcount%+=1...|
000001e0  22 70 63 6e 74 3d 61 76  25 2f 61 76 63 6f 75 6e  |"pcnt=av%/avcoun|
000001f0  74 25 2f 64 65 66 61 75  6c 74 25 2a 31 30 30 0d  |t%/default%*100.|
00000200  00 16 2b f1 8a 30 2c 32  29 22 4c 61 73 74 20 63  |..+..0,2)"Last c|
00000210  6f 75 6e 74 20 28 22 3b  61 76 63 6f 75 6e 74 25  |ount (";avcount%|
00000220  3b 22 29 3a 20 22 3b 7e  41 25 0d 00 17 2a f1 8a  |;"): ";~A%...*..|
00000230  30 2c 33 29 22 41 76 65  72 61 67 65 20 63 6f 75  |0,3)"Average cou|
00000240  6e 74 73 3a 20 22 3b 7e  61 76 25 2f 61 76 63 6f  |nts: ";~av%/avco|
00000250  75 6e 74 25 0d 00 18 32  f1 8a 30 2c 35 29 22 41  |unt%...2..0,5)"A|
00000260  76 65 72 61 67 65 20 25  20 70 72 6f 63 65 73 73  |verage % process|
00000270  6f 72 20 75 73 65 64 20  22 3b 31 30 30 2d 70 63  |or used ";100-pc|
00000280  6e 74 3b 22 25 22 0d 00  19 2e f1 8a 30 2c 36 29  |nt;"%"......0,6)|
00000290  22 41 76 65 72 61 67 65  20 25 20 70 72 6f 63 65  |"Average % proce|
000002a0  73 73 6f 72 20 66 72 65  65 20 22 3b 70 63 6e 74  |ssor free ";pcnt|
000002b0  3b 22 25 22 0d 00 1a 06  fd 30 0d 00 1b 05 e0 0d  |;"%".....0......|
000002c0  00 1c 04 0d 00 1d 04 0d  00 1e 04 0d 00 1f 0b dd  |................|
000002d0  20 f2 61 73 73 6d 0d 00  20 11 63 6f 64 65 6c 65  | .assm.. .codele|
000002e0  6e 25 3d 34 30 39 36 0d  00 21 05 f4 0d 00 22 14  |n%=4096..!....".|
000002f0  de 20 63 6f 64 65 25 20  63 6f 64 65 6c 65 6e 25  |. code% codelen%|
00000300  0d 00 23 0c 6a 25 3d 63  6f 64 65 25 0d 00 24 05  |..#.j%=code%..$.|
00000310  f5 0d 00 25 37 f4 20 49  46 20 28 6a 25 20 41 4e  |...%7. IF (j% AN|
00000320  44 20 26 46 29 3d 30 20  54 48 45 4e 20 50 52 49  |D &F)=0 THEN PRI|
00000330  4e 54 22 34 77 64 2c 20  22 3b 7e 6a 25 2c 7e 63  |NT"4wd, ";~j%,~c|
00000340  6f 64 65 25 3a 45 4e 44  0d 00 26 09 6a 25 2b 3d  |ode%:END..&.j%+=|
00000350  34 0d 00 27 11 fd 20 28  6a 25 20 80 20 26 46 29  |4..'.. (j% . &F)|
00000360  3d 30 0d 00 28 05 3a 0d  00 29 15 e3 20 6f 70 74  |=0..(.:..).. opt|
00000370  25 3d 38 20 b8 20 31 30  20 88 20 32 0d 00 2a 1b  |%=8 . 10 . 2..*.|
00000380  50 25 3d 6a 25 3a 4c 25  3d 63 6f 64 65 25 2b 63  |P%=j%:L%=code%+c|
00000390  6f 64 65 6c 65 6e 25 0d  00 2b 0d 5b 4f 50 54 20  |odelen%..+.[OPT |
000003a0  6f 70 74 25 0d 00 2c 0d  2e 73 65 74 74 69 6d 65  |opt%..,..settime|
000003b0  72 0d 00 2d 1d 53 54 4d  46 44 20 20 20 52 31 33  |r..-.STMFD   R13|
000003c0  21 2c 7b 52 31 2d 52 31  32 2c 52 31 34 7d 0d 00  |!,{R1-R12,R14}..|
000003d0  2e 18 53 57 49 20 20 20  20 20 22 4f 53 5f 45 6e  |..SWI     "OS_En|
000003e0  74 65 72 4f 53 22 0d 00  2f 1d 54 45 51 50 20 20  |terOS"../.TEQP  |
000003f0  20 20 50 43 2c 23 28 31  3c 3c 32 37 29 20 84 20  |  PC,#(1<<27) . |
00000400  25 31 31 0d 00 30 05 3a  0d 00 31 18 4d 4f 56 20  |%11..0.:..1.MOV |
00000410  20 20 20 20 52 30 2c 23  26 33 32 30 30 30 30 30  |    R0,#&3200000|
00000420  0d 00 32 11 4d 4f 56 20  20 20 20 20 52 31 2c 23  |..2.MOV     R1,#|
00000430  30 0d 00 33 2d 4d 4f 56  20 20 20 20 20 52 32 2c  |0..3-MOV     R2,|
00000440  23 31 35 20 20 20 20 20  20 20 20 20 20 20 20 20  |#15             |
00000450  20 20 20 20 20 3b 31 35  20 74 69 6d 65 73 0d 00  |     ;15 times..|
00000460  34 13 4d 4f 56 20 20 20  20 20 52 33 2c 23 26 46  |4.MOV     R3,#&F|
00000470  46 0d 00 35 11 4d 4f 56  20 20 20 20 20 52 34 2c  |F..5.MOV     R4,|
00000480  23 30 0d 00 36 0e 2e 63  6f 75 6e 74 64 6f 77 6e  |#0..6..countdown|
00000490  0d 00 37 41 53 54 52 42  20 20 20 20 52 33 2c 5b  |..7ASTRB    R3,[|
000004a0  52 30 2c 23 26 35 30 5d  20 20 20 20 20 20 20 20  |R0,#&50]        |
000004b0  20 20 20 20 3b 63 6c 75  6e 6b 20 74 68 65 20 6c  |    ;clunk the l|
000004c0  6f 77 20 62 79 74 65 20  6f 66 20 74 69 6d 65 72  |ow byte of timer|
000004d0  31 0d 00 38 42 53 54 52  42 20 20 20 20 52 33 2c  |1..8BSTRB    R3,|
000004e0  5b 52 30 2c 23 26 35 34  5d 20 20 20 20 20 20 20  |[R0,#&54]       |
000004f0  20 20 20 20 20 3b 63 6c  6f 6e 6b 20 74 68 65 20  |     ;clonk the |
00000500  68 69 67 68 20 62 79 74  65 20 6f 66 20 74 69 6d  |high byte of tim|
00000510  65 72 31 0d 00 39 39 53  54 52 42 20 20 20 20 52  |er1..99STRB    R|
00000520  33 2c 5b 52 30 2c 23 26  35 38 5d 20 20 20 20 20  |3,[R0,#&58]     |
00000530  20 20 20 20 20 20 20 3b  67 65 74 20 69 74 20 67  |       ;get it g|
00000540  6f 69 6e 67 20 74 68 65  6e 2e 2e 2e 0d 00 3a 05  |oing then.....:.|
00000550  3a 0d 00 3b 34 53 54 52  42 20 20 20 20 52 34 2c  |:..;4STRB    R4,|
00000560  5b 52 30 2c 23 26 35 30  5d 20 20 20 20 20 20 20  |[R0,#&50]       |
00000570  20 20 20 20 20 3b 30 20  77 68 65 6e 20 66 69 6e  |     ;0 when fin|
00000580  69 73 68 65 64 0d 00 3c  30 53 54 52 42 20 20 20  |ished..<0STRB   |
00000590  20 52 34 2c 5b 52 30 2c  23 26 35 34 5d 20 20 20  | R4,[R0,#&54]   |
000005a0  20 20 20 20 20 20 20 20  20 3b 20 20 20 22 20 20  |         ;   "  |
000005b0  20 20 20 20 22 0d 00 3d  05 3a 0d 00 3e 0d 2e 72  |    "..=.:..>..r|
000005c0  65 61 64 6c 6f 6f 70 0d  00 3f 1d 54 45 51 50 20  |eadloop..?.TEQP |
000005d0  20 20 20 50 43 2c 23 28  30 3c 3c 32 37 29 20 84  |   PC,#(0<<27) .|
000005e0  20 25 31 31 0d 00 40 1d  54 45 51 50 20 20 20 20  | %11..@.TEQP    |
000005f0  50 43 2c 23 28 31 3c 3c  32 37 29 20 84 20 25 31  |PC,#(1<<27) . %1|
00000600  31 0d 00 41 18 53 54 52  42 20 20 20 20 52 30 2c  |1..A.STRB    R0,|
00000610  5b 52 30 2c 23 26 35 43  5d 0d 00 42 18 4c 44 52  |[R0,#&5C]..B.LDR|
00000620  42 20 20 20 20 52 35 2c  5b 52 30 2c 23 26 35 30  |B    R5,[R0,#&50|
00000630  5d 0d 00 43 18 4c 44 52  42 20 20 20 20 52 36 2c  |]..C.LDRB    R6,|
00000640  5b 52 30 2c 23 26 35 34  5d 0d 00 44 19 84 52 53  |[R0,#&54]..D..RS|
00000650  20 20 20 20 52 35 2c 52  35 2c 52 36 2c 4c 53 4c  |    R5,R5,R6,LSL|
00000660  23 38 0d 00 45 14 41 44  44 47 54 20 20 20 52 31  |#8..E.ADDGT   R1|
00000670  2c 52 31 2c 23 31 0d 00  46 14 42 47 54 20 20 20  |,R1,#1..F.BGT   |
00000680  20 20 72 65 61 64 6c 6f  6f 70 0d 00 47 05 3a 0d  |  readloop..G.:.|
00000690  00 48 14 53 55 42 53 20  20 20 20 52 32 2c 52 32  |.H.SUBS    R2,R2|
000006a0  2c 23 31 0d 00 49 15 42  4e 45 20 20 20 20 20 63  |,#1..I.BNE     c|
000006b0  6f 75 6e 74 64 6f 77 6e  0d 00 4a 05 3a 0d 00 4b  |ountdown..J.:..K|
000006c0  11 54 45 51 50 20 20 20  20 50 43 2c 23 30 0d 00  |.TEQP    PC,#0..|
000006d0  4c 05 3a 0d 00 4d 11 4d  4f 56 20 20 20 20 20 52  |L.:..M.MOV     R|
000006e0  30 2c 52 31 0d 00 4e 1c  4c 44 4d 46 44 20 20 20  |0,R1..N.LDMFD   |
000006f0  52 31 33 21 2c 7b 52 31  2d 52 31 32 2c 50 43 7d  |R13!,{R1-R12,PC}|
00000700  0d 00 4f 04 0d 00 50 04  0d 00 51 0e 2e 72 65 61  |..O...P...Q..rea|
00000710  64 74 69 6d 65 72 0d 00  52 1d 53 54 4d 46 44 20  |dtimer..R.STMFD |
00000720  20 20 52 31 33 21 2c 7b  52 31 2d 52 31 32 2c 52  |  R13!,{R1-R12,R|
00000730  31 34 7d 0d 00 53 18 53  57 49 20 20 20 20 20 22  |14}..S.SWI     "|
00000740  4f 53 5f 45 6e 74 65 72  4f 53 22 0d 00 54 18 4d  |OS_EnterOS"..T.M|
00000750  4f 56 20 20 20 20 20 52  30 2c 23 26 33 32 30 30  |OV     R0,#&3200|
00000760  30 30 30 0d 00 55 1d 54  45 51 50 20 20 20 20 50  |000..U.TEQP    P|
00000770  43 2c 23 28 31 3c 3c 32  37 29 20 84 20 25 31 31  |C,#(1<<27) . %11|
00000780  0d 00 56 05 3a 0d 00 57  18 53 54 52 42 20 20 20  |..V.:..W.STRB   |
00000790  20 52 30 2c 5b 52 30 2c  23 26 35 43 5d 0d 00 58  | R0,[R0,#&5C]..X|
000007a0  18 4c 44 52 42 20 20 20  20 52 33 2c 5b 52 30 2c  |.LDRB    R3,[R0,|
000007b0  23 26 35 30 5d 0d 00 59  18 4c 44 52 42 20 20 20  |#&50]..Y.LDRB   |
000007c0  20 52 34 2c 5b 52 30 2c  23 26 35 34 5d 0d 00 5a  | R4,[R0,#&54]..Z|
000007d0  05 3a 0d 00 5b 11 54 45  51 50 20 20 20 20 50 43  |.:..[.TEQP    PC|
000007e0  2c 23 30 0d 00 5c 05 3a  0d 00 5d 19 84 52 20 20  |,#0..\.:..]..R  |
000007f0  20 20 20 52 30 2c 52 33  2c 52 34 2c 4c 53 4c 23  |   R0,R3,R4,LSL#|
00000800  38 0d 00 5e 1c 4c 44 4d  46 44 20 20 20 52 31 33  |8..^.LDMFD   R13|
00000810  21 2c 7b 52 31 2d 52 31  32 2c 50 43 7d 0d 00 5f  |!,{R1-R12,PC}.._|
00000820  05 5d 0d 00 60 05 ed 0d  00 61 05 e1 0d ff        |.]..`....a....|
0000082e