;R2,R3 are the coords from the top left in the work area
BL linkscan
BCS nolink
.link
BL swapfile
BLVC doswap
.nolink
B eventins
.forceredraw
STMFD R13!,{R14}
ADD R1,R12,#v.data
LDR R0,[R12,#v.viewerhandle]
STR R0,[R1,#0]
SWI Wimp_GetWindowState
LDR R0,[R1]
MOV R1,#0
MOV R2,#-9999
MOV R3,#9999
MOV R4,#0
SWI Wimp_ForceRedraw
LDMFD R13!,{PC}
.linkscan
STMFD R13!,{R0-R4,R14}
MOV R0,#0
STR R0,[R12,#v.link]
LDR R10,[R12,#v.textptr]
.lsloop
LDR R4,[R12,#v.workptr]
MOV R8,#0
.lsloop2
CMP R3,#Text_height
CMPLT R2,R8
BLT lsfound
.lstestskip
LDRB R0,[R10],#1 ;emulate window draw routine, but without writes
CMP R10,R4
BGE lsfail
CMP R0,#"<"
BLEQ htmlcom
CMP R0,#"&"
BLEQ ampcom
CMP R0,#9
BLEQ drawtab
CMP R0,#&0A
BEQ lslineend
CMP R3,#Text_height ;start to sub R2 if this is our line
BGE lsloop
CMP R0,#&20 ;sub if a real char
ADDGE R8,R8,#Text_width
B lsloop2
.lslineend
SUBS R3,R3,#Text_height
BMI lsfail
B lsloop
.lsfail
LDMFD R13!,{R0-R4,R14}
ORR R14,R14,#1<<29
MOVS PC,R14
.lsfound
LDR R0,[R12,#v.link]
CMP R0,#0
BEQ lsfail
LDMFD R13!,{R0-R4,R14}
MOV R0,R10
BIC R14,R14,#1<<29
MOVS PC,R14
.jtscan
STMFD R13!,{R0-R4,R14}
MOV R0,#-1
STR R0,[R12,#v.anc]
ADD R0,R12,#v.anchor
LDRB R0,[R0]
CMP R0,#0
BEQ jtend
CMP R0,#255
BEQ numberanchor
MOV R6,#0
LDR R10,[R12,#v.textptr]
.jtloop
LDR R4,[R12,#v.workptr]
.jtloop2
LDRB R0,[R10],#1 ;emulate window draw routine, but without writes
CMP R10,R4
BGE jtend
CMP R0,#"<"
BLEQ htmlcom
CMP R0,#"&"
BLEQ ampcom
CMP R0,#&0A
BEQ jtlineend
B jtloop2
.jtlineend
ADD R6,R6,#Text_height
LDR R0,[R12,#v.anc]
CMP R0,#-1
BEQ jtloop ;drops through
.jtend
LDMFD R13!,{R0-R4,R14}
LDR R0,[R12,#v.anc]
CMP R0,#-1
BICNE R14,R14,#1<<29
ORREQ R14,R14,#1<<29
MOVS PC,R14
.numberanchor
ADD R0,R12,#v.anchor
LDR R0,[R0,#4]
STR R0,[R12,#v.anc]
B jtend
; Menu selection code
.menuproc
LDR R0,[R1]
CMP R0,#m_back
BEQ back
CMP R0,#m_contents
BEQ contents
CMP R0,#m_index
BEQ index
CMP R0,#m_newview
BEQ newview
CMP R0,#m_export
BEQ export
CMP R0,#m_help
BEQ dohelp
CMP R0,#m_quit
BEQ doquit
.menuins
ADD R1,R12,#v.data
SWI Wimp_GetPointerInfo
LDR R0,[R1,#8]
TST R0,#1
BNE remakemenu
B eventins
.closeback
ADD R0,R12,#v.filename2
LDRB R0,[R0]
CMP R0,#0
BEQ eventins
BL windback
BL doswap
B eventins
.back
ADD R0,R12,#v.filename2
LDRB R0,[R0]
CMP R0,#0
BEQ eventins
BL windback
BL doswap
B menuins
.contentsstr
DCB "CONTENTS",0
.contentsupstr
DCB "^.CONTENTS",0
.indexstr
DCB "INDEX",0
.indexupstr
DCB "^.INDEX",0
ALIGN
.contents
ADR R0,contentsstr
STR R0,[R12,#v.link]
BL swapfile
BVS nocontents
BL swaptest
BVC foundcont
.cloop
ADR R0,contentsupstr
STR R0,[R12,#v.link]
BL swapfile
BVS nocontents
BL swaptest
BVC foundcont
B cloop
.nocontents
BL nocontentserr
BL windback
BL doswap
B menuins
.foundcont
BL doswap
B menuins
.index
ADR R0,indexstr
STR R0,[R12,#v.link]
BL swapfile
BVS noindex
BL swaptest
BVC foundindex
.iloop
ADR R0,indexupstr
STR R0,[R12,#v.link]
BL swapfile
BVS noindex
BL swaptest
BVC foundindex
B iloop
.noindex
BL noindexerr
BL windback
BL doswap
B menuins
.foundindex
BL doswap
B menuins
.newviewcom
DCB "Run MicroHelp:!Run ",0
ALIGN
.newview
ADR R1,newviewcom
ADD R0,R12,#v.data
BL strcpy
ADD R1,R12,#v.filename
BL strcat
ADD R0,R12,#v.data
SWI Wimp_StartTask
B menuins
.exportname
DCB "Export",0
ALIGN
.export
LDR R0,[R1,#4] ;test for export as html
CMP R0,#1
MOVNE R0,#0
STR R0,[R12,#v.exporttype]
BL geteditshandle
BLVS noeditorerr
BVS menuins
MOV R4,R0
LDR R0,[R12,#v.textptr]
STR R0,[R12,#v.ramptr]
ADD R1,R12,#v.data
SWI Wimp_GetPointerInfo
LDR R2,[R1,#0];mouse coords
LDR R3,[R1,#4]
ADD R1,R12,#v.data
MOV R0,#256
STR R0,[R1,#0]
MOV R0,#0
STR R0,[R1,#12]
MOV R0,#1
STR R0,[R1,#16];message type
MOV R0,#-2
STR R0,[R1,#20];destination window
MOV R0,#-1
STR R0,[R1,#24];destination icon
STR R2,[R1,#28]
STR R3,[R1,#32]
LDR R2,[R12,#v.textptr]
LDR R3,[R12,#v.textend]
SUB R0,R3,R2
MOV R0,#256
STR R0,[R1,#36];estimated size
MOV R0,#&FFF
STR R0,[R1,#40];filetype
ADD R0,R1,#44
ADD R1,R12,#v.filename
LDR R2,[R12,#v.html]
LDR R3,[R12,#v.exporttype]
CMP R2,R3
ADRNE R1,exportname
BL strcpy
MOV R0,#18
ADD R1,R12,#v.data
MOV R2,R4
SWI Wimp_SendMessage
B menuins
.ename1
DCB "EDIT",0
.ename2
DCB "ZAP",0
.ename3
DCB "STRONGED",0
.ename4
DCB "_INSERT YOURS HERE",0
ALIGN
.geteditshandle
STMFD R13!,{R14}
MOV R5,#0
.geloop
CMP R5,#0
BLT noeditors
MOV R0,R5
ADD R1,R12,#v.data
MOV R2,#256
SWI XTaskManager_EnumerateTasks
LDMVSFD R13!,{R14}
BVS ro3onlyerr
MOV R5,R0
MOV R4,R1
ADD R3,R12,#v.data
.geloop2
CMP R3,R4
BGE geloop
LDR R1,[R3,#4];get task name
ADR R0,ename1
BL strcmp
BEQ foundeditor
ADR R0,ename2
BL strcmp
BEQ foundeditor
ADR R0,ename3
BL strcmp
BEQ foundeditor
ADR R0,ename4
BL strcmp
BEQ foundeditor
ADD R3,R3,#16
B geloop2
.foundeditor
LDR R0,[R3,#0]
LDMFD R13!,{R14}
BIC R14,R14,#1<<28
MOVS PC,R14
.noeditors
LDMFD R13!,{R14}
ORR R14,R14,#1<<28
MOVS PC,R14
.selfhelpcom
DCB "Run Microhelp:!Help",0
ALIGN
.dohelp
ADR R0,selfhelpcom
SWI Wimp_StartTask
B menuins
; Main redraw code
.redraw
ADD R1,R12,#v.data
SWI Wimp_RedrawWindow
MOV R11,R1
CMP R0,#0
BEQ eventins
.rectloop
MOV R0,#7
STR R0,[R12,#v.colour]
MOV R0,#0
STR R0,[R12,#v.heading]
LDR R0,[R12,#v.filewidth]
STR R0,[R12,#v.oldwidth]
LDR R0,[R11,#wimp_r.vminx]
ADD R0,R0,#4
LDR R2,[R11,#wimp_r.scrx]
SUB R0,R0,R2
LDR R1,[R11,#wimp_r.vmaxy]
SUB R1,R1,#4
LDR R2,[R11,#wimp_r.scry]
SUB R1,R1,R2
LDR R2,[R11,#wimp_r.gmaxy]
SUB R1,R1,R2
LDR R10,[R12,#v.textptr]
CMP R10,#0
BEQ redrawdone
.lineskiploop
CMP R1,#Text_height*2
BLT lineskipped
BL skipline
BCS redrawdone
SUB R1,R1,#Text_height
B lineskiploop
.lineskipped
LDR R2,[R11,#wimp_r.gmaxy]
ADD R1,R1,R2
MOV R6,R0
MOV R7,R1
.writeloop
BL movecsr
LDR R4,[R12,#v.workptr]
MOV R8,#0
.writeloop2
CMP R10,R4
BGE redrawdone
LDRB R0,[R10],#1
CMP R0,#"<"
BLEQ htmlcom
CMP R0,#"&"
BLEQ ampcom
CMP R0,#9
BLEQ drawtab
CMP R0,#&0A
BEQ writelineend
CMP R0,#&20
BLT writeloop2
LDR R1,[R12,#v.heading]
CMP R1,#0
BGT writeheading
SWI OS_WriteC
.writeheadingins
ADD R8,R8,#Text_width
B writeloop2
.writelineend
LDR R0,[R12,#v.filewidth]
CMP R8,R0
STRGT R8,[R12,#v.filewidth]
SUB R7,R7,#Text_height
LDR R0,[R11,#wimp_r.gminy]
CMP R7,R0
BGE writeloop
.redrawdone
ADD R1,R12,#v.data
SWI Wimp_GetRectangle
MOV R11,R1
CMP R0,#0
BNE rectloop
LDR R0,[R12,#v.oldwidth]
LDR R1,[R12,#v.filewidth]
CMP R0,R1
BLNE resize
B eventins
.skipline
STMFD R13!,{R0-R1,R14}
LDR R1,[R12,#v.workptr]
.skloop2
LDRB R0,[R10],#1
CMP R10,R1
BGE skipoverend
CMP R0,#&0A
BNE skloop2
LDMFD R13!,{R0-R1,R14}
BIC R14,R14,#1<<29
MOVS PC,R14
.skipoverend
LDMFD R13!,{R0-R1,R14}
ORR R14,R14,#1<<29 ;flag end of text
MOVS PC,R14
.writeheading
STMFD R13!,{R5-R7}
MOV R5,R0
ADD R6,R6,R8
SUB R6,R6,#2
SUB R7,R7,#2
BL movecsr
LDR R0,[R12,#v.heading]
CMP R0,#1
MOVEQ R0,#3
ADDNE R0,R0,#6
CMP R0,#8
MOVEQ R0,#15
CMP R0,#13
MOVEQ R0,#3
SWI Wimp_SetColour
MOV R0,R5
SWI OS_WriteC
LDR R0,[R12,#v.colour]
SWI Wimp_SetColour
ADD R6,R6,#2
ADD R7,R7,#2
BL movecsr
MOV R0,R5
SWI OS_WriteC
LDMFD R13!,{R5-R7}
B writeheadingins
.drawtab
STMFD R13!,{R6,R14}
ADD R8,R8,#Text_width*8
BIC R8,R8,#Text_width*8-1
ADD R6,R6,R8
BL movecsr
MOV R0,#0
LDMFD R13!,{R6,PC}
.hrefcom
DCB 27,"A",27,"HREF",27,"=",27,34,0
.namecom
DCB 27,"A",27,"NAME",27,"=",27,34,0
.ancendcom
DCB 27,"/A",0
.headingcom
DCB "H",0
.headingend
DCB "/H",0
.boldcom
DCB "B",0
.boldend
DCB "/B",0
ALIGN
.htmlcom
STMFD R13!,{R1-R4,R14}
ADR R0,hrefcom
BL scanline
BLEQ setblue
ADR R0,ancendcom
BL scanline
BLEQ setblack
ADR R0,namecom
BL scanline
BLEQ testanchor
ADR R0,headingcom
BL scanline
BLEQ headingon
ADR R0,headingend
BL scanline
BLEQ headingoff
ADR R0,boldcom
BL scanline
BLEQ boldon
ADR R0,boldend
BL scanline
BLEQ headingoff
.skipcomloop
LDRB R0,[R10],#1
CMP R10,R4
BGE skipcomend
CMP R0,#">"
BEQ skippedcom
CMP R0,#"<"
BEQ badskip
B skipcomloop
.skippedcom
MOV R0,#0
LDMFD R13!,{R1-R4,PC}
.skipcomend
MOV R0,#&0A
LDMFD R13!,{R1-R4,PC}
.badskip
SWI OS_WriteS
DCB "[Error : Embedded tag missing '>' ]",0
ALIGN
B skippedcom
.setblack
STMFD R13!,{R14}
MOV R0,#0
STR R0,[R12,#v.link]
MOV R0,#7
STR R0,[R12,#v.colour]
SWI Wimp_SetColour
LDMFD R13!,{PC}
.setblue
STMFD R13!,{R14}
STR R1,[R12,#v.link]
MOV R0,#8
STR R0,[R12,#v.colour]
SWI Wimp_SetColour
LDMFD R13!,{PC}
.setred
STMFD R13!,{R14}
MOV R0,#11
STR R0,[R12,#v.colour]
SWI Wimp_SetColour
LDMFD R13!,{PC}
.testanchor
STMFD R13!,{R14}
ADD R0,R12,#v.anchor ;R1 is as it should be
LDRB R2,[R0]
CMP R2,#0
LDMEQFD R13!,{PC}
BL strcmp
LDMNEFD R13!,{PC}
STR R6,[R12,#v.anc]
BL setred
LDMFD R13!,{PC}
.headingon
LDRB R0,[R10,#1]
SUBS R0,R0,#"0"
CMP R0,#1
MOVLE R0,#1
CMP R0,#6
MOVGT R0,#0
STR R0,[R12,#v.heading]
MOV PC,R14
.boldon
MOV R0,#7
STR R0,[R12,#v.heading]
MOV PC,R14
.headingoff
STMFD R13!,{R14}
MOV R0,#0
STR R0,[R12,#v.heading]
BL setblack
LDMFD R13!,{PC}
.ampamp
DCB "AMP;",0
.amplt
DCB "LT;",0
ALIGN
.ampcom
STMFD R13!,{R1-R4,R14}
MOV R3,#0
ADR R0,ampamp
BL scanline
MOVEQ R3,#"&"
ADR R0,amplt
BL scanline
MOVEQ R3,#"<"
.skipamploop
LDRB R0,[R10],#1
CMP R10,R4
BGE skipampend
CMP R0,#";"
BEQ skippedamp
CMP R0,#"&"
BEQ badskipamp
B skipamploop
.skippedamp
MOV R0,R3
LDMFD R13!,{R1-R4,PC}
.skipampend
MOV R0,#&0A
LDMFD R13!,{R1-R4,PC}
.badskipamp
SWI OS_WriteS
DCB "[Error : Embedded entity missing ';' ]",0
ALIGN
B skippedamp
.resize
STMFD R13!,{R0-R1,R14}
ADD R1,R12,#v.data
MOV R0,#0
STR R0,[R1]
STR R0,[R1,#12]
LDR R0,[R12,#v.filewidth]
ADD R0,R0,#4
CMP R0,#Window_width
MOVLT R0,#Window_width
BIC R0,R0,#3
STR R0,[R1,#8]
LDR R0,[R12,#v.fileheight]
ADD R0,R0,#4
CMP R0,#1024
MOVLT R0,#1024
RSB R0,R0,#0
BIC R0,R0,#3
STR R0,[R1,#4]
LDR R0,[R12,#v.viewerhandle]
SWI Wimp_SetExtent
LDMFD R13!,{R0-R1,PC}
.open
MOV R0,#0
ADD R1,R12,#v.data
SWI Wimp_OpenWindow
B eventins
.zerovscroll
STMFD R13!,{R14}
MOV R0,#0
BL movevscroll
LDMFD R13!,{PC}
.jumptoanchor
STMFD R13!,{R14}
BL jtscan
MOV R0,#0
LDRCC R0,[R12,#v.anc]
SUBS R0,R0,#4*Text_height
MOVMI R0,#0
STR R0,[R12,#v.anc]
BL movevscroll
LDMFD R13!,{PC}
.movevscroll
STMFD R13!,{R3,R14}
MOV R3,R0
ADD R1,R12,#v.data
LDR R0,[R12,#v.viewerhandle]
STR R0,[R1,#0]
SWI Wimp_GetWindowState
RSB R0,R3,#0
STR R0,[R1,#wimp_r.scry]
SWI Wimp_OpenWindow
LDMFD R13!,{R3,PC}
.movecsr
STMFD R13!,{R0,R14}
SWI 256+25
SWI 256+188
AND R0,R6,#&FF
SWI OS_WriteC
AND R0,R6,#&FF00
MOV R0,R0,LSR #8
SWI OS_WriteC
AND R0,R7,#&FF
SWI OS_WriteC
AND R0,R7,#&FF00
MOV R0,R0,LSR #8
SWI OS_WriteC
LDMFD R13!,{R0,PC}
.mesrecd
ADD R1,R12,#v.data
LDR R0,[R1,#16]
CMP R0,#0
BEQ doquit
CMP R0,#1
BEQ mesdatasave
CMP R0,#3
BEQ mesdataload
CMP R0,#6
BEQ mesramfetch
MOV R2,#&400CC ;Message_windowinfo
CMP R0,R2
BEQ mesiconize
B eventins
.mesramfetch
; the ram transfer message
; we'll use the end of the v.data block as a 128 byte cache
LDR R0,[R1,#8]
STR R0,[R1,#12] ;mov my_ref into your_ref
LDR R9,[R1,#4]; target handle
LDR R8,[R1,#20]; target buffer
LDR R7,[R1,#24]; target buffer length
MOV R6,#0 ; bytes transferred
LDR R5,[R12,#v.exporttype]; if 1, export the file with HTML comms
LDR R10,[R12,#v.ramptr] ;our pointer to our progress through the file so far
CMP R10,#0
BEQ eventins
ADD R11,R12,#v.data+128 ;this points to our write buffer
.mrwriteloop
CMP R7,#0 ;have we filled the target's buffer?
BLE mrend
LDR R4,[R12,#v.textend]
CMP R10,R4 ;have we finished our text?
MOVGE R4,#-1; flag this as the last message
BGE mrend
LDRB R0,[R10],#1
CMP R5,#1
BEQ mrskipdecode
CMP R0,#"<" ;remove html commands
BLEQ htmlcom
CMP R0,#"&"
BLEQ ampcom
.mrskipdecode
CMP R0,#0
BEQ mrwriteloop
STRB R0,[R11],#1
ADD R6,R6,#1 ;inc the bytes transferred count
SUBS R7,R7,#1 ;dec the target buffer size
ADD R0,R12,#v.data+256 ;have we filled our cache?
CMP R11,R0
BLGE transcache ;if so, empty it
B mrwriteloop
.mrend
BL transcache ;transfer the part-filled cache
STR R10,[R12,#v.ramptr] ;save our pointer for the next message
;now write our wimp message
ADD R1,R12,#v.data
MOV R0,#28
STR R0,[R1,#0] ;message block size
MOV R0,#7
STR R0,[R1,#16] ;message type Message_RAMTransmit
;don't touch [R1,#20], it's the target buffer address
STR R6,[R1,#24] ;no.of bytes transferred
MOV R0,#18 ;message type User_Message_Recorded
CMP R6,#0 ;is this the last message because it's size is zero?
CMPNE R4,#-1 ;is this the last because we've reached the end of our text?
MOVEQ R0,#0
STREQ R0,[R12,#v.ramptr] ; we shouldn't get another message after this
MOVEQ R0,#17 ;User_Message
MOV R2,R9 ;destination task handle
SWI Wimp_SendMessage
B eventins
.mesramfail
B eventins
.transcache
STMFD R13!,{R0-R4,R14}
LDR R0,[R12,#v.taskhandle]
ADD R1,R12,#v.data+128
MOV R2,R9 ;target handle
MOV R3,R8 ;target buffer
SUBS R4,R11,R1
SWINE Wimp_TransferBlock
ADD R8,R8,R4 ;advance target buffer pointer
ADD R11,R12,#v.data+128; reset R11 to start of cache
LDMFD R13!,{R0-R4,PC}
.savepath
DCB "<Wimp$Scrap>",0
ALIGN
.mesdatasave
LDR R0,[R1,#20]
LDR R2,[R12,#v.viewerhandle]
CMP R0,R2
BNE eventins
MOV R10,R1
LDR R0,[R10,#8]
STR R0,[R10,#12]
MOV R0,#256
STR R0,[R1,#0]
MOV R0,#2; Message_DataSaveAck
STR R0,[R10,#16]
MOV R0,#-1
STR R0,[R10,#36]
ADR R1,savepath
ADD R0,R10,#44
BL strcpy
MOV R0,#17
MOV R1,R10
LDR R2,[R1,#4]
SWI Wimp_SendMessage
B eventins
.mesdataload
LDR R0,[R1,#20]
LDR R2,[R12,#v.viewerhandle]
CMP R0,R2
BNE eventins
LDR R0,[R1,#8]
STR R0,[R1,#12] ;mov my_ref into your_ref
MOV R0,#4
STR R0,[R1,#16]
MOV R0,#17
LDR R2,[R1,#4]
SWI Wimp_SendMessage
ADD R1,R12,#v.data
ADD R0,R1,#44
STR R0,[R12,#v.link]
BL swapfile
BVS eventins
BL doswap
B eventins
.iconsprite
DCB "mhelp",0
ALIGN
.mesiconize
LDR R0,[R1,#20]
LDR R2,[R12,#v.viewerhandle]
CMP R0,R2
BNE menuins
MOV R10,R1
LDR R0,[R10,#8]
STR R0,[R10,#12] ;mov my_ref into your_ref
LDR R9,[R10,#4]; target handle
MOV R0,#60
STR R0,[R10,#0]
MOV R0,#&400CC;Message_WindowInf
STR R0,[R10,#16]
LDR R0,[R12,#v.viewerhandle]
STR R0,[R10,#20]
MOV R0,#0
STR R0,[R10,#24]
ADD R0,R10,#28
ADR R1,iconsprite
BL strcpy
ADD R0,R12,#v.filename
MOV R3,R0
BL strseek
MOV R2,#11
.iconloop
LDRB R1,[R0,#-1]!
CMP R1,#"."
CMPNE R1,#":"
MOVEQ R2,#0
SUBS R2,R2,#1
BGT iconloop
ADD R0,R0,#1
CMP R0,R3
MOVLT R0,R3
MOV R1,R0
ADD R0,R10,#36
BL strcpy
MOV R0,#17
ADD R1,R12,#v.data
MOV R2,R9
SWI Wimp_SendMessage
B menuins
.ackrecd
;received a message acknowledgement
;usually when out Message_DataLoad has bounced
LDR R0,[R1,#4] ;extract the senders task handle
LDR R2,[R12,#v.taskhandle]
CMP R0,R2 ;is it us?
BNE eventins
LDR R0,[R1,#16]
CMP R0,#5 ;is it a dataload?
BNE eventins
LDR R2,runcom
STR R2,[R1,#40]
ADD R0,R1,#40
SWI Wimp_StartTask
; and pass to Wimp_StartTask
B eventins
.runcom
DCB "Run "
.close
LDR R9,[R1,#0];closed handle
LDR R2,[R12,#v.viewerhandle]
CMP R9,R2
BNE closeinfo
ADD R1,R12,#v.data+128
SWI Wimp_GetPointerInfo
LDR R0,[R1,#8];get button state
TST R0,#1
BNE closeback
ADD R1,R12,#v.data
SWI Wimp_CloseWindow
B doquit
.closeinfo
SWI Wimp_CloseWindow
B eventins
.doquit
MOV R0,#1
STR R0,[R12,#v.quit]
B eventins
.templatefile
DCB "Microhelp:Templates",0
.infoname
DCB "Proginfo",0
.viewername
DCB "Viewer",0
ALIGN
.openinfo
STMFD R13!,{R14}
LDR R0,[R12,#v.infohandle]
ADD R1,R12,#v.data
STR R0,[R1]
SWI Wimp_GetWindowState
MOV R0,#-1
STR R0,[R1,#28]
SWI Wimp_OpenWindow
LDMFD R13!,{PC}
.openviewer
STMFD R13!,{R14}
LDR R0,[R12,#v.viewerhandle]
ADD R1,R12,#v.data
STR R0,[R1]
SWI Wimp_GetWindowState
MOV R0,#-1
STR R0,[R1,#28]
SWI Wimp_OpenWindow
LDMFD R13!,{PC}
.createwindows
STMFD R13!,{R14}
LDR R1,[R12,#v.infotemp]
SWI Wimp_CreateWindow
STR R0,[R12,#v.infohandle]
STR R0,infohandle
LDR R1,[R12,#v.viewertemp]
SWI Wimp_CreateWindow
STR R0,[R12,#v.viewerhandle]
LDMFD R13!,{PC}
.loadtemplates
STMFD R13!,{R14}
ADD R1,R12,#v.templates
STR R1,[R12,#v.tempptr]
ADD R1,R12,#v.icons
STR R1,[R12,#v.iconptr]
ADR R1,templatefile
SWI Wimp_OpenTemplate
ADR R0,infoname
BL loadtemp
BVS closetemp
STR R0,[R12,#v.infotemp]
ADR R0,viewername
BL loadtemp
BVS closetemp
STR R0,[R12,#v.viewertemp]
.closetemp
SWI Wimp_CloseTemplate
LDMFD R13!,{PC}
.loadtemp
STMFD R13!,{R1-R6,R14}
MOV R1,R0
ADD R0,R12,#v.buffer
BL strcpy
;MOV R1,#-1
;LDR R2,[R12,#v.iconptr]
;ADD R3,R12,#v.iconsend
;MOV R4,#-1
;ADD R5,R12,#v.buffer
;MOV R6,#0
;SWI Wimp_LoadTemplate
;CMP R6,#0
;LDMEQFD R13!,{R1-R6,R14}
;BEQ notemperr
;STR R1,[R12,#v.tempsize]
;STR R2,[R12,#v.iconsize]
;MOV PC,#0
;LDR R0,[R12,#v.tempptr]
;ADD R0,R0,R1
;ADD R1,R12,#v.icons;end of template area
;CMP R0,R1
;LDMGTFD R13!,{R1-R6,R14}
;BGT tempspaceerr
;LDR R0,[R12,#v.iconptr]
;ADD R0,R0,R2
;ADD R1,R12,#v.iconsend
;CMP R0,R1
;LDMGTFD R13!,{R1-R6,R14}
;BGT iconspaceerr
LDR R1,[R12,#v.tempptr]
LDR R2,[R12,#v.iconptr]
ADD R3,R12,#v.iconsend
MOV R4,#-1
ADD R5,R12,#v.buffer
MOV R6,#0
SWI Wimp_LoadTemplate
CMP R6,#0
LDMEQFD R13!,{R1-R6,R14}
BEQ notemperr
LDR R0,[R12,#v.tempptr]
;LDR R1,[R12,#v.tempsize]
;ADD R1,R1,#3
;BIC R1,R1,#3
ADD R2,R0,#&1A8
STR R2,[R12,#v.tempptr]
LDR R2,[R12,#v.iconptr]
;LDR R1,[R12,#v.iconsize]
;ADD R1,R1,#3
;BIC R1,R1,#3
ADD R2,R2,#&50
STR R2,[R12,#v.iconptr]
LDMFD R13!,{R1-R6,PC}
.swapfile
STMFD R13!,{R14}
ADD R10,R12,#v.filename
LDR R11,[R12,#v.link]
CMP R11,#0
LDMEQFD R13!,{PC}
BL writenumanchor
BL windforward
LDRB R0,[R11]
CMP R0,#"#" ;is this a link inside this file?
BEQ locallink
MOV R0,R11
BL testifrooted
BLEQ swaprooted
BEQ noadddot
.diruploop
LDRB R1,[R11]
CMP R1,#"^"
BNE nodirup
MOV R0,R10
BL removedir
LDMVSFD R13!,{PC} ;error if can't remove entry
ADD R11,R11,#2
B diruploop
.nodirup
MOV R0,R10
BL removedir
LDMVSFD R13!,{PC} ;error if can't remove entry
.noadddot
MOV R1,R11
BL filestrcat
BL grabanchor
LDMFD R13!,{R14}
BIC R14,R14,#1<<28
MOVS PC,R14
.locallink
MOV R0,R11
BL getanchor
LDMFD R13!,{R14}
BIC R14,R14,#1<<28
MOVS PC,R14
.swaprooted
STMFD R13!,{R1,R14}
ADD R0,R12,#v.filename
MOV R1,#0
STRB R1,[R0] ;leave R0 set correctly
LDMFD R13!,{R1,PC}
.dot
DCB ".",0
ALIGN
.doswap
STMFD R13!,{R14}
BL readfile
BVS badswap
BCS nontext
BL resize
BL jumptoanchor
BL forceredraw
LDMFD R13!,{PC}
.doswapagain
STMFD R13!,{R14}
BL readfile
BLVS forceredraw
LDMFD R13!,{PC}
.badswap
MOV R0,#0
ADD R1,R12,#v.filename
BL openerr
BL forceredraw
ADD R0,R12,#v.filename2
LDRB R0,[R0]
CMP R0,#0
LDMEQFD R13!,{PC}
.nontext
BL windback
BL doswapagain
LDMFD R13!,{PC}
.swaptest
STMFD R13!,{R14}
BL readfile
LDMFD R13!,{PC}
.writenumanchor
STMFD R13!,{R14}
ADD R1,R12,#v.data
LDR R0,[R12,#v.viewerhandle]
STR R0,[R1,#0]
SWI Wimp_GetWindowState
ADD R0,R12,#v.anchor
MOV R2,#&FFFFFFFF
STR R2,[R0]
LDR R2,[R1,#wimp_r.scry]
RSB R2,R2,#0
ADD R2,R2,#Text_height*4
STR R2,[R0,#4]
MOV R2,#0
STR R2,[R0,#8]
LDMFD R13!,{PC}
.windforward
STMFD R13!,{R14}
ADD R2,R12,#v.filename9
ADD R3,R12,#v.filename8
MOV R4,#8
.wfloop
MOV R0,R2
MOV R1,R3
ADD R2,R2,#Strlen
ADD R3,R3,#Strlen
BL strcpy
SUBS R4,R4,#1
BGT wfloop
ADD R2,R12,#v.anchor9
ADD R3,R12,#v.anchor8
MOV R4,#8
.afloop
MOV R0,R2
MOV R1,R3
ADD R2,R2,#Anclen
ADD R3,R3,#Anclen
BL anccpy
SUBS R4,R4,#1
BGT afloop
MOV R0,#0
STRB R0,[R12,#v.anchor]
LDMFD R13!,{PC}
.windback
STMFD R13!,{R14}
ADD R2,R12,#v.filename
ADD R3,R12,#v.filename2
MOV R4,#8
.wbloop
MOV R0,R2
MOV R1,R3
SUB R2,R2,#Strlen
SUB R3,R3,#Strlen
BL strcpy
SUBS R4,R4,#1
BGT wbloop
ADD R3,R3,#Strlen
MOV R0,#0
STRB R0,[R3]
ADD R2,R12,#v.anchor
ADD R3,R12,#v.anchor2
MOV R4,#8
.abloop
MOV R0,R2
MOV R1,R3
SUB R2,R2,#Anclen
SUB R3,R3,#Anclen
BL anccpy
SUBS R4,R4,#1
BGT abloop
ADD R3,R3,#Anclen
MOV R0,#0
STRB R0,[R3]
LDMFD R13!,{PC}
.readfile
; generic read a file routine
; returns V set if file does not exist
; returns C set if file is not text
STMFD R13!,{R14}
ADD R1,R12,#v.filename
LDRB R0,[R1]
CMP R0,#0
LDMEQFD R13!,{R14}
BEQ nullfileerr
BL getfiletype
CMP R0,#&1000
BEQ opendir
MOV R1,#&FFF
CMP R0,R1
BNE runfile
BL openfile
LDMVSFD R13!,{PC}
BL workshrink
MOV R0,#0
STR R0,[R12,#v.html]
BL denyexporthtml
LDR R10,[R12,#v.workspace]
LDR R9,[R12,#v.workend]
MOV R0,#Window_width
STR R0,[R12,#v.filewidth]
MOV R0,#0
STR R0,[R12,#v.fileheight]
.readloop2
STR R10,[R12,#v.workptr]
SUB R0,R9,R10
CMP R0,#&500 ;maxi.possible extension from one cache read
BGE noextend
BL workextend
MOVVS R0,#0
STRVS R0,[R12,#v.textptr]
LDMVSFD R13!,{PC}
.noextend
BL readcache
BL scanforhtml
MOV R8,R0
MOV R7,R0
ADD R11,R12,#v.data
LDR R6,[R12,#v.html]
.readloop
CMP R8,#0
BLE readdone
LDRB R0,[R11],#1
CMP R6,#1
BEQ notrans
CMP R0,#"<"
BLEQ lttrans
CMP R0,#"&"
BLEQ amptrans
.notrans
CMP R0,#&0A
LDREQ R1,[R12,#v.fileheight]
ADDEQ R1,R1,#Text_height
STREQ R1,[R12,#v.fileheight]
STRB R0,[R10],#1
SUBS R8,R8,#1
B readloop
.readdone
CMP R7,#256
BGE readloop2
STR R10,[R12,#v.workptr]
BL closefile
LDR R0,[R12,#v.workspace]
STR R0,[R12,#v.textptr]
LDR R0,[R12,#v.workptr]
STR R0,[R12,#v.textend]
LDR R0,[R12,#v.html]
CMP R0,#1
BLEQ allowexporthtml
LDMFD R13!,{R14}
BIC R14,R14,#1<<29
MOVS PC,R14
.lttrans
MOV R0,#"&"
STRB R0,[R10],#1
MOV R0,#"l"
STRB R0,[R10],#1
MOV R0,#"t"
STRB R0,[R10],#1
MOV R0,#";"
MOV PC,R14
.amptrans
MOV R0,#"&"
STRB R0,[R10],#1
MOV R0,#"a"
STRB R0,[R10],#1
MOV R0,#"m"
STRB R0,[R10],#1
MOV R0,#"p"
STRB R0,[R10],#1
MOV R0,#";"
MOV PC,R14
.htmloncom
DCB "<",27,"HTML",27,">",0
ALIGN
.scanforhtml
STMFD R13!,{R0-R4,R10,R14}
ADD R10,R12,#v.data
ADD R4,R10,R0
ADR R0,htmloncom
BL scanline
MOV R0,#1
STREQ R0,[R12,#v.html]
LDMFD R13!,{R0-R4,R10,PC}
.workextend
STMFD R13!,{R5,R14}
LDR R0,[R12,#v.workptr]
LDR R1,[R12,#v.workspace]
SUB R0,R0,R1; get size of current heap
LDR R1,[R12,#v.appsize]
ADD R0,R0,R1; add application size
ADD R0,R0,#&1000; add a bit
MOV R1,#-1
MOV R5,R0
SWI Wimp_SlotSize
CMP R0,R5
LDMLTFD R13!,{R5,R14}
BLT nomemerr
SWI OS_GetEnv
STR R1,[R12,#v.workend]
LDMFD R13!,{R5,PC}
.workshrink
STMFD R13!,{R14}
LDR R1,[R12,#v.appsize]
ADD R0,R0,R1; add application size
ADD R0,R0,#&800; add a bit
MOV R1,#-1
SWI XWimp_SlotSize
LDMVSFD R13!,{PC}
SWI OS_GetEnv
STR R1,[R12,#v.workend]
LDMFD R13!,{PC}
.readcache
; returns no.of bytes read in R0
STMFD R13!,{R1-R3,R14}
MOV R0,#4
LDR R1,[R12,#v.filehandle]
ADD R2,R12,#v.data
MOV R3,#256
SWI OS_GBPB
RSB R0,R3,#256
LDMFD R13!,{R1-R3,PC}
.opendir
BL isdirapp
BEQ runfile
ADD R10,R12,#v.data
MOV R0,#256
STR R0,[R10,#0]
MOV R0,#0
STR R0,[R10,#12]
MOV R0,#&400
STR R0,[R10,#16]
MOV R0,#0
STR R0,[R10,#20]
MOV R0,#0
STR R0,[R10,#24]
ADD R0,R10,#28
ADD R1,R12,#v.filename
BL filestrcpy
MOV R0,#17
MOV R1,R10
MOV R2,#0
SWI Wimp_SendMessage
LDMFD R13!,{R14}
ORR R14,R14,#1<<29
MOVS PC,R14
.runfile
;run the file as if double-clicked
;so send a Message_DataOpen
MOV R4,R0;file type
ADD R1,R12,#v.data
SWI Wimp_GetPointerInfo
LDR R2,[R1,#0];mouse coords
LDR R3,[R1,#4]
ADD R1,R12,#v.data
MOV R0,#256
STR R0,[R1,#0]
MOV R0,#0
STR R0,[R1,#12]
MOV R0,#5
STR R0,[R1,#16];message type
LDR R0,[R12,#v.viewerhandle]
STR R0,[R1,#20]
MOV R0,#0
STR R0,[R1,#24]
STR R2,[R1,#28]
STR R3,[R1,#32]
MOV R0,#0
STR R0,[R1,#36]
STR R4,[R1,#40]
ADD R0,R1,#44
ADD R1,R12,#v.filename
BL strcpy
MOV R0,#18
ADD R1,R12,#v.data
MOV R2,#0
SWI Wimp_SendMessage
LDMFD R13!,{R14}
ORR R14,R14,#1<<29
MOVS PC,R14
.getfiletype
; do this in a RISC OS 2 compatible form
STMFD R13!,{R1-R5,R14}
MOV R0,#5
ADD R1,R12,#v.filename
SWI XOS_File
MOVVS R0,#0
CMP R0,#0
MOVEQ R0,#&FFF ;not a file - we'll trap this error later
LDMEQFD R13!,{R1-R5,PC}
CMP R0,#2
MOVGE R0,#&1000
LDMGEFD R13!,{R1-R5,PC}
AND R0,R2,#&FFF00
MOV R0,R0,LSR #8
LDMFD R13!,{R1-R5,PC}
.openfile
STMFD R13!,{R1,R14}
MOV R0,#&4C
ADD R1,R12,#v.filename
SWI XOS_Find
LDMVSFD R13!,{R1,PC}
STR R0,[R12,#v.filehandle]
LDMFD R13!,{R1,PC}
.closefile
STMFD R13!,{R0-R1,R14}
MOV R0,#0
LDR R1,[R12,#v.filehandle]
CMP R1,#0
SWINE XOS_Find
MOV R0,#0
STR R1,[R12,#v.filehandle]
LDMFD R13!,{R0-R1,PC}
.parse
; parse environment string
STMFD R13!,{R14}
SWI OS_GetEnv
MOV R1,R0
ADR R0,filecom
BL stringsearch
LDMCSFD R13!,{R14}
BCS nofileerr
ADD R1,R0,#6
ADD R0,R12,#v.filename
BL filestrcpy
ADD R1,R12,#v.filename
LDRB R0,[R1]
CMP R0,#0
BLEQ setdefaultfile
BL getfileinfo
BVS openerr
CMP R0,#1
BEQ foundfile
CMP R0,#2
LDMNEFD R13!,{R14}
BNE openerr
.founddir
ADD R0,R12,#v.filename
ADR R1,contentstr
BL strcat
ADD R1,R12,#v.filename
BL getfileinfo
CMP R0,#1
LDMNEFD R13!,{R14}
BNE openerr
.foundfile
SWI OS_GetEnv
MOV R1,R0
ADR R0,anchorcom
BL stringsearch
BCS noanchorcom
ADD R1,R0,#8
ADD R0,R12,#v.anchor
BL filestrcpy
.noanchorcom
LDMFD R13!,{PC}
.filecom
DCB "-FILE ",0
.anchorcom
DCB "-ANCHOR ",0
.contentstr
DCB ".Contents",0
.defaultfile
DCB "Microhelp:^.Microhelp",0
ALIGN
.setdefaultfile
STMFD R13!,{R0-R1,R14}
ADD R0,R12,#v.filename
ADR R1,defaultfile
BL filestrcpy
LDMFD R13!,{R0-R1,PC}
.getfileinfo
STMFD R13!,{R14}
MOV R0,#5
SWI XOS_File
LDMFD R13!,{PC}
.testifrooted
STMFD R13!,{R0-R2,R14}
.loop11
LDRB R2,[R0],#1
CMP R2,#"$"
CMPNE R2,#":"
BEQ rooted
CMP R2,#34
MOVEQ R2,#0
CMP R2,#32
BGE loop11
LDMFD R13!,{R0-R2,R14}
BIC R14,R14,#1<<30
MOVS PC,R14
.rooted
LDMFD R13!,{R0-R2,R14}
ORR R14,R14,#1<<30
MOVS PC,R14
.filestrcat
STMFD R13!,{R0-R2,R14}
BL strseek
BL filestrcpy
LDMFD R13!,{R0-R2,PC}
.filestrcpy
STMFD R13!,{R0-R3,R14}
BL skipwhiteR1
.loop5
LDRB R2,[R1],#1
CMP R2,#34
MOVEQ R2,#0
CMP R2,#32
BLE filestrend
STRB R2,[R0],#1
B loop5
.filestrend
MOV R2,#0
STRB R2,[R0],#1
LDMFD R13!,{R0-R3,PC}
.grabanchor
STMFD R13!,{R0-R2,R14}
ADD R0,R12,#v.filename
MOV R1,R0
BL strseek
.loop7
LDRB R2,[R0,#-1]!
CMP R0,R1
BLE gafail
CMP R2,#":"
BEQ gafail
CMP R2,#"#"
BEQ gafound
B loop7
.gafound
MOV R1,#0
STRB R1,[R0]
BL getanchor
LDMFD R13!,{R0-R2,PC}
.gafail
MOV R0,#0
LDMFD R13!,{R0-R2,PC}
.getanchor
STMFD R13!,{R0-R1,R14}
ADD R1,R0,#1
ADD R0,R12,#v.anchor
BL strcpy
LDMFD R13!,{R0-R1,PC}
.isdirapp
STMFD R13!,{R0-R2,R14}
ADD R0,R12,#v.filename
MOV R1,R0
BL strseek
.loop17
LDRB R2,[R0,#-1]!
CMP R0,R1
BLE isfail
CMP R2,#":"
CMPNE R2,#"."
BEQ isfail
CMP R2,#"!"
BEQ isfound
B loop17
.isfound
LDMFD R13!,{R0-R2,R14}
ORR R14,R14,#1<<30
MOVS PC,R14
.isfail
LDMFD R13!,{R0-R2,R14}
BIC R14,R14,#1<<30
MOVS PC,R14
.strcat
STMFD R13!,{R0-R2,R14}
BL strseek
BL strcpy
LDMFD R13!,{R0-R2,PC}
.strseek
STMFD R13!,{R2,R14}
.loop2
LDRB R2,[R0],#1
CMP R2,#34
MOVEQ R2,#0
CMP R2,#32
BGE loop2
SUBS R0,R0,#1
LDMFD R13!,{R2,PC}
.strcmp
STMFD R13!,{R0-R3}
BIC R14,R14,#1<<30
.loop10
LDRB R2,[R0],#1
LDRB R3,[R1],#1
uppercase R2
uppercase R3
CMP R2,#0
ORREQ R14,R14,#1<<30
BEQ strcmpend
CMP R3,R2
BEQ loop10
.strcmpend
LDMFD R13!,{R0-R3}
MOVS PC,R14
.strcpy
STMFD R13!,{R0-R2,R14}
.loop1
LDRB R2,[R1],#1
CMP R2,#34
MOVEQ R2,#0
STRB R2,[R0],#1
CMP R2,#32
BGE loop1
LDMFD R13!,{R0-R2,PC}
.anccpy
STMFD R13!,{R0-R3,R14}
MOV R3,#32
.loopA1
LDRB R2,[R1],#1
STRB R2,[R0],#1
SUBS R3,R3,#1
BGT loopA1
LDMFD R13!,{R0-R3,PC}
.skipwhiteR1
STMFD R13!,{R2,R14}
.skipwhiteloop
LDRB R2,[R1]
CMP R2,#" "
LDMNEFD R13!,{R2,PC}
ADD R1,R1,#1
B skipwhiteloop
.removedir
;removes the last entry from a path but leaves the : or .
;returns end of string in R1
STMFD R13!,{R0-R2,R14}
MOV R1,R0
.loop3
LDRB R2,[R0],#1
CMP R2,#32
BGE loop3
SUB R0,R0,#2
.loop4
LDRB R2,[R0,#-1]!
CMP R0,R1
BLE noremovedir
CMP R2,#"."
CMPNE R2,#":"
BNE loop4
CMP R2,#":"
ADD R0,R0,#1
MOV R2,#0
STRB R2,[R0]
LDMFD R13!,{R0-R2,R14}
BIC R14,R14,#1<<28
MOVS PC,R14
.noremovedir
LDMFD R13!,{R0-R2,R14}
ORR R14,R14,#1<<28
MOVS PC,R14
.stringsearch
STMFD R13!,{R1-R5,R14}
MOV R4,R0
MOV R5,R1
.ssloop1
MOV R0,R4
MOV R1,R5
ADD R5,R5,#1
.ssloop2
LDRB R2,[R0],#1
LDRB R3,[R1],#1
CMP R2,#32 ;check for end of search string
BLT ssfound
CMP R3,#32 ;check for end of command line
BLT ssnotfound
uppercase R2
uppercase R3
CMP R2,R3
BNE ssloop1
B ssloop2
.ssfound
SUB R0,R5,#1
LDMFD R13!,{R1-R5,R14}
BIC R14,R14,#1<<29
MOVS PC,R14
.ssnotfound
MOV R0,#0
LDMFD R13!,{R1-R5,R14}
ORR R14,R14,#1<<29
MOVS PC,R14
;R0 = command
;R10 = string to scan
;R4 = file limit
.scanline
STMFD R13!,{R2-R5,R14}
MOV R1,R10
.slloop
LDRB R2,[R0],#1
CMP R2,#0 ;check for end of search string
BEQ slfound
.slskipwhite
LDRB R3,[R1],#1
uppercase R2
uppercase R3
CMP R1,R4
BGT slnotfound
CMP R3,#&0A
BEQ slskipwhite
CMP R2,#27
BNE noskipwhite
CMP R3,#" "
BEQ slskipwhite
LDRB R2,[R0],#1
CMP R2,#0 ;check for end of search string
BEQ slfound
.noskipwhite
CMP R2,R3
BEQ slloop ;drops through
.slnotfound
MOV R0,#0
LDMFD R13!,{R2-R5,R14}
BIC R14,R14,#1<<30
MOVS PC,R14
.slfound
SUB R0,R5,#1
LDMFD R13!,{R2-R5,R14}
ORR R14,R14,#1<<30
MOVS PC,R14
.writehex8
STMFD R13!,{R14}
ADD R1,R12,#v.buffer
MOV R2,#16
SWI OS_ConvertHex8
SWI OS_Write0
LDMFD R13!,{PC}
.wimperr
STMFD R13!,{R14}
MOV R1,#1
ADR R2,taskname
SWI XWimp_ReportError
LDMFD R13!,{R14}
ORR R14,R14,#1<<28
MOVS PC,R14
.nofileerr
ADR R0,nofiletext
B wimperr
.nofiletext
DCD &666
DCB "Microhelp : No -file command",0
ALIGN
.nomemoryerr
ADR R0,nomemorytext
SWI OS_GenerateError
.nomemorytext
DCD &666
DCB "Microhelp : Not enough memory",0
ALIGN
.stackfault
BL taskclose
ADR R0,stackfaulttext
SWI OS_GenerateError
.stackfaulttext
DCD &666
DCB "Microhelp : Stack fault",0
ALIGN
.nullfileerr
ADR R0,nullfiletext
B wimperr
.nullfiletext
DCD &666
DCB "Microhelp : Empty filename",0
ALIGN
.openerr
STMFD R13!,{R14}
MOV R0,#0
STR R0,[R12,#v.textptr]
MOV R2,#0
ADD R1,R12,#v.filename
MOV R0,#19
SWI XOS_File
B wimperr
.notemperr
ADR R0,notemptext
SWI OS_GenerateError
.notemptext
DCD &666
DCB "Microhelp : Failed to find template",0
ALIGN
;.tempspaceerr
;ADR R0,tempspacetext
;SWI OS_GenerateError
;.tempspacetext
;DCD &666
;DCB "Microhelp : No space for template",0
;ALIGN
;.iconspaceerr
;ADR R0,iconspacetext
;SWI OS_GenerateError
;.iconspacetext
;DCD &666
;DCB "Microhelp : No space for icons",0
;ALIGN
.guarderr
ADR R0,guardtext
SWI OS_GenerateError
.guardtext
DCD &666
DCB "Microhelp : String too long. This could mean a missing ",34," in an HTML instruction or a problem with filenames. Microhelp must leave the Desktop.",0
ALIGN
.ro3onlyerr
ADR R0,ro3onlytext
B wimperr
.nocontentserr
ADR R0,nocontentstext
B wimperr
.noindexerr
ADR R0,noindextext
B wimperr
.ro3onlytext
DCD &666
DCB "That feature is available only with RISC OS 3 or greater.",0
ALIGN
.nocontentstext
DCD &666
DCB "Could not find a Contents file",0
ALIGN
.noindextext
DCD &666
DCB "Could not find an Index file",0
ALIGN
.noeditorerr
ADR R0,noeditortext
B wimperr
.noeditortext
DCD &666
DCB "You need either Edit, Zap or StrongEd loaded to Export.",0