home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / graphics / display / swiftjpeg / !SwiftJPEG / Sources / SourceAsm (.txt) next >
Encoding:
RISC OS BBC BASIC V Source  |  1996-04-20  |  2.4 KB  |  61 lines

  1.  > SourceAsm
  2.  Assemble and save ARM code routines for SwiftJPEG.
  3.  (C) Hipposoft 1996
  4. $+" at line "+
  5.  The codesize% variable holds the amount of space the raw
  6.  ARM code should take. The variable% variable holds the
  7.  number of new variables you wish to 'link' between this
  8.  generator and the loading application - this allows the
  9.  relative addresses of each routine to be tagged onto the
  10.  end of the file, and read in (in the same order as written,
  11.  obviously, so this isn't a totally automatic process by
  12.  any means) when the loader application initialises.
  13.  Clearly, codesize% must be a multiple of 4; variable% can
  14.  be any integer greater than zero.
  15.  If codesize% isn't big enough you'll be warned about it,
  16.  but the value of variable% is not checked in any way.
  17.  The resultant filesize will be codesize%+variable%*4+4 bytes,
  18.  with the first word holding the value codesize%+4.
  19.  So it is intended that the loader should read the first word,
  20.  allocate this word-4 bytes, load the next (word-4) bytes into
  21.  that block, then use the variable% remaining words as
  22.  pointers to read or write, as offsets within the block it
  23.  allocated.
  24. codesize%=52
  25. variable%=4
  26.  This section shouldn't need altering.
  27.  gam% 256,mc% codesize%+variable%*4+4
  28. !mc%=codesize%+4
  29. assemble(mc%+4,codesize%)
  30.  List the variables here...
  31. !(mc%+!mc%+0)=gammtred
  32. !(mc%+!mc%+4)=gammtgre
  33. !(mc%+!mc%+8)=gammtblu
  34. !(mc%+!mc%+12)=gammawrite
  35.  The rest shouldn't need to be altered either.
  36.  a%=0 
  37.  variable%-1
  38. 5)mc%!(!mc%+a%*4)=mc%!(!mc%+a%*4)-mc%-4
  39.  "Save <SwiftJPEG$Dir>.ARMcode "+
  40. ~mc%+" + "+
  41. ~(!mc%+variable%*4)
  42.  "SetType <SwiftJPEG$Dir>.ARMcode FFD"
  43. assemble(c%,d%)
  44.  a%=8 
  45. A    P%=c%
  46. L%=c%+d%
  47. [OPT a%
  48. .gammtred        EQUD    0
  49. .gammtgre        EQUD    0
  50. .gammtblu        EQUD    0
  51. J3.gammawrite      STMFD   R13!,{R0-R2,R4,R9,R14}
  52. L#                 MOV     R0,#19
  53. M&                 SWI     "OS_Byte"
  54. O(                 LDR     R0,gammtred
  55. P(                 LDR     R1,gammtgre
  56. Q(                 LDR     R2,gammtblu
  57. R$                 MOV     R4,#&09
  58. S$                 MOV     R9,#&23
  59. T-                 SWI     "OS_CallAVector"
  60. V2                 LDMFD   R13!,{R0-R2,R4,R9,PC}
  61.