home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / _suite / !Suite / MakeCode (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1993-09-21  |  2.1 KB  |  99 lines

  1.  >FNgetleaf
  2.  Forms part of !Suite v1.35 upwards
  3.  To do various things which end up being done repeatedly.
  4.  (And in ARM they take up less memory!)
  5.  NSW 26/08/93
  6. " at line ";
  7.  code% 512, block% 512
  8. link=14
  9. pass%=0 
  10. P%=code%
  11. [OPT pass%
  12. %;  on entry  r0 = pointer to text
  13. .getpath%
  14.    MOV  r1,#0
  15.     .loop
  16.    LDRB r2,[r0],#1
  17.    CMP  r2,#
  18. Q r1,r0
  19.    CMP  r2,#&0D
  20.    BEQ  exit
  21.    B    loop
  22.     .exit
  23.    STRB r2,[r1,#-1]
  24.    MOV  pc,link
  25. .getleaf%
  26.    MOV  r1,#0
  27. .loop2
  28.    LDRB r2,[r0],#1
  29.    CMP  r2,#
  30. Q r1,r0
  31.    CMP  r2,#&0D
  32.    BEQ  exit2
  33.    B    loop2
  34. .exit2
  35.    MOV  r0,r1
  36.    MOV  pc,link
  37. .cachecheck
  38.    MOV  r0,#1
  39.    SWI  "Cache_Control"
  40.    MOV  r6,r0
  41.    SWI  "Cache_Control"
  42.    MOV  r0,r6
  43.    MOV  pc,link
  44. .cacheon
  45.    MOV  r0,#1
  46.    SWI  "Cache_Control"
  47.    MOV  pc,link
  48. .cacheoff
  49.    MOV  r0,#0
  50.    SWI  "Cache_Control"
  51.    MOV  pc,link
  52. .armspe
  53.    MOV  r0,#0
  54.    SWI  "Sound_Speaker"
  55.    SUB  r0,r0,#1
  56.    MOV  pc,link
  57. .speakeron
  58.    MOV  r0,#2
  59.    SWI  "Sound_Speaker"
  60.    MOV  pc,link
  61. .speakeroff
  62.    MOV  r0,#1
  63.    SWI  "Sound_Speaker"
  64.    MOV  pc,link
  65. .warntime
  66.    SWI  66
  67.    ADD  r0,r0,#100
  68.    MOV  pc,link
  69. PW$block%="SCSI::SCSIDisc4.$.Test.File":
  70. $block%;"   ";:A%=block%:
  71.  getpath%:
  72. $block%
  73. RP$block%="SCSI::SCSIDisc4.$.Test.File":
  74. $block%;"   ";::A%=block%:
  75. getleaf%
  76. "Cache is ";:
  77. cachecheck=1 
  78. "On" 
  79. "Off"
  80. "Internal Speaker is ";:
  81. armspe*-1)=-1 
  82. "On" 
  83. "Off"
  84. "Warning time = ";
  85. warntime
  86. "CALL cacheon, cacheoff, speakeron, speakeroff"
  87. "Save Code "+
  88. ~code%+" "+
  89. "SetType Code Data"
  90. "FNgetpath offset = ";getpath%-code%
  91. "FNgetleaf        = ";getleaf%-code%
  92. "cachecheck       = ";cachecheck-code%
  93. "armspe           = ";armspe-code%
  94. "warntime         = ";warntime-code%
  95. "Cache ON         = ";cacheon-code%
  96. "Cache OFF        = ";cacheoff-code%
  97. "Speaker ON       = ";speakeron-code%
  98. "Speaker OFF      = ";speakeroff-code%
  99.