home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / memmanagement / kdutils_1 / ManualText < prev   
Encoding:
Text File  |  1997-09-03  |  39.0 KB  |  1,401 lines

  1. Kasoft Software
  2.  
  3.  
  4. KaData Programmer's Manual
  5. (Prepress Edition)
  6.  
  7.  
  8. Copyright © Kasoft Software 1993,1996,1997
  9.  
  10. Neither the whole nor any part of this manual, or the software described herein may be adapted or reproduced in any material form except with the prior written approval of the author.
  11.  
  12. The software described in this manual is subject to continuous development and improvement. All information of a technical nature and particulars of the software and its use (including the information and particulars in this manual) are given by Kasoft Software in good faith. However, Kasoft Software will not accept liability for any loss or damage arising from the use of the software or the documentation in this manual.
  13.  
  14. Suggestions for future versions of the software and this manual are welcomed. All correspondence should be addressed to:
  15.  
  16. Kade Hansson
  17. Kasoft Software
  18. 4/73 Alexander Street
  19. Shearwater 7307
  20. AUSTRALIA
  21.  
  22. Telephone (International): [61] 3 64287448
  23. Telephone (Australia): (03) 64287448
  24. e-mail: kade_fh@postoffice.utas.edu.au
  25.  
  26. The relocatable module 'KaData' was programmed by Kade Hansson. This module is suitable for use with all ARM-based computers running Acorn RISC OS version 2.00 or later. This extract is from the second issue of the prepress edition of this manual. It documents version 0.30 (03 Sep 1997).
  27.  
  28. This extract or the software it documents has no connection with Acorn Computers Limited, but necessary registration of the module title and allocation of a software interrupt chunk number has been carried out. Thus, the software should not interfere with other software which has taken similar precautions.
  29.  
  30. KASOFT is a trademark of Kasoft Software, and owned by Kade Hansson.
  31.  
  32. ACORN is a trademark of Acorn Computers Limited.
  33.  
  34. Prepress Edition (ASCII text file version)
  35. Published September 1997; Issue 2
  36. Written by Kade Hansson
  37. Printed version published by Kasoft Typesetting
  38. Code KM09601,00B
  39.  
  40.  
  41. _____________________
  42.  
  43. KaData Support Module
  44. _____________________
  45.  
  46.  
  47. The KaData support module was initially developed by Kasoft to provide a comprehensive programmer's toolkit for use with the KaData Database Management System. It will eventually implement utility operations for the Obmat file format, which is (or will be) used by FiletypeExtend, FileWrapHandler, FileBox, KaData, and the KaProdesy Program Definition System.
  48.  
  49. The general-purpose utility routines provided (non-specific move, search and fill) are currently optimized for an ARM2 architecture, with mild employment of "loop unrolling" in the search routines (increasing code length by a factor of 4). In future, these may be supplemented by specialized routines which are automatically substituted according to the capabilities of the processor in use. The software is believed to be StrongARM compatible, although we have no capability to test software with this processor yet.
  50.  
  51. Also included in the module are utility functions for more specific purposes. These include functions to assemble an ARM instruction from specified parameters (useful in a compiler back-end) and to control a timer based on IOC Timer 1. The former routine was used in the KaModula2Library module, but that module (which was never released) has been renamed to KaProdesy, and all KaModula2 SWI definitions have been revoked in order that a new set may be placed in that chunk (&48300, Acorn registered).
  52.  
  53. The in-house versions of the KaData module provide support for the full 32-bit address space possible on newer ARM architectures. However the relevant entry points are currently disabled, due to the lack of testing done. The special entry points allow ARM6 and later architectures to run routines in the full 32-bit address space. Previously, this had not been possible under RISC OS, as it uses 26-bit PC ARM processor modes for backwards compatibility.
  54.  
  55. The advantages of using 32-bit address space are significant. Specially designed modules can be placed in dynamic areas, eliminating the need for a fragmented relocatable module area. Also, it is possible to implement virtual memory for programs running in 32-bit space.
  56.  
  57. This module was written by Kasoft Software and it is subject to continuous development and improvement. Updates to new versions and licences for distributing this module with commercial software are available. Feel free to contact us at the address given on the release note. Criticisms and suggestions for improvement will be appreciated. Please note that copyright subsists in this software and it may not be freely distributed unless written permission has been given by us.*
  58.  
  59. * Excepting versions up to 0.99, which are public domain releases with possibly limited functionality.
  60.  
  61.  
  62. _________________
  63.  
  64. Technical Details
  65. _________________
  66.  
  67.  
  68. Errors
  69.  
  70. The errors generated by the KaData support module are described here. The SWI chunk number (&482C0) should be added to the error numbers given here to get the full error number.
  71.  
  72. SWI not implemented
  73.  
  74. KaData support error number 0. This error indicates that the SWI called has no entry point defined in the instantiated version of the module.
  75.  
  76. Obmat file header is corrupted
  77.  
  78. KaData support error number 1. This error usually indicates that an Obmat file's header has become corrupted. Also generated by other Obmat-aware software which is not able to read multi-chunk, big endian, or non-base 32 Obmats, in which case the error message may vary. If this error is generated by KaData_ObmatOp 0 (verify file integrity), then you can be sure that the header is actually corrupted.
  79.  
  80. Obmat file is corrupted: missing expected marker
  81.  
  82. KaData support error number 2. This error usually indicates that an Obmat file has become corrupted, as it does not have a marker where one is expected. Also generated by other Obmat-aware software which is confused by an Obmat structure more complex than it can deal with. If this error is generated by KaData_ObmatOp 0 (verify file integrity), then you can be sure that the file is actually corrupted.
  83.  
  84. Cannot search for null string
  85.  
  86. KaData support error number 3. This error occurs when an attempt is made to search a block of memory for a null string.
  87.  
  88. Bad KaData_Filer reason code
  89.  
  90. KaData support error number 8. This error arises when an invalid reason code is passed to KaData_Filer. There are no valid reason codes in the current version of the support module.
  91.  
  92. KaData is in use
  93.  
  94. KaData support error number 13. This error occurs when an attempt is made to kill or reinitialize the KaData module after its address in the RMA address space has been anchored by one or more calls to KaData_GetEntryPoints -3 (SWI &482CD). The module cannot successfully finalize until it has been released with a matching number of calls to KaData_GetEntryPoints -4. The current number of users of the support module is recorded in the system variable KaData$ModuleAnchor. The module will die if this variable is unset, but this should be taken as a last resort only, as programs may still be calling the entry points.
  95.  
  96. Invalid address: translation to offset failed
  97.  
  98. KaData support error number 62. This error occurs when an attempt is made to assemble an instruction with an address that cannot be successfully embedded in an ARM instruction as a PC-relative offset.
  99.  
  100. Invalid immediate constant
  101.  
  102. KaData support error number 63. This error occurs when an attempt is made to assemble an instruction with an immediate constant that cannot be successfully embedded in an ARM instruction.
  103.  
  104.  
  105. _________
  106.  
  107. SWI Calls
  108. _________
  109.  
  110.  
  111. Index to KaData SWIs
  112.  
  113. Number    Name
  114.   482C0 KaData_MoveBytes
  115.   482C1 KaData_SearchByte
  116.   482C2 KaData_SearchWord
  117.   482C3 KaData_SearchString
  118.   482C4 KaData_SearchAlpha
  119.   482C5 KaData_SearchWildString
  120.   482C6 KaData_SearchWildAlpha
  121.   482C7 KaData_SpecificSearch
  122.   482C8 KaData_Filer
  123.   482C9 KaData_FillBytes
  124.   482CA KaData_ReadInteger
  125.   482CB KaData_WriteInteger
  126.   482CC KaData_CountBytes
  127.   482CD KaData_GetEntryPoints
  128.   482CE    KaData_CallSupervisor32
  129.   482CF    KaData_ChangeHardwareVector32
  130.   482D0    KaData_OSModule
  131.   482D1    KaData_Assemble
  132.   482D2    KaData_MetronomicTimerOn
  133.   482D3    KaData_MetronomicTimerOff
  134.   482D4    KaData_MetronomicTimerSmash
  135.   482D5    KaData_ReadMetronomicTimer
  136.   482D6    KaData_PokeDynamicArea
  137.   482D7    KaData_ObmatOp
  138.  
  139.  
  140. KaData_MoveBytes
  141. (SWI &482C0)
  142.     Copy a block of memory to a new address
  143.  
  144. On entry
  145.  
  146. R1 = source address
  147. R2 = destination address
  148. R3 = length
  149.  
  150. On exit
  151.  
  152. R0-R3 corrupted
  153.  
  154. Interrupts
  155.  
  156. Interrupt status is not altered
  157. Fast interrupts are enabled
  158.  
  159. Processor mode
  160.  
  161. Processor is in SVC mode
  162.  
  163. Re-entrancy
  164.  
  165. SWI is re-entrant
  166.  
  167. Use
  168.  
  169. This is a fast memory copy routine, modelled on the one given by Acorn in the chapter on Filing Systems in the Programmers Reference Manual (RISC OS 2, p. 1000). It copies any number of bytes (>0) from the source address to the destination address.
  170.  
  171. Related SWIs
  172.  
  173. KaData_FillBytes (SWI &482C9)
  174.  
  175. Related vectors
  176.  
  177. None
  178.  
  179.  
  180. KaData_SearchByte
  181. (SWI &482C1)
  182.     Search for a given byte in a block of memory
  183.  
  184. On entry
  185.  
  186. R0 = byte to search for
  187. R1 = start address
  188. R2 = block for list of matching addresses
  189. R3 = length of block to be searched
  190. R4 = maximum size of matching address list (R4<4 means no list)
  191.  
  192. On exit
  193.  
  194. R0 preserved
  195. R1 = address of byte where search would resume
  196. R2 = block of matching addresses
  197. R3 = number of bytes left to be searched (0 means search complete)
  198. R4 preserved
  199. R5 = number of matches before address in R1 (0 means not found)
  200. R6 = address of last match (if R5 > 0, else preserved)
  201.  
  202. Interrupts
  203.  
  204. Interrupt status is not altered
  205. Fast interrupts are enabled
  206.  
  207. Processor mode
  208.  
  209. Processor is in SVC mode
  210.  
  211. Re-entrancy
  212.  
  213. SWI is re-entrant
  214.  
  215. Use
  216.  
  217. This is a fast byte search routine. In simple use, without a buffer, it can find the first instance of a byte in a designated block of memory.
  218.  
  219. If a matching address list block is specified, on exit it is updated with addresses of matching bytes. If the buffer was filled before the search could be completed, the call can be repeated to obtain subsequent lists of matches.
  220.  
  221. N.B. If the matching address list was filled up, R6 contains the match which would not fit in the list. The number of matches (returned in R5) includes this one.
  222.  
  223. Related SWIs
  224.  
  225. KaData_SearchWord (SWI &482C2), KaData_SearchString (SWI &482C3),
  226. KaData_SearchAlpha (SWI &482C4)
  227.  
  228. Related vectors
  229.  
  230. None
  231.  
  232.  
  233. KaData_SearchWord
  234. (SWI &482C2)
  235.     Search for a given 32-bit word in a block of memory
  236.  
  237. On entry
  238.  
  239. R0 = word to search for
  240. R1 = start address (word aligned)
  241. R2 = block for list of matching addresses
  242. R3 = length of block to be searched (multiple of 4)
  243. R4 = maximum size of matching address list (R4<4 means no list)
  244.  
  245. On exit
  246.  
  247. R0 preserved
  248. R1 = address of word where search would resume
  249. R2 = block of matching addresses
  250. R3 = number of bytes left to be searched (0 means search complete)
  251. R4 preserved
  252. R5 = number of matches before address in R1 (0 means not found)
  253. R6 = address of last match (if R5 > 0, else preserved)
  254.  
  255. Interrupts
  256.  
  257. Interrupt status is not altered
  258. Fast interrupts are enabled
  259.  
  260. Processor mode
  261.  
  262. Processor is in SVC mode
  263.  
  264. Re-entrancy
  265.  
  266. SWI is re-entrant
  267.  
  268. Use
  269.  
  270. This is a fast 32-bit word search routine. In simple use, without a buffer, it can find the first instance of a word in a designated block of memory.
  271.  
  272. If a matching address list block is specified, on exit it is updated with addresses of matching words. If the buffer was filled before the search could be completed, the call can be repeated to obtain subsequent lists of matches.
  273.  
  274. N.B. If the matching address list was filled up, R6 contains the match which would not fit in the list. The number of matches (returned in R5) includes this one.
  275.  
  276. Related SWIs
  277.  
  278. KaData_SearchByte (SWI &482C1)
  279.  
  280. Related vectors
  281.  
  282. None
  283.  
  284.  
  285. KaData_SearchString
  286. (SWI &482C3)
  287.     Search for a string of bytes in a block of memory (case sensitive)
  288.  
  289. On entry
  290.  
  291. R0 = pointer to search string (null terminated)
  292. R1 = start address
  293. R2 = block for list of matching addresses
  294. R3 = length of block to be searched
  295. R4 = maximum size of matching address list (R4<4 means no list)
  296.  
  297. On exit
  298.  
  299. R0 preserved
  300. R1 = address of byte where search would resume
  301. R2 = block of matching addresses
  302. R3 = number of bytes left to be searched (0 means search complete)
  303. R4 preserved
  304. R5 = number of matches before address in R1 (0 means not found)
  305. R6 = address of last character which matched the first in search string
  306.     (if R5 > 0, else preserved)
  307.  
  308. Interrupts
  309.  
  310. Interrupt status is not altered
  311. Fast interrupts are enabled
  312.  
  313. Processor mode
  314.  
  315. Processor is in SVC mode
  316.  
  317. Re-entrancy
  318.  
  319. SWI is re-entrant
  320.  
  321. Use
  322.  
  323. This is a fast string search routine. In simple use, without a buffer, it can find the first instance of a string in a designated block of memory.
  324.  
  325. If a matching address list block is specified, on exit it is updated with addresses of matching strings. If the buffer was filled before the search could be completed, the call can be repeated to obtain subsequent lists of matches.
  326.  
  327. N.B. If the matching address list was filled up, R6 contains the match which would not fit in the list. The number of matches (returned in R5) includes this one.
  328.  
  329. Related SWIs
  330.  
  331. KaData_SearchByte (SWI &482C1), KaData_SearchAlpha (SWI &482C4)
  332.  
  333. Related vectors
  334.  
  335. None
  336.  
  337.  
  338. KaData_SearchAlpha
  339. (SWI &482C4)
  340.     Search for a string of bytes in a block of memory (case insensitive)
  341.  
  342. On entry
  343.  
  344. R0 = pointer to search string (null terminated)
  345. R1 = start address
  346. R2 = block for list of matching addresses
  347. R3 = length of block to be searched
  348. R4 = maximum size of matching address list (R4<4 means no list)
  349.  
  350. On exit
  351.  
  352. R0 preserved
  353. R1 = address of byte where search would resume
  354. R2 = block of matching addresses
  355. R3 = number of bytes left to be searched (0 means search complete)
  356. R4 preserved
  357. R5 = number of matches before address in R1 (0 means not found)
  358. R6 = address of last character which matched the first in search string
  359.     (if R5 > 0, else preserved)
  360.  
  361. Interrupts
  362.  
  363. Interrupt status is not altered
  364. Fast interrupts are enabled
  365.  
  366. Processor mode
  367.  
  368. Processor is in SVC mode
  369.  
  370. Re-entrancy
  371.  
  372. SWI is re-entrant
  373.  
  374. Use
  375.  
  376. This is a fast string search routine where the byte comparisons are insensitive to case for characters in the ASCII range 32-127. In simple use, without a buffer, it can find the first instance of a string in a designated block of memory.
  377.  
  378. If a matching address list block is specified, on exit it is updated with addresses of matching strings. If the buffer was filled before the search could be completed, the call can be repeated to obtain subsequent lists of matches.
  379.  
  380. N.B. If the matching address list was filled up, R6 contains the match which would not fit in the list. The number of matches (returned in R5) includes this one.
  381.  
  382. Related SWIs
  383.  
  384. KaData_SearchByte (SWI &482C1), KaData_SearchString (SWI &482C3)
  385.  
  386. Related vectors
  387.  
  388. None
  389.  
  390.  
  391. KaData_SearchWildString
  392. (SWI &482C5)
  393.     Not yet implemented
  394.  
  395.  
  396. KaData_SearchWildAlpha
  397. (SWI &482C6)
  398.     Not yet implemented
  399.  
  400.  
  401. KaData_SpecificSearch
  402. (SWI &482C7)
  403.     Not yet implemented
  404.  
  405.  
  406. KaData_Filer
  407. (SWI &482C8)
  408.     Not yet implemented
  409.  
  410.  
  411. KaData_FillBytes
  412. (SWI &482C9)
  413.     Fill a block of memory with a specified byte or word value
  414.  
  415. On entry
  416.  
  417. R1 = byte to fill with (or if R1 > 255, special word designator)
  418. R2 = destination address
  419. R3 = length
  420.  
  421. On exit
  422.  
  423. R0-R3 corrupted
  424.  
  425. Interrupts
  426.  
  427. Interrupt status is not altered
  428. Fast interrupts are enabled
  429.  
  430. Processor mode
  431.  
  432. Processor is in SVC mode
  433.  
  434. Re-entrancy
  435.  
  436. SWI is re-entrant
  437.  
  438. Use
  439.  
  440. This is a fast memory initialization routine, internally similar to KaData_MoveBytes (SWI &482C0). It initializes any number of bytes (>0) at the destination address.
  441.  
  442. If R1 < 256 on entry, the memory is filled with bytes having the value of R1. If R1 > 255 on entry, the memory is filled with words having the value of -x, where x is R1 rotated left by 16 bits. This allows fills to use word values from 0 to 2 147 483 647, and negative values from -65 536 to -1.
  443.  
  444. If, when filling with words, the initial address is not word aligned, the low byte of x is used to pad to the next word boundary. Similar padding is carried out at the end of the initialized memory if it does not finish on a word boundary.
  445.  
  446. Related SWIs
  447.  
  448. KaData_MoveBytes (SWI &482C0)
  449.  
  450. Related vectors
  451.  
  452. None
  453.  
  454.  
  455. KaData_ReadInteger
  456. (SWI &482CA)
  457.     Not yet implemented
  458.  
  459.  
  460. KaData_WriteInteger
  461. (SWI &482CB)
  462.     Not yet implemented
  463.  
  464.  
  465. KaData_CountBytes
  466. (SWI &482CC)
  467.     Not yet implemented
  468.  
  469.  
  470. KaData_GetEntryPoints
  471. (SWI &482CD)
  472.     Provides addresses of SWI handler routines and related support
  473.  
  474. On entry
  475.  
  476. R0 = SWI offset (or negative for special reason code)
  477. R1 = address of buffer to store 65 addresses (if R0=-1 on entry)
  478.  
  479. On exit
  480.  
  481. R0 preserved
  482. R1 = address beyond end of buffer (if R0=-1 on entry, preserved otherwise)
  483. R2 = address of given SWI handler (or maximum SWI offset if R0=-1 on entry)
  484.  
  485. Interrupts
  486.  
  487. Interrupt status is not altered
  488. Fast interrupts are enabled
  489.  
  490. Processor mode
  491.  
  492. Processor is in SVC mode
  493.  
  494. Re-entrancy
  495.  
  496. SWI is re-entrant
  497.  
  498. Use
  499.  
  500. The meaning of this call depends on the value of R0 as follows:
  501.  
  502. R0    Meaning
  503. 0-63    Return address of specific SWI handler in R3 (for SWI offset in R0)
  504. -1    Return address of all handlers in buffer pointed to by R2
  505. -2    Return address of main SWI handler in R3
  506. -3    Anchor module
  507. -4    Release module
  508.  
  509. When you specify R0 = -1, the layout of the buffer is:
  510.  
  511. Offset    Meaning
  512. 0    Address of main SWI handler (SWI chunk &482C0)
  513. 4    Address of handler for KaData_MoveBytes (SWI offset 0)
  514. :
  515. 256    Address of handler for KaData_Undefined63 (SWI offset 63)
  516.  
  517. In this instance, R3 returns the highest defined SWI offset in the chunk.
  518.  
  519. If you specify R0 > 0 on entry, but there is no handler for that SWI offset, then R3 will contain 0 on exit.
  520.  
  521. All addresses returned are absolute, but depend on the current address of the KaData module in the RMA address space. In order to use them, you should first call this routine with R0 = -3 to anchor the module in the RMA. When you have finished using the entry points, be sure to use R0 = -4 to release it. Ideally, you should not anchor the module for long periods of time in a multitasking environment.
  522.  
  523. The following entry points require R12 to point to the KaData module's private word:
  524.  
  525. KaData_MetronomicTimerOn (SWI &482D2)
  526. KaData_MetronomicTimerOff (SWI &482D3)
  527. KaData_MetronomicTimerSmash (SWI &482D4)
  528. KaData_ReadMetronomicTimer (SWI &482D5)
  529.  
  530. For any other entry point returned by this routine:
  531.  
  532. On entry:    Entry registers as for SWI
  533.         R13 must be a full descending stack with 512 bytes free
  534.         R11, R12, R14 may contain any value (unless stated o/w)
  535.         Processor is in a 26-bit PC mode
  536.         Interrupt status is undefined
  537. On exit:    Exit registers as for SWI
  538.         Processor mode is unchanged
  539.         Interrupt status is unaltered
  540. Re-entrancy:    Check SWI documentation for re-entrancy
  541.  
  542. Related SWIs
  543.  
  544. None
  545.  
  546. Related vectors
  547.  
  548. None
  549.  
  550. Related variables
  551.  
  552. KaData$ModuleAnchor
  553.  
  554.  
  555. KaData_CallSupervisor32
  556. (SWI &482CE)
  557.     Calls a routine in ARM Supervisor32 mode (not implemented in 0.30)
  558.  
  559. On entry
  560.  
  561. R0-R7 as required for routine 
  562. R8 = address of routine to call
  563. R9 = R12 value for entry to routine
  564. R10,R11 as required for routine (R11 applicable only if called directly)
  565. R12 = KaData module instantiation private word pointer (if called directly)
  566. R13 = supervisor stack pointer (if called directly)
  567. R14 = flags and 26-bit PC return value for call (if called directly)
  568.  
  569. On exit
  570.  
  571. R0-R10 and flags as returned by routine
  572. R11-R13 as returned by routine (if called directly)
  573.  
  574. Interrupts
  575.  
  576. Interrupts are disabled
  577. Fast interrupts are disabled temporarily (before entry to the routine)
  578.  
  579. Processor mode
  580.  
  581. Processor is in SVC26 mode on entry and exit
  582. Routine is executed in SVC32 mode, with KaData SVC32 SWI handler enabled
  583.  
  584. Re-entrancy
  585.  
  586. SWI is not re-entrant
  587.  
  588. Use
  589.  
  590. This call is for RISC OS 3.50 and above only.
  591.  
  592. This SWI can be used to call routines which:
  593.  
  594. -    lie outside 26-bit address space
  595. -    end up calling routines which are outside 26-bit address space
  596.  
  597. The entry process involves:
  598.  
  599. -    claiming processor SWI vector, or, if a different approach is
  600.     suggested by a call to KaData_ChangeProcessorVector32 (SWI &482CF),
  601.     this will be followed instead.
  602. -    forcing ARM to enter Supervisor32 mode
  603. -    saving KaData R12 on the stack and loading R12 with R9
  604. -    calling the routine
  605.  
  606. The exit process involves:
  607.  
  608. -    saving routine exit R12 and retrieving KaData R12
  609. -    releasing processor SWI vector, or, if a different approach is
  610.     suggested by a call to KaData_ChangeProcessorVector32 (SWI &482CF),
  611.     this will be followed instead.
  612. -    forcing ARM to enter Supervisor26 mode
  613. -    retrieving routine exit R12
  614.  
  615. If the default entry and exit actions have not been overridden by KaData_ChangeProcessorVector32, the replaced SWI vector performs as follows:
  616.  
  617. -    The KaData SWI claimant needs to patch to the OS SWI handler with a
  618.     routine that can work around the clipping of R14_svc which the OS
  619.     SWI handler performs to retrieve the SWI instruction. (This forces
  620.     R14_svc into 26-bit space, which can yield an incorrect instruction
  621.     and an incorrect return address.) To be able to do this, the routine
  622.     needs to fake a SWI call in 26-bit space. This is done, in broad
  623.     terms, using OS_CallASWI.
  624.  
  625. Related SWIs
  626.  
  627. OS_ClaimProcessorVector (SWI &69), OS_CallASWI (SWI &6F),
  628. KaData_ChangeProcessorVector32 (SWI &482CF)
  629.  
  630. Related vectors
  631.  
  632. Processor SWI vector (Location &08)
  633.  
  634.  
  635. KaData_ChangeProcessorVector32
  636. (SWI &482CF)
  637.     Changes the exception handlers used by KaData_CallSupervisor32
  638.     (not implemented in 0.30)
  639.  
  640. On entry
  641.  
  642. R0 = vector claim routine (or R0 = 0 to restore default actions)
  643. R1 = vector release routine
  644.  
  645. On exit
  646.  
  647. R0 = previous vector claim routine
  648. R1 = previous vector release routine
  649.  
  650. Interrupts
  651.  
  652. Interrupts are disabled
  653. Fast interrupts are enabled
  654.  
  655. Processor mode
  656.  
  657. Processor is in SVC mode
  658.  
  659. Re-entrancy
  660.  
  661. SWI is not re-entrant
  662.  
  663. Use
  664.  
  665. This call is for RISC OS 3.50 and above only.
  666.  
  667. This call is intended for changing the entry and exit sequence followed by KaData_CallSupervisor32 (SWI &482CE). The normal action of such routines is to replace and subsequently restore the processor vectors to facilitate running in SVC32 mode.
  668.  
  669. R0 should be set to the address of your vector claim routine, which is entered in SVC26 mode. R1 should be set to the address of your vector release routine, which is entered in SVC32 mode. If you set R0 = 0 on entry, the default actions will be restored.
  670.  
  671. If you claim a processor vector within your vector claim routine, the handlers you set up will be called during the execution of a SVC32 routine running under KaData_CallSupervisor32 (SWI &482CE). This means:
  672.  
  673. -    Handlers which set themselves up within your routine are called
  674.     "KaData claimants". These claimants will be called from a parent
  675.     environment that is in Supervisor32 mode, unless your routine is
  676.     presently threaded more than once.
  677.     
  678. -    Routines which set themselves up with the operating system, and are
  679.     the owners of the vectors when KaData_CallSupervisor32 is entered,
  680.     are called "actual claimants". These claimants are usually defined
  681.     to execute in 26-bit processor modes as follows:
  682.  
  683.     Number    Vector name (default claimant; 26-bit processor mode)
  684.     0    Reset (branch through zero error; SVC)
  685.     1    Undefined instruction (coprocessor instruction emulator; SVC)
  686.     2    SWI (operating system software interrupt handler; SVC)
  687.     3    Prefetch abort (abort on instruction fetch error; SVC)
  688.     4    Data abort (abort on data transfer error; SVC)
  689.     5    Reserved (address exception error)
  690.     6    IRQ (operating system interrupt handler; IRQ)
  691.     7    FIQ (current FIQ claimant; FIQ)
  692.  
  693. So, the purpose of your vector claim routine is to replace actual claimants with your KaData claimants. And the purpose of your vector release routine is to restore the actual claimants. Usually KaData claimants need to access the actual claimants, and merely perform pre and post processing on the vectors to ensure the desired actions be taken for code running in Supervisor32 mode.
  694.  
  695. Related SWIs
  696.  
  697. OS_ClaimProcessorVector (SWI &69), KaData_CallSupervisor32 (SWI &482CE)
  698.  
  699. Related vectors
  700.  
  701. All processor vectors (Locations &00-&1C)
  702.  
  703.  
  704. KaData_OSModule
  705. (SWI &482D0)
  706.     Perform a module operation using AddressDevice DA
  707.     (not implemented in 0.30)
  708.  
  709. On entry
  710.  
  711. R0 = reason code
  712. other registers are parameters and depend upon the reason code
  713.  
  714. On exit
  715.  
  716. R0 preserved
  717. other registers depend on the reason code
  718.  
  719. Interrupts
  720.  
  721. Interrupt status is undefined
  722. Fast interrupts are enabled
  723.  
  724. Processor mode
  725.  
  726. Processor is in SVC mode
  727.  
  728. Re-entrancy
  729.  
  730. Not defined
  731.  
  732. Use
  733.  
  734. This call is for RISC OS 3.50 and above only.
  735.  
  736. This SWI provides a number of calls to manipulate modules, using the features available in the AddressDevice DA module area filing system (&FFA).
  737.  
  738. R0    Action
  739. 128    TabModule initialize (for internal use only)
  740. 129    TabModule finalize (for internal use only)
  741. 130    TabModule start code (for internal use only)
  742. 131    TabModule service handler (for internal use only)
  743. 132    TabModule SWI handler (for internal use only)
  744. 133    TabModule SWI decoding code (for internal use only)
  745.  
  746. Related SWIs
  747.  
  748. OS_Module (SWI &1E), KaData_OSModuleRegister (SWI <none yet>)
  749.  
  750. Related vectors
  751.  
  752. None
  753.  
  754.  
  755. KaData_Assemble
  756. (SWI &482D1)
  757.  
  758. Assembles an ARM instruction
  759.  
  760. On entry
  761.  
  762. R0 = execution address of instruction
  763. R1 = pointer to word to contain assembled instruction
  764. R2 = base instruction code
  765. R3 = condition code
  766. Other registers depend on base instruction code
  767.  
  768. On exit
  769.  
  770. -
  771.  
  772. Interrupts
  773.  
  774. Interrupt status is not defined
  775. Fast interrupts are enabled
  776.  
  777. Processor mode
  778.  
  779. Processor is in SVC mode
  780.  
  781. Re-entrancy
  782.  
  783. SWI is re-entrant
  784.  
  785. Use
  786.  
  787. This general purpose SWI assembles an ARM instruction from data specified by the entry registers, and stores it at the address specified.
  788.  
  789. The following table lists the condition codes:
  790.  
  791. Condition    Code
  792. AL        &E
  793. CC        &3
  794. CS        &2
  795. EQ        &0
  796. GE        &A
  797. GT        &C
  798. HI        &8
  799. HS        &2
  800. LE        &D
  801. LO        &3
  802. LS        &9
  803. LT        &B
  804. MI        &4
  805. PL        &5
  806. NE        &1
  807. NV        &F
  808. VC        &7
  809. VS        &6
  810.  
  811. The following table is a summary of base instruction codes and the entry register values required:
  812.  
  813. Instruction        Code        R4    R5    R6    R7
  814. ABS            &F2        FPR    FD    0    FS1
  815. ABS            &F20        FPR    FD    0    FC
  816. ACS            &FC        FPR    FD    0    FS1
  817. ACS            &FC0        FPR    FD    0    FC
  818. ADC            &0A        D    S1    S2    Shift
  819. ADC            &2A        D    S1    Const    -
  820. ADCS            &0B        D    S1    S2    Shift
  821. ADCS            &2B        D    S1    Const    -
  822. ADD            &08        D    S1    S2    Shift
  823. ADD            &28        D    S1    Const    -
  824. ADDS            &09        D    S1    S2    Shift
  825. ADDS            &29        D    S1    Const    -
  826. ADF            &E0        FPR    FD    FS1    FS2
  827. ADF            &E00        FPR    FD    FS1    FC
  828. AND            &00        D    S1    S2    Shift
  829. AND            &20        D    S1    Const    -
  830. ANDS            &01        D    S1    S2    Shift
  831. ANDS            &21        D    S1    Const    -
  832. ASN            &FB        FPR    FD    0    FS1
  833. ASN            &FB0        FPR    FD    0    FC
  834. ATN            &FD        FPR    FD    0    FS1
  835. ATN            &FD0        FPR    FD    0    FC
  836. B            &A0        Addr    -    -    -
  837. BL            &B0        Addr    -    -    -
  838. BIC            &1C        D    S1    S2    Shift
  839. BIC            &3C        D    S1    Const    -
  840. BICS            &1D        D    S1    S2    Shift
  841. BICS            &3D        D    S1    Const    -
  842. CMF            &A8        FPR    7    FS1    FS2
  843. CMF            &A80        FPR    7    FS1    FC
  844. CMFE            &AA        FPR    7    FS1    FS2
  845. CMFE            &AA0        FPR    7    FS1    FC
  846. CMN            &17        0    S1    S2    Shift
  847. CMN            &37        0    S1    Const    -
  848. CMNP            &17        15    S1    S2    Shift
  849. CMNP            &37        15    S1    Const    -
  850. CMP            &15        0    S1    S2    Shift
  851. CMP            &35        0    S1    Const    -
  852. CMPP            &15        15    S1    S2    Shift
  853. CMPP            &35        15    S1    Const    -
  854. CNF            &A9        FPR    7    FS1    FS2
  855. CNF            &A90        FPR    7    FS1    FC
  856. CNFE            &AB        FPR    7    FS1    FS2
  857. CNFE            &AB0        FPR    7    FS1    FC
  858. COS            &F9        FPR    FD    0    FS1
  859. COS            &F90        FPR    FD    0    FC
  860. DVF            &E4        FPR    FD    FS1    FS2
  861. DVF            &E40        FPR    FD    FS1    FC
  862. EOR            &02        D    S1    S2    Shift
  863. EOR            &22        D    S1    Const    -
  864. EORS            &03        D    S1    S2    Shift
  865. EORS            &23        D    S1    Const    -
  866. EXP            &F7        FPR    FD    0    FS1
  867. EXP            &F70        FPR    FD    0    FC
  868. FML            &E9        FPR    FD    FS1    FS2
  869. FML            &E90        FPR    FD    FS1    FC
  870. FDV            &EA        FPR    FD    FS1    FS2
  871. FDV            &EA0        FPR    FD    FS1    FC
  872. FIX            &A10        FPR    FS1    D    -
  873. FLT            &A00        FPR    FD    S1    -
  874. FRD            &EB        FPR    FD    FS1    FS2
  875. FRD            &EB0        FPR    FD    FS1    FC
  876. LDF (DA)        &C1        FPR    FR    A1    Offset
  877. LDF (IA)        &C9        FPR    FR    A1    Offset
  878. LDF (DB)        &D1        FPR    FR    A1    Offset
  879. LDF (DB!)        &D3        FPR    FR    A1    Offset
  880. LDF (IB)        &D9        FPR    FR    A1    Offset
  881. LDF (IB!)        &DB        FPR    FR    A1    Offset
  882. LDMDA            &81        A1    L    -    -
  883. LDMDA (!)        &83        A1    L    -    -
  884. LDMDA (^)        &85        A1    L    -    -
  885. LDMDA (!^)        &87        A1    L    -    -
  886. LDMDB            &91        A1    L    -    -
  887. LDMDB (!)        &93        A1    L    -    -
  888. LDMDB (^)        &95        A1    L    -    -
  889. LDMDB (!^)        &97        A1    L    -    -
  890. LDMEA            is equivalent to LDMDB
  891. LDMED            is equivalent to LDMIB
  892. LDMFA            is equivalent to LDMDA
  893. LDMFD            is equivalent to LDMIA
  894. LDMIA            &89        A1    L    -    -
  895. LDMIA (!)        &8B        A1    L    -    -
  896. LDMIA (^)        &8D        A1    L    -    -
  897. LDMIA (!^)        &8F        A1    L    -    -
  898. LDMIB            &99        A1    L    -    -
  899. LDMIB (!)        &9B        A1    L    -    -
  900. LDMIB (^)        &9D        A1    L    -    -
  901. LDMIB (!^)        &9F        A1    L    -    -
  902. LDR            &59        R    15    Addr    -
  903. LDR (DA)        &41        R    A1    Offset    -
  904. LDR (DA)        &61        R    A1    A2    Shift
  905. LDR (DB)        &51        R    A1    Offset    -
  906. LDR (DB)        &71        R    A1    A2    Shift
  907. LDR (IA)        &49        R    A1    Offset    -
  908. LDR (IA)        &69        R    A1    A2    Shift
  909. LDR (IB)        &59        R    A1    Offset    -
  910. LDR (IB)        &79        R    A1    A2    Shift
  911. LDR (DB!)        &53        R    A1    Offset    -
  912. LDR (DB!)        &73        R    A1    A2    Shift
  913. LDR (IB!)        &5B        R    A1    Offset    -
  914. LDR (IB!)        &7B        R    A1    A2    Shift
  915. LDRB (DA)        &45        R    A1    Offset    -
  916. LDRB (DA)        &65        R    A1    A2    Shift
  917. LDRB (DB)        &55        R    A1    Offset    -
  918. LDRB (DB)        &75        R    A1    A2    Shift
  919. LDRB (IA)        &4D        R    A1    Offset    -
  920. LDRB (IA)        &6D        R    A1    A2    Shift
  921. LDRB (IB)        &5D        R    A1    Offset    -
  922. LDRB (IB)        &7D        R    A1    A2    Shift
  923. LDRB (DB!)        &57        R    A1    Offset    -
  924. LDRB (DB!)        &77        R    A1    A2    Shift
  925. LDRB (IB!)        &5F        R    A1    Offset    -
  926. LDRB (IB!)        &7F        R    A1    A2    Shift
  927. LDRBT (DA)        &47        R    A1    Offset    -
  928. LDRBT (DA)        &67        R    A1    A2    Shift
  929. LDRBT (IA)        &4F        R    A1    Offset    -
  930. LDRBT (IA)        &6F        R    A1    A2    Shift
  931. LDRT (DA)        &43        R    A1    Offset    -
  932. LDRT (DA)        &63        R    A1    A2    Shift
  933. LDRT (IA)        &4B        R    A1    Offset    -
  934. LDRT (IA)        &6B        R    A1    A2    Shift
  935. LGN            &F6        FPR    FD    0    FS1
  936. LGN            &F60        FPR    FD    0    FC
  937. LOG            &F5        FPR    FD    0    FS1
  938. LOG            &F50        FPR    FD    0    FC
  939. MLA            &30        D    S1    S2    S3
  940. MNF            &F1        FPR    FD    0    FS1
  941. MNF            &F10        FPR    FD    0    FC
  942. MOV            &15        D    0    S1    Shift
  943. MOV            &35        D    0    Const    -
  944. MUF            &E1        FPR    FD    FS1    FS2
  945. MUF            &E10        FPR    FD    FS1    FC
  946. MUL            &10        D    S1    S2    0
  947. MVF            &F0        FPR    FD    0    FS1
  948. MVF            &F00        FPR    FD    0    FC
  949. MVN            &17        D    0    S1    Shift
  950. MVN            &37        D    0    Const    -
  951. ORR            &18        D    S1    S2    Shift
  952. ORR            &38        D    S1    Const    -
  953. ORRS            &19        D    S1    S2    Shift
  954. ORRS            &39        D    S1    Const    -
  955. POL            &EC        FPR    FD    FS1    FS2
  956. POL            &EC0        FPR    FD    FS1    FC
  957. POW            &E6        FPR    FD    FS1    FS2
  958. POW            &E60        FPR    FD    FS1    FC
  959. RDF            &E5        FPR    FD    FS1    FS2
  960. RDF            &E50        FPR    FD    FS1    FC
  961. RFC            &A50        0    0    D    -
  962. RFS            &A30        0    0    D    -
  963. RMF            &E8        FPR    FD    FS1    FS2
  964. RMF            &E80        FPR    FD    FS1    FC
  965. RND            &F3        FPR    FD    0    FS1
  966. RND            &F30        FPR    FD    0    FC
  967. RPW            &E7        FPR    FD    FS1    FS2
  968. RPW            &E70        FPR    FD    FS1    FC
  969. RSB            &06        D    S1    S2    Shift
  970. RSB            &26        D    S1    Const    -
  971. RSBS            &07        D    S1    S2    Shift
  972. RSBS            &27        D    S1    Const    -
  973. RSC            &0E        D    S1    S2    Shift
  974. RSC            &2E        D    S1    Const    -
  975. RSCS            &0F        D    S1    S2    Shift
  976. RSCS            &2F        D    S1    Const    -
  977. RSF            &E3        FPR    FD    FS1    FS2
  978. RSF            &E30        FPR    FD    FS1    FC
  979. SBC            &0C        D    S1    S2    Shift
  980. SBC            &2C        D    S1    Const    -
  981. SBCS            &0D        D    S1    S2    Shift
  982. SBCS            &2D        D    S1    Const    -
  983. SIN            &F8        FPR    FD    0    FS1
  984. SIN            &F80        FPR    FD    0    FC
  985. SQT            &F4        FPR    FD    0    FS1
  986. SQT            &F40        FPR    FD    0    FC
  987. STF (DA)        &C0        FPR    FR    A1    Offset
  988. STF (IA)        &C8        FPR    FR    A1    Offset
  989. STF (DB)        &D0        FPR    FR    A1    Offset
  990. STF (DB!)        &D2        FPR    FR    A1    Offset
  991. STF (IB)        &D8        FPR    FR    A1    Offset
  992. STF (IB!)        &DA        FPR    FR    A1    Offset
  993. STMDA            &80        A1    L    -    -
  994. STMDA (!)        &82        A1    L    -    -
  995. STMDA (^)        &84        A1    L    -    -
  996. STMDA (!^)        &86        A1    L    -    -
  997. STMDB            &90        A1    L    -    -
  998. STMDB (!)        &92        A1    L    -    -
  999. STMDB (^)        &94        A1    L    -    -
  1000. STMDB (!^)        &96        A1    L    -    -
  1001. STMEA            is equivalent to STMIA
  1002. STMED            is equivalent to STMDA
  1003. STMFA            is equivalent to STMIB
  1004. STMFD            is equivalent to STMDB
  1005. STMIA            &88        A1    L    -    -
  1006. STMIA (!)        &8A        A1    L    -    -
  1007. STMIA (^)        &8C        A1    L    -    -
  1008. STMIA (!^)        &8E        A1    L    -    -
  1009. STMIB            &98        A1    L    -    -
  1010. STMIB (!)        &9A        A1    L    -    -
  1011. STMIB (^)        &9C        A1    L    -    -
  1012. STMIB (!^)        &9E        A1    L    -    -
  1013. STR            &58        R    15    Addr    -
  1014. STR (DA)        &40        R    A1    Offset    -
  1015. STR (DA)        &60        R    A1    A2    Shift
  1016. STR (DB)        &50        R    A1    Offset    -
  1017. STR (DB)        &70        R    A1    A2    Shift
  1018. STR (IA)        &48        R    A1    Offset    -
  1019. STR (IA)        &68        R    A1    A2    Shift
  1020. STR (IB)        &58        R    A1    Offset    -
  1021. STR (IB)        &78        R    A1    A2    Shift
  1022. STR (DB!)        &52        R    A1    Offset    -
  1023. STR (DB!)        &72        R    A1    A2    Shift
  1024. STR (IB!)        &5A        R    A1    Offset    -
  1025. STR (IB!)        &7A        R    A1    A2    Shift
  1026. STRB (DA)        &44        R    A1    Offset    -
  1027. STRB (DA)        &64        R    A1    A2    Shift
  1028. STRB (DB)        &54        R    A1    Offset    -
  1029. STRB (DB)        &74        R    A1    A2    Shift
  1030. STRB (IA)        &4C        R    A1    Offset    -
  1031. STRB (IA)        &6C        R    A1    A2    Shift
  1032. STRB (IB)        &5C        R    A1    Offset    -
  1033. STRB (IB)        &7C        R    A1    A2    Shift
  1034. STRB (DB!)        &56        R    A1    Offset    -
  1035. STRB (DB!)        &76        R    A1    A2    Shift
  1036. STRB (IB!)        &5E        R    A1    Offset    -
  1037. STRB (IB!)        &7E        R    A1    A2    Shift
  1038. STRBT (DA)        &46        R    A1    Offset    -
  1039. STRBT (DA)        &66        R    A1    A2    Shift
  1040. STRBT (IA)        &4E        R    A1    Offset    -
  1041. STRBT (IA)        &6E        R    A1    A2    Shift
  1042. STRT (DA)        &42        R    A1    Offset    -
  1043. STRT (DA)        &62        R    A1    A2    Shift
  1044. STRT (IA)        &4A        R    A1    Offset    -
  1045. STRT (IA)        &6A        R    A1    A2    Shift
  1046. SUB            &04        D    S1    S2    Shift
  1047. SUB            &24        D    S1    Const    -
  1048. SUBS            &05        D    S1    S2    Shift
  1049. SUBS            &25        D    S1    Const    -
  1050. SUF            &E2        FPR    FD    FS1    FS2
  1051. SUF            &E20        FPR    FD    FS1    FC
  1052. SWI            &F0        -1    SID    -    -
  1053. TAN            &FA        FPR    FD    0    FS1
  1054. TAN            &FA0        FPR    FD    0    FC
  1055. TEQ            &11        0    S1    S2    Shift
  1056. TEQ            &31        0    S1    Const    -
  1057. TEQP            &11        15    S1    S2    Shift
  1058. TEQP            &31        15    S1    Const    -
  1059. TST            &13        0    S1    S2    Shift
  1060. TST            &33        0    S1    Const    -
  1061. TSTP            &13        15    S1    S2    Shift
  1062. TSTP            &33        15    S1    Const    -
  1063. WFC            &A40        0    0    S1    -
  1064. WFS            &A20        0    0    S1    -
  1065.  
  1066. Each of the mnemonics used to indicate register contents in the above table are described below:
  1067.  
  1068. Mnemonic    Meaning                Entry register contents
  1069. A1        ARM register: first address    Cardinal, in the range 0-15
  1070. A2        ARM register: second address    Cardinal, in the range 0-15
  1071. Addr        ARM memory address        26-bit cardinal
  1072. Const        Immediate constant        32-bit cardinal
  1073. D        ARM register: destination    Cardinal, in the range 0-15
  1074. FC        FP immediate constant        The constant is specified by
  1075.                         a code in the range 0-7. The
  1076.                                 following table gives a list
  1077.                         of valid FP constants:
  1078.             Code        FP constant
  1079.             0        0.0
  1080.             1        1.0
  1081.             2        2.0
  1082.             3        3.0
  1083.             4        4.0
  1084.             5        5.0
  1085.             6        0.5
  1086.             7        10.0
  1087. FD    FP register: destination        Cardinal, in the range 0-7
  1088. FPR    FP precision and rounding        This value specifies the FP
  1089.                         precision and rounding, as
  1090.                         follows:
  1091.             Value    Instruction suffix
  1092.             0        S
  1093.             1        SP
  1094.             2        SM
  1095.             3        SZ
  1096.             4        D
  1097.             5        DP
  1098.             6        DM
  1099.             7        DZ
  1100.             8        E
  1101.             9        EP
  1102.             10        EM
  1103.             11        EZ
  1104.             12        P
  1105.             13        PP
  1106.             14        PM
  1107.             15        PZ
  1108. FR        FP register            Cardinal, in the range 0-7
  1109. FS1        FP register: first source    Cardinal, in the range 0-7
  1110. FS2        FP register: second source    Cardinal, in the range 0-7
  1111. L        ARM register list        16-bit bitmap (register
  1112.                         included if bit set)
  1113.                         e.g. R0 included if bit 0 is
  1114.                         set, R15 included if bit 15
  1115.                         is set
  1116. Offset        Memory address offset        For all instructions apart
  1117.                         from LDRB and STRB, the
  1118.                         offset must be a multiple of
  1119.                         4. For LDR, STR, LDM and
  1120.                         STM, the offset must be in
  1121.                         the range 0-4095. For LDF
  1122.                         and STF, the offset must be
  1123.                         in the range 0-4080.
  1124. R        ARM register            Cardinal, in the range 0-15
  1125. S1        ARM register: first source    Cardinal, in the range 0-15
  1126. S2        ARM register: second source    Cardinal, in the range 0-15
  1127. Shift        Register shift/rotate operation    Bits 0-2 are the subinst-
  1128.                         ruction code. If bit 0 is
  1129.                         set, then bits 3-7 are shift
  1130.                         factor. If bit 0 is unset,
  1131.                         then bits 4-7 specify the
  1132.                         ARM register containing the
  1133.                         shift factor, and bit 7 is
  1134.                         unset. The subinstruction
  1135.                         codes are listed below:
  1136.             Code        Shift/rotate subinstruction
  1137.             0        LSL #<factor>
  1138.                     ASL #<factor>
  1139.             1        LSL <register>
  1140.                     ASL <register>
  1141.             2        LSR #<factor>
  1142.             3        LSR <register>
  1143.             4        ASR #<factor>
  1144.             5        ASR <register>
  1145.             6        RRX  (<factor> = 0)
  1146.             6        ROR #<factor> (<factor> > 0)
  1147.             7        ROR <register>
  1148. SID        SWI identification number    26-bit cardinal
  1149.  
  1150. Note that is the caller's responsibility to ensure that the data passed meets the requirements specified above. For example, no error will be returned if an attempt is made to assemble an instruction which refers to R16. If the caller does not meet the requirements, then the instruction which is assembled will almost certainly perform the wrong task, if it executes at all.
  1151.  
  1152. If an immediate constant cannot be encoded, then the error Invalid immediate constant will be generated. Similarly, if an address cannot be successfully converted to a PC-relative offset, then the error Invalid address: translation to offset failed will be returned.
  1153.  
  1154. Related SWIs
  1155.  
  1156. Debugger_Disassemble (SWI &40380)
  1157.  
  1158. Related vectors
  1159.  
  1160. None
  1161.  
  1162.  
  1163. KaData_MetronomicTimerOn
  1164. (SWI &482D2)
  1165.     Start a timer using IOC Timer 1
  1166.  
  1167. On entry
  1168.  
  1169. -
  1170.  
  1171. On exit
  1172.  
  1173. -
  1174.  
  1175. Interrupts
  1176.  
  1177. Interrupts are disabled
  1178.  
  1179. Processor mode
  1180.  
  1181. Processor is in SVC mode
  1182.  
  1183. Re-entrancy
  1184.  
  1185. Routine is not re-entrant
  1186.  
  1187. Use
  1188.  
  1189. This SWI starts KaData's metronomic timer. If it is already in use, the usage count is incremented.
  1190.  
  1191. The increment rate is hardware dependent. On pre-RiscPC architectures, the rate is typically 2MHz, and it can significantly affect system performance to have an interrupt called so frequently. On a RiscPC, tests indicate IOC Timer 1 runs at 50Hz.
  1192.  
  1193. In both cases, Timer 1 can be more reliable than Timer 0. The 2MHz oscillator is more accurate because a lost tick has less effect, and the 50Hz oscillator simply seems to work better on some machines (like Kasoft Central).  However, starting the metronomic timer will cause any previous claimants of the Timer 1 interrupt to stop being called, so beware.
  1194.  
  1195. Related SWIs
  1196.  
  1197. KaData_MetronomicTimerOff (SWI &482D3),
  1198. KaData_MetronomicTimerSmash (SWI &482D4),
  1199. KaData_ReadMetronomicTimer (SWI &482D5)
  1200.  
  1201. Related vectors
  1202.  
  1203. None
  1204.  
  1205.  
  1206. KaData_MetronomicTimerOff
  1207. (SWI &482D3)
  1208.     Finish using the timer based on IOC Timer 1
  1209.  
  1210. On entry
  1211.  
  1212. -
  1213.  
  1214. On exit
  1215.  
  1216. -
  1217.  
  1218. Interrupts
  1219.  
  1220. Interrupts are disabled
  1221.  
  1222. Processor mode
  1223.  
  1224. Processor is in SVC mode
  1225.  
  1226. Re-entrancy
  1227.  
  1228. Routine is not re-entrant
  1229.  
  1230. Use
  1231.  
  1232. This SWI should be called to finish using KaData's metronomic timer. If it is in use by another program, the usage count is decremented. Otherwise, the Timer 1 interrupt will be disabled and the metronomic timer will stop.
  1233.  
  1234. Related SWIs
  1235.  
  1236. KaData_MetronomicTimerOn (SWI &482D2),
  1237. KaData_MetronomicTimerSmash (SWI &482D4),
  1238. KaData_ReadMetronomicTimer (SWI &482D5)
  1239.  
  1240. Related vectors
  1241.  
  1242. None
  1243.  
  1244.  
  1245. KaData_MetronomicTimerSmash
  1246. (SWI &482D4)
  1247.     Kill the timer based on IOC Timer 1
  1248.  
  1249. On entry
  1250.  
  1251. -
  1252.  
  1253. On exit
  1254.  
  1255. -
  1256.  
  1257. Interrupts
  1258.  
  1259. Interrupts are disabled
  1260.  
  1261. Processor mode
  1262.  
  1263. Processor is in SVC mode
  1264.  
  1265. Re-entrancy
  1266.  
  1267. Routine is not re-entrant
  1268.  
  1269. Use
  1270.  
  1271. This SWI can be called to reset the usage count on the KaData metronomic timer to zero, disabling the Timer 1 interrupt and stopping the metronomic timer. For use in emergencies only, as some programs may be relying on the timer.
  1272.  
  1273. Related SWIs
  1274.  
  1275. KaData_MetronomicTimerOn (SWI &482D2),
  1276. KaData_MetronomicTimerOff (SWI &482D3),
  1277. KaData_ReadMetronomicTimer (SWI &482D5)
  1278.  
  1279. Related vectors
  1280.  
  1281. None
  1282.  
  1283.  
  1284. KaData_ReadMetronomicTimer
  1285. (SWI &482D5)
  1286.     Read the timer based on IOC Timer 1
  1287.  
  1288. On entry
  1289.  
  1290. -
  1291.  
  1292. On exit
  1293.  
  1294. R0 = low 32-bits of timer
  1295. R1 = high 32-bits of timer
  1296.  
  1297. Interrupts
  1298.  
  1299. Interrupts are disabled
  1300.  
  1301. Processor mode
  1302.  
  1303. Processor is in SVC mode
  1304.  
  1305. Re-entrancy
  1306.  
  1307. Routine is re-entrant
  1308.  
  1309. Use
  1310.  
  1311. This SWI should be called to read the value of KaData's metronomic timer.
  1312.  
  1313. You should be prepared for the timer to wrap-around (particularly on a 2MHz timer), and not assume that wrap-around occurs at 2^64 (currently wrap around-always occurs at 2^32). If a wrap-around occurs, you cannot be sure of the elapsed time, and must resynchronize using another timer.
  1314.  
  1315. Related SWIs
  1316.  
  1317. KaData_MetronomicTimerOn (SWI &482D2),
  1318. KaData_MetronomicTimerOff (SWI &482D3),
  1319. KaData_ReadMetronomicSmash (SWI &482D4)
  1320.  
  1321. Related vectors
  1322.  
  1323. None
  1324.  
  1325.  
  1326. KaData_PokeDynamicArea
  1327. (SWI &482D6)
  1328.     Changes the maximum size of a dynamic area (not implemented in 0.30)
  1329.  
  1330. On entry
  1331.  
  1332. R1 = area number
  1333. R5 = new maximum size for area, in bytes
  1334.  
  1335. On exit
  1336.  
  1337. R1,R5 preserved
  1338.  
  1339. Interrupts
  1340.  
  1341. Interrupt status is undefined
  1342. Fast interrupts are enabled
  1343.  
  1344. Processor mode
  1345.  
  1346. Processor is in SVC mode
  1347.  
  1348. Re-entrancy
  1349.  
  1350. Not defined
  1351.  
  1352. Use
  1353.  
  1354. This call is for RISC OS 3.50 and above only.
  1355.  
  1356. This SWI will reprogram the maximum size of an existing dynamic area. Do not attempt to set a maximum which causes the area, at its current position, to overlap another. Do not attempt to set a maximum which exceeds the total available memory on the system. Do not set a maximum which is below the current size of the area.
  1357.  
  1358.  
  1359. KaData_ObmatOp
  1360. (SWI &482D7)
  1361.     Perform an operation on an object matrix, or Obmat for short
  1362.     (not implemented in 0.30)
  1363.  
  1364. On entry
  1365.  
  1366. R0 = reason code
  1367. other registers are parameters and depend upon the reason code
  1368.  
  1369. On exit
  1370.  
  1371. R0 preserved
  1372. other registers depend on the reason code
  1373.  
  1374. Interrupts
  1375.  
  1376. Interrupt status is undefined
  1377. Fast interrupts are enabled
  1378.  
  1379. Processor mode
  1380.  
  1381. Processor is in SVC mode
  1382.  
  1383. Re-entrancy
  1384.  
  1385. Not defined
  1386.  
  1387. Use
  1388.  
  1389. This SWI provides a number of calls to manipulate Obmats.
  1390.  
  1391. R0    Action
  1392. 0    Verify file integrity
  1393.  
  1394. Related SWIs
  1395.  
  1396. None
  1397.  
  1398. Related vectors
  1399.  
  1400. None
  1401.