home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1993-09-21 | 2.1 KB | 99 lines |
- >FNgetleaf
- Forms part of !Suite v1.35 upwards
- To do various things which end up being done repeatedly.
- (And in ARM they take up less memory!)
- NSW 26/08/93
- " at line ";
- code% 512, block% 512
- link=14
- pass%=0
- P%=code%
- [OPT pass%
- %; on entry r0 = pointer to text
- .getpath%
- MOV r1,#0
- .loop
- LDRB r2,[r0],#1
- CMP r2,#
- Q r1,r0
- CMP r2,#&0D
- BEQ exit
- B loop
- .exit
- STRB r2,[r1,#-1]
- MOV pc,link
- .getleaf%
- MOV r1,#0
- .loop2
- LDRB r2,[r0],#1
- CMP r2,#
- Q r1,r0
- CMP r2,#&0D
- BEQ exit2
- B loop2
- .exit2
- MOV r0,r1
- MOV pc,link
- .cachecheck
- MOV r0,#1
- SWI "Cache_Control"
- MOV r6,r0
- SWI "Cache_Control"
- MOV r0,r6
- MOV pc,link
- .cacheon
- MOV r0,#1
- SWI "Cache_Control"
- MOV pc,link
- .cacheoff
- MOV r0,#0
- SWI "Cache_Control"
- MOV pc,link
- .armspe
- MOV r0,#0
- SWI "Sound_Speaker"
- SUB r0,r0,#1
- MOV pc,link
- .speakeron
- MOV r0,#2
- SWI "Sound_Speaker"
- MOV pc,link
- .speakeroff
- MOV r0,#1
- SWI "Sound_Speaker"
- MOV pc,link
- .warntime
- SWI 66
- ADD r0,r0,#100
- MOV pc,link
- PW$block%="SCSI::SCSIDisc4.$.Test.File":
- $block%;" ";:A%=block%:
- getpath%:
- $block%
- RP$block%="SCSI::SCSIDisc4.$.Test.File":
- $block%;" ";::A%=block%:
- getleaf%
- "Cache is ";:
- cachecheck=1
- "On"
- "Off"
- "Internal Speaker is ";:
- armspe*-1)=-1
- "On"
- "Off"
- "Warning time = ";
- warntime
- "CALL cacheon, cacheoff, speakeron, speakeroff"
- "Save Code "+
- ~code%+" "+
- "SetType Code Data"
- "FNgetpath offset = ";getpath%-code%
- "FNgetleaf = ";getleaf%-code%
- "cachecheck = ";cachecheck-code%
- "armspe = ";armspe-code%
- "warntime = ";warntime-code%
- "Cache ON = ";cacheon-code%
- "Cache OFF = ";cacheoff-code%
- "Speaker ON = ";speakeron-code%
- "Speaker OFF = ";speakeroff-code%
-