Create readable text `.bas' for each tokenized BASIC `,ffb' file.
[ssr] / StraySrc / MiscToys / PlainError / b / plainError.bas
CommitLineData
c1b567d8
MW
1REM
2REM plainError
3REM
4REM Remove the irritating `Application has gone wrong' message.
5REM
6REM © 1996-1998 Mark Wooding
7REM
8
9REM ----- Licensing note ----------------------------------------------------
10REM
11REM PlainError is free software; you can redistribute it and/or modify
12REM it under the terms of the GNU General Public License as published by
13REM the Free Software Foundation; either version 2, or (at your option)
14REM any later version
15REM
16REM PlainError is distributed in the hope that it will be useful,
17REM but WITHOUT ANY WARRANTY; without even the implied warranty of
18REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19REM GNU General Public License for more details.
20REM
21REM You should have received a copy of the GNU General Public License
22REM along with PlainError. If not, write to the Free Software Foundation,
23REM 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25help$="PlainError"+CHR$(9)+"1.02 (%dy %m3 %ce%yr) © %ce%yr Mark Wooding"
26
27DIM code% 1024
28!code%=3
29SYS "OS_Word",14,code%
30SYS "OS_ConvertDateAndTime",code%,code%+8,256,help$
31SYS "XOS_GenerateError",code%+8 TO help$
32
33
34FOR o=4 TO 6 STEP 2
35O%=code%
36P%=0
37
38[ opt o
39
40 dcd 0
41 dcd init
42 dcd final
43 dcd service
44 dcd title
45 dcd help
46 dcd 0
47
48.title
49 equz "PlainError"
50 align
51
52.init
53 stmfd r13!,{r14}
54 mov r0,#6
55 mov r3,#256
56 swi "XOS_Module"
57 strvc r2,[r12,#0]
58 ldmfd r13!,{pc}
59
60.final
61 stmfd r13!,{r14}
62 mov r0,#7
63 ldr r2,[r12,#0]
64 swi "XOS_Module"
65 mov r14,#0
66 str r14,[r12,#0]
67 ldmfd r13!,{pc}^
68
69.service
70 stmfd r13!,{r14}
71 eor r14,r1,#&40000
72 teq r14,#&c0
73 ldmnefd r13!,{pc}^
74
75 stmfd r13!,{r0,r1}
76 ldr r12,[r12,#0]
77
78 mov r14,#0
79 str r14,[r12,#0]
80
81 add r0,r12,#4
82 add r2,r2,#4
83.a
84 ldrb r14,[r2],#1
85 cmp r14,#&20
86 movcc r14,#0
87 strb r14,[r0],#1
88 bcs a
89
90 mov r2,r12
91 ldmfd r13!,{r0,r1,pc}^
92
93.help
94 equz help$
95 align
96
97]
98NEXT
99
100SYS "OS_File",10,"PlainError",&FFA,,code%,O%
101END