⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 taskwin2.html

📁 英文版
💻 HTML
字号:
<!doctype html public "-//W3C//DTD HTML 3.2//EN"><html><head><title>An even better TaskWindow</title><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><meta http-equiv="content-language" content="en" /><meta name="resource-type" content="document"><meta name="copyright" content="This document copyright 2002 by Richard Murray, code copyright Chris Manning. Use for non-profit and education purposes explicitly granted."><meta name="author" content="Richard Murray"><meta name="rating" content="general"></head><!--  /assembler/taskwin2.html           --><!--                                     --><!--  (C) Copyright 2002 Richard Murray  --><!--  Code by Chris Manning (C) 2002     --><!--  Designed by Richard Murray         --><!--  rmurray@heyrick.co.uk              --><!--                                     --><body bgcolor="#f0f0f0" text="#000000" link="#0022dd" vlink="#002288"><table border = "0" width="100%">  <tr>    <td align=center width=100>      <img src="arm3.gif" width=79 height=78 align = middle>    </td>    <td>      <h1 align="center"><font color="#800080">An even better TaskWindow</font></h1>    </td>    <td align=center width=100>      <img src="arm3.gif" width=79 height=78 align = middle>    </td></table><p>&nbsp;<p>Following the aforementioned TaskWindow speed-ups, Chris Manning decided to go one better andimplement a variable poll-rate method.<p>Please note that this code is for, I think, the TaskWindow module part of RISC OS 4. It does notwork here, with RISC OS 3.70. I suspect the offset is wrong but I've not looked into it. Acrashed TaskWindow needs lots of TaskKilling (five or six times, twice), so be sure you have atask killer module ready...<br>For those of you with the correct TaskWindow module, Chris is using it on his system and itseems quite happy.<p>&nbsp;<p>The changes to the TaskWindow module are:<pre>   00000320 : 03A03034 : MOVEQ   R3,#&amp;34   00000330 : 7A000896 : BVC     &amp;00002590   0000141C : E59B0004 : LDR     R0,[R11,#4]   00001420 : E590302C : LDR     R3,[R0,#&amp;02C]   00001424 : EB00045E : BL      &amp;000025A4   00002590 : E3A0E00F : MOV     R14,#&amp;0F   00002594 : E58CE02C : STR     R14,[R12,#&amp;02C]   00002598 : E58CE030 : STR     R14,[R12,#&amp;030]   0000259C : E3A0E000 : MOV     R14,#0   000025A0 : EAFFF763 : B       &amp;00000334   000025A4 : E2533001 : SUBS    R3,R3,#1   000025A8 : 05903030 : LDREQ   R3,[R0,#&amp;030]   000025AC : E580302C : STR     R3,[R0,#&amp;02C]   000025B0 : E3A00000 : MOV     R0,#0   000025B4 : E3A03000 : MOV     R3,#0   000025B8 : 11A0F00E : MOVNE   PC,R14   000025BC : EAFFFDC8 : B       &amp;00001CE4</pre><p>&nbsp;<p>This is backed up by the following code. It creates a file (in WimpScrap) which can be used toview or set the TaskWindow polling rate. The default rate is 15.<pre>   REM &gt;Source:Util.TaskWindowPollRate   ON ERROR ON ERROR OFF: PROCerror: END   buf_size%=4096   DIM buf% buf_size%-1   :   name$=&quot;TaskWindowPollRate&quot;   filename$=name$   :   bufsize%=256   mininterval%=1   maxinterval%=255   defaultinterval%=15   :   FlagF%=1&lt;&lt;26   FlagI%=1&lt;&lt;27   FlagV%=1&lt;&lt;28   FlagC%=1&lt;&lt;29   FlagZ%=1&lt;&lt;30   FlagN%=1&lt;&lt;31   :   L%=buf%+buf_size%   FOR opt%=12 TO 15 STEP 3     P%=0     O%=buf%     [           OPT      opt%                 ;                 ;        r0   -&gt;  command line                 ;        r1   -&gt;  command tail                 ;        r12  -&gt;  workspace (1kB)                 ;        r13  -&gt;  stack                 ;                 STMFD    r13!,{r14}                 LDRB     r0,[r1]              ; First character of parameter                 CMP      r0,#ASC(&quot; &quot;)         ; No param means the current                 MVNLE    r6,#0                ;  value is to be displayed                 BLE      _findmodule%                 TEQ      r0,#ASC(&quot;*&quot;)         ; An asterisk means the                 MOVEQ    r6,#defaultinterval% ;  default value is to be used                 BEQ      _findmodule%                 MOV      r0,r1                ; -&gt; parameter                 MOV      r1,r12               ; -&gt; buffer                 MOV      r2,#bufsize%         ; Length of buffer                 SWI      &quot;XOS_GSTrans&quot;                 LDMVSFD  r13!,{pc}                 MOV      r0,r12               ; -&gt; Translated string                 MOV      r1,#0                ; Return result in r2                 SWI      &quot;XOS_EvaluateExpression&quot;                 LDMVSFD  r13!,{pc}                 CMP      r2,#mininterval%     ; Check number is in range                 BLT      _toosmall%                 CMP      r2,#maxinterval%                 BGT      _toobig%                 MOV      r6,r2                ; r6 == poll interval   ;   ;       ._findmodule%                 MOV      r0,#18               ; Extract module info                 ADR      r1,_taskwindow%                 SWI      &quot;XOS_Module&quot;                 LDMVSFD  r13!,{pc}   ;                 LDR      r0,[r4,#-4]          ; Size of work area                 CMP      r0,#48               ; Patched TaskWindow has                 LDMLEFD  r13!,{pc}            ;  larger workarea                 CMP      r6,#0                ; -ve interval means 'display'                 STRPL    r6,[r4,#44]          ; Remainder of this interval                 STRPL    r6,[r4,#48]          ; New interval                 LDMPLFD  r13!,{pc}^   ;                 LDR      r0,[r4,#48]          ; Active poll interval                 ADR      r1,_currentnum%                 MOV      r2,#_currentnumL%                 SWI      &quot;XOS_ConvertCardinal4&quot;   ; Convert to a string                 LDMVSFD  r13!,{pc}                 ADR      r0,_current%                 SWI      &quot;XOS_Write0&quot;         ; Display value                 SWIVC    &quot;XOS_NewLine&quot;                 LDMFD    r13!,{pc}   ;   ;       ._compare%                 LDRB     r7,[r3],#1           ; Byte from first string                 LDRB     r8,[r5],#1           ; Byte from second string                 TEQ      r7,r8                ; Compare bytes                 MOVNE    pc,r14               ; Return NE if different                 TEQ      r7,#0                ; Check for end                 BNE      _compare%            ; Look at next byte                 MOV      pc,r14               ; Return EQ if identical   ;       ._toosmall%                 ADR      r0,_smallerror%      ; -&gt; Error block                 B        _toobig0%       ._toobig%                 ADR      r0,_bigerror%        ; -&gt; Error block       ._toobig0%                 LDMFD    r13!,{r14}           ; Return address                 ORRS     pc,r14,#FlagV%       ; Set V flag and return       ._smallerror%                 EQUD     &amp;16C                 EQUS     &quot;Number too small&quot;+CHR$(0)                 ALIGN       ._bigerror%                 EQUD     &amp;16C                 EQUS     &quot;Number too big&quot;+CHR$(0)       ._taskwindow%                 EQUS     &quot;TaskWindow&quot;+CHR$(0)       ._current%                 EQUS     &quot;Current poll rate is &quot;       ._currentnum%                 EQUS     STRING$(10,&quot;*&quot;)+CHR$(0)       FNEqu(&quot;_currentnumL%&quot;,&quot;P%-_currentnum%&quot;)     ]   NEXT opt%   OSCLI(&quot;Save &lt;Wimp$ScrapDir&gt;.&quot;+filename$+&quot; &quot;+STR$~(buf%)+&quot; +&quot;+STR$~(P%))   OSCLI(&quot;SetType &lt;Wimp$ScrapDir&gt;.&quot;+filename$+&quot; Utility&quot;)   END   :   DEF PROCerror     REPORT     IF ERR&lt;&gt;17 PRINT &quot; at line &quot;; ERL &quot;, location counter=&amp;&quot;; ~P%   ENDPROC   :   :   DEF FNEqu(variable$, value$)   =EVAL(&quot;FNMakeVar(&quot;+variable$+&quot;,&quot;+value$+&quot;)&quot;)   :   :   DEF FNMakeVar(RETURN var%, value%)   var%=value%   =0</pre><hr size = 3><a href="index.html#14">Return to assembler index</a><hr size = 3><address>Copyright &copy; 2002 Richard Murray, code by Chris Manning</address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -