Home » Archimedes archive » Acorn Computing » 1994 11.adf » 9411 » TechForum/DASpatch/s/DASpatch
TechForum/DASpatch/s/DASpatch
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn Computing » 1994 11.adf » 9411 |
Filename: | TechForum/DASpatch/s/DASpatch |
Read OK: | ✔ |
File size: | 0A2C bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
r0 RN 0 r1 RN 1 r2 RN 2 r3 RN 3 r4 RN 4 r5 RN 5 r6 RN 6 r7 RN 7 r8 RN 8 r9 RN 9 r10 RN 10 r11 RN 11 r12 RN 12 r13 RN 13 r14 RN 14 r15 RN 15 sp RN r13 lr RN r14 pc RN r15 XOS_Module * &2001e XOS_ValidateAddress * &2003a XOS_CRC * &2005b XWimp_ReportError * &600df STMFD sp!, {lr} LDRB r0, [r1] ;first char of command tail CMP r0, #'V' CMPNE r0, #'v' MOVEQ r0, #1 MOVNE r0, #0 STR r0, verbose MOV r0, #18 ADR r1, name SWI XOS_Module BVS err1 ;else r3 pts to module LDR r4, [r3, #-4] ;block length in r4 LDR r0, length CMP r4, r0 BLT err4 ;if block length not as expected, return LDR r1, [r3, #&408] LDR r0, newins CMP r0, r1 BEQ err2 LDR r0, oldins CMP r0, r1 BNE err4 ;if instruction not as expected, return MOV r0, #0 MOV r1, r3 ;r1 pts to module LDR r2, crco ADD r2, r3, r2 MOV r3, #1 SWI XOS_CRC ;crc in r0, r1 still pts to module BVS err3 LDR r2, crc CMP r0, r2 BNE err4 ;if crc not as expected, return MOV r0, r1 ;r0 pts to module SUB r4, r4, #4 ;module length in r4 ADD r1, r0, r4 SWI XOS_ValidateAddress ;if C set then not in logical RAM BVS err3 ;r0 still pts to module MOV r1, r0 ;r1 pts to module MOV r0, #11 MOV r2, r4 SWICS XOS_Module ;try to copy to RMA if not in logical RAM BVS err5 MOV r0, #18 ADR r1, name SWI XOS_Module BVS err1 ;else r3 pts to module LDR r0, newins STR r0, [r3, #&408] ADR r0, ret0 ;patch performed B retmess err1 ADR r0, ret1 ;can't find DAS B retmess err2 ADR r0, ret2 ;already patched B retmess err3 ADR r0, ret3 ;unexpected swi error B retmess err4 ADR r0, ret4 ;don't recognise DAS as v 0.03 B retmess err5 ADR r0, ret5 ;can't move to RMA B retmess retmess LDMFD sp!, {lr} LDR r1, verbose CMP r1, #1 MOVNES pc, lr MOV r1, #&11 ADRL r2, daspatchname SWI XWimp_ReportError MOVS pc, lr name DCB "DragASprite", 0 ret0 DCD 0 DCB "DragASprite is now patched.", 0 ret1 DCD 0 DCB "Unable to patch DragASprite as can't find it.", 0 ret2 DCD 0 DCB "DragASprite is already patched.", 0 ret3 DCD 0 DCB "Unable to patch DragASprite due to an unexpected SWI error.", 0 ret4 DCD 0 DCB "Unable to patch DragASprite as don't recognise it as v 0.03.", 0 ret5 DCD 0 DCB "Unable to patch DragASprite as can't move it into the RMA.", 0 daspatchname DCB "DASpatch", 0 ALIGN verbose DCD 0 length DCD &e8c crco DCD &e80 crc DCD &6732 oldins LDR r2, [r12, #24] newins LDR r2, [r12, #28] END
00000000 0a 72 30 20 20 20 20 20 20 52 4e 20 20 20 20 20 |.r0 RN | 00000010 20 30 0a 72 31 20 20 20 20 20 20 52 4e 20 20 20 | 0.r1 RN | 00000020 20 20 20 31 0a 72 32 20 20 20 20 20 20 52 4e 20 | 1.r2 RN | 00000030 20 20 20 20 20 32 0a 72 33 20 20 20 20 20 20 52 | 2.r3 R| 00000040 4e 20 20 20 20 20 20 33 0a 72 34 20 20 20 20 20 |N 3.r4 | 00000050 20 52 4e 20 20 20 20 20 20 34 0a 72 35 20 20 20 | RN 4.r5 | 00000060 20 20 20 52 4e 20 20 20 20 20 20 35 0a 72 36 20 | RN 5.r6 | 00000070 20 20 20 20 20 52 4e 20 20 20 20 20 20 36 0a 72 | RN 6.r| 00000080 37 20 20 20 20 20 20 52 4e 20 20 20 20 20 20 37 |7 RN 7| 00000090 0a 72 38 20 20 20 20 20 20 52 4e 20 20 20 20 20 |.r8 RN | 000000a0 20 38 0a 72 39 20 20 20 20 20 20 52 4e 20 20 20 | 8.r9 RN | 000000b0 20 20 20 39 0a 72 31 30 20 20 20 20 20 52 4e 20 | 9.r10 RN | 000000c0 20 20 20 20 20 31 30 0a 72 31 31 20 20 20 20 20 | 10.r11 | 000000d0 52 4e 20 20 20 20 20 20 31 31 0a 72 31 32 20 20 |RN 11.r12 | 000000e0 20 20 20 52 4e 20 20 20 20 20 20 31 32 0a 72 31 | RN 12.r1| 000000f0 33 20 20 20 20 20 52 4e 20 20 20 20 20 20 31 33 |3 RN 13| 00000100 0a 72 31 34 20 20 20 20 20 52 4e 20 20 20 20 20 |.r14 RN | 00000110 20 31 34 0a 72 31 35 20 20 20 20 20 52 4e 20 20 | 14.r15 RN | 00000120 20 20 20 20 31 35 0a 73 70 20 20 20 20 20 20 52 | 15.sp R| 00000130 4e 20 20 20 20 20 20 72 31 33 0a 6c 72 20 20 20 |N r13.lr | 00000140 20 20 20 52 4e 20 20 20 20 20 20 72 31 34 0a 70 | RN r14.p| 00000150 63 20 20 20 20 20 20 52 4e 20 20 20 20 20 20 72 |c RN r| 00000160 31 35 0a 0a 58 4f 53 5f 4d 6f 64 75 6c 65 09 09 |15..XOS_Module..| 00000170 2a 09 26 32 30 30 31 65 0a 58 4f 53 5f 56 61 6c |*.&2001e.XOS_Val| 00000180 69 64 61 74 65 41 64 64 72 65 73 73 09 2a 09 26 |idateAddress.*.&| 00000190 32 30 30 33 61 0a 58 4f 53 5f 43 52 43 09 09 09 |2003a.XOS_CRC...| 000001a0 2a 09 26 32 30 30 35 62 0a 58 57 69 6d 70 5f 52 |*.&2005b.XWimp_R| 000001b0 65 70 6f 72 74 45 72 72 6f 72 09 2a 09 26 36 30 |eportError.*.&60| 000001c0 30 64 66 0a 0a 0a 0a 09 53 54 4d 46 44 09 73 70 |0df.....STMFD.sp| 000001d0 21 2c 20 7b 6c 72 7d 0a 09 4c 44 52 42 09 72 30 |!, {lr}..LDRB.r0| 000001e0 2c 20 5b 72 31 5d 09 09 3b 66 69 72 73 74 20 63 |, [r1]..;first c| 000001f0 68 61 72 20 6f 66 20 63 6f 6d 6d 61 6e 64 20 74 |har of command t| 00000200 61 69 6c 0a 09 43 4d 50 09 72 30 2c 20 23 27 56 |ail..CMP.r0, #'V| 00000210 27 0a 09 43 4d 50 4e 45 09 72 30 2c 20 23 27 76 |'..CMPNE.r0, #'v| 00000220 27 0a 09 4d 4f 56 45 51 09 72 30 2c 20 23 31 0a |'..MOVEQ.r0, #1.| 00000230 09 4d 4f 56 4e 45 09 72 30 2c 20 23 30 0a 09 53 |.MOVNE.r0, #0..S| 00000240 54 52 09 72 30 2c 20 76 65 72 62 6f 73 65 0a 09 |TR.r0, verbose..| 00000250 4d 4f 56 09 72 30 2c 20 23 31 38 0a 09 41 44 52 |MOV.r0, #18..ADR| 00000260 09 72 31 2c 20 6e 61 6d 65 0a 09 53 57 49 09 58 |.r1, name..SWI.X| 00000270 4f 53 5f 4d 6f 64 75 6c 65 0a 09 42 56 53 09 65 |OS_Module..BVS.e| 00000280 72 72 31 09 09 09 3b 65 6c 73 65 20 72 33 20 70 |rr1...;else r3 p| 00000290 74 73 20 74 6f 20 6d 6f 64 75 6c 65 0a 09 4c 44 |ts to module..LD| 000002a0 52 09 72 34 2c 20 5b 72 33 2c 20 23 2d 34 5d 09 |R.r4, [r3, #-4].| 000002b0 09 3b 62 6c 6f 63 6b 20 6c 65 6e 67 74 68 20 69 |.;block length i| 000002c0 6e 20 72 34 0a 09 4c 44 52 09 72 30 2c 20 6c 65 |n r4..LDR.r0, le| 000002d0 6e 67 74 68 0a 09 43 4d 50 09 72 34 2c 20 72 30 |ngth..CMP.r4, r0| 000002e0 0a 09 42 4c 54 09 65 72 72 34 09 09 09 3b 69 66 |..BLT.err4...;if| 000002f0 20 62 6c 6f 63 6b 20 6c 65 6e 67 74 68 20 6e 6f | block length no| 00000300 74 20 61 73 20 65 78 70 65 63 74 65 64 2c 20 72 |t as expected, r| 00000310 65 74 75 72 6e 0a 09 4c 44 52 09 72 31 2c 20 5b |eturn..LDR.r1, [| 00000320 72 33 2c 20 23 26 34 30 38 5d 0a 09 4c 44 52 09 |r3, #&408]..LDR.| 00000330 72 30 2c 20 6e 65 77 69 6e 73 0a 09 43 4d 50 09 |r0, newins..CMP.| 00000340 72 30 2c 20 72 31 0a 09 42 45 51 09 65 72 72 32 |r0, r1..BEQ.err2| 00000350 0a 09 4c 44 52 09 72 30 2c 20 6f 6c 64 69 6e 73 |..LDR.r0, oldins| 00000360 0a 09 43 4d 50 09 72 30 2c 20 72 31 0a 09 42 4e |..CMP.r0, r1..BN| 00000370 45 09 65 72 72 34 09 09 09 3b 69 66 20 69 6e 73 |E.err4...;if ins| 00000380 74 72 75 63 74 69 6f 6e 20 6e 6f 74 20 61 73 20 |truction not as | 00000390 65 78 70 65 63 74 65 64 2c 20 72 65 74 75 72 6e |expected, return| 000003a0 0a 09 4d 4f 56 09 72 30 2c 20 23 30 0a 09 4d 4f |..MOV.r0, #0..MO| 000003b0 56 09 72 31 2c 20 72 33 09 09 09 3b 72 31 20 70 |V.r1, r3...;r1 p| 000003c0 74 73 20 74 6f 20 6d 6f 64 75 6c 65 0a 09 4c 44 |ts to module..LD| 000003d0 52 09 72 32 2c 20 63 72 63 6f 0a 09 41 44 44 09 |R.r2, crco..ADD.| 000003e0 72 32 2c 20 72 33 2c 20 72 32 0a 09 4d 4f 56 09 |r2, r3, r2..MOV.| 000003f0 72 33 2c 20 23 31 0a 09 53 57 49 09 58 4f 53 5f |r3, #1..SWI.XOS_| 00000400 43 52 43 09 09 09 3b 63 72 63 20 69 6e 20 72 30 |CRC...;crc in r0| 00000410 2c 20 72 31 20 73 74 69 6c 6c 20 70 74 73 20 74 |, r1 still pts t| 00000420 6f 20 6d 6f 64 75 6c 65 0a 09 42 56 53 09 65 72 |o module..BVS.er| 00000430 72 33 0a 09 4c 44 52 09 72 32 2c 20 63 72 63 0a |r3..LDR.r2, crc.| 00000440 09 43 4d 50 09 72 30 2c 20 72 32 0a 09 42 4e 45 |.CMP.r0, r2..BNE| 00000450 09 65 72 72 34 09 09 09 3b 69 66 20 63 72 63 20 |.err4...;if crc | 00000460 6e 6f 74 20 61 73 20 65 78 70 65 63 74 65 64 2c |not as expected,| 00000470 20 72 65 74 75 72 6e 0a 09 4d 4f 56 09 72 30 2c | return..MOV.r0,| 00000480 20 72 31 09 09 09 3b 72 30 20 70 74 73 20 74 6f | r1...;r0 pts to| 00000490 20 6d 6f 64 75 6c 65 0a 09 53 55 42 09 72 34 2c | module..SUB.r4,| 000004a0 20 72 34 2c 20 23 34 09 09 3b 6d 6f 64 75 6c 65 | r4, #4..;module| 000004b0 20 6c 65 6e 67 74 68 20 69 6e 20 72 34 0a 09 41 | length in r4..A| 000004c0 44 44 09 72 31 2c 20 72 30 2c 20 72 34 0a 09 53 |DD.r1, r0, r4..S| 000004d0 57 49 09 58 4f 53 5f 56 61 6c 69 64 61 74 65 41 |WI.XOS_ValidateA| 000004e0 64 64 72 65 73 73 09 3b 69 66 20 43 20 73 65 74 |ddress.;if C set| 000004f0 20 74 68 65 6e 20 6e 6f 74 20 69 6e 20 6c 6f 67 | then not in log| 00000500 69 63 61 6c 20 52 41 4d 0a 09 42 56 53 09 65 72 |ical RAM..BVS.er| 00000510 72 33 09 09 09 3b 72 30 20 73 74 69 6c 6c 20 70 |r3...;r0 still p| 00000520 74 73 20 74 6f 20 6d 6f 64 75 6c 65 0a 09 4d 4f |ts to module..MO| 00000530 56 09 72 31 2c 20 72 30 09 09 09 3b 72 31 20 70 |V.r1, r0...;r1 p| 00000540 74 73 20 74 6f 20 6d 6f 64 75 6c 65 0a 09 4d 4f |ts to module..MO| 00000550 56 09 72 30 2c 20 23 31 31 0a 09 4d 4f 56 09 72 |V.r0, #11..MOV.r| 00000560 32 2c 20 72 34 0a 09 53 57 49 43 53 09 58 4f 53 |2, r4..SWICS.XOS| 00000570 5f 4d 6f 64 75 6c 65 09 09 3b 74 72 79 20 74 6f |_Module..;try to| 00000580 20 63 6f 70 79 20 74 6f 20 52 4d 41 20 69 66 20 | copy to RMA if | 00000590 6e 6f 74 20 69 6e 20 6c 6f 67 69 63 61 6c 20 52 |not in logical R| 000005a0 41 4d 0a 09 42 56 53 09 65 72 72 35 0a 09 4d 4f |AM..BVS.err5..MO| 000005b0 56 09 72 30 2c 20 23 31 38 0a 09 41 44 52 09 72 |V.r0, #18..ADR.r| 000005c0 31 2c 20 6e 61 6d 65 0a 09 53 57 49 09 58 4f 53 |1, name..SWI.XOS| 000005d0 5f 4d 6f 64 75 6c 65 0a 09 42 56 53 09 65 72 72 |_Module..BVS.err| 000005e0 31 09 09 09 3b 65 6c 73 65 20 72 33 20 70 74 73 |1...;else r3 pts| 000005f0 20 74 6f 20 6d 6f 64 75 6c 65 0a 09 4c 44 52 09 | to module..LDR.| 00000600 72 30 2c 20 6e 65 77 69 6e 73 0a 09 53 54 52 09 |r0, newins..STR.| 00000610 72 30 2c 20 5b 72 33 2c 20 23 26 34 30 38 5d 0a |r0, [r3, #&408].| 00000620 09 41 44 52 09 72 30 2c 20 72 65 74 30 09 09 3b |.ADR.r0, ret0..;| 00000630 70 61 74 63 68 20 70 65 72 66 6f 72 6d 65 64 0a |patch performed.| 00000640 09 42 09 72 65 74 6d 65 73 73 0a 65 72 72 31 09 |.B.retmess.err1.| 00000650 41 44 52 09 72 30 2c 20 72 65 74 31 09 09 3b 63 |ADR.r0, ret1..;c| 00000660 61 6e 27 74 20 66 69 6e 64 20 44 41 53 0a 09 42 |an't find DAS..B| 00000670 09 72 65 74 6d 65 73 73 0a 65 72 72 32 09 41 44 |.retmess.err2.AD| 00000680 52 09 72 30 2c 20 72 65 74 32 09 09 3b 61 6c 72 |R.r0, ret2..;alr| 00000690 65 61 64 79 20 70 61 74 63 68 65 64 0a 09 42 09 |eady patched..B.| 000006a0 72 65 74 6d 65 73 73 0a 65 72 72 33 09 41 44 52 |retmess.err3.ADR| 000006b0 09 72 30 2c 20 72 65 74 33 09 09 3b 75 6e 65 78 |.r0, ret3..;unex| 000006c0 70 65 63 74 65 64 20 73 77 69 20 65 72 72 6f 72 |pected swi error| 000006d0 0a 09 42 09 72 65 74 6d 65 73 73 0a 65 72 72 34 |..B.retmess.err4| 000006e0 09 41 44 52 09 72 30 2c 20 72 65 74 34 09 09 3b |.ADR.r0, ret4..;| 000006f0 64 6f 6e 27 74 20 72 65 63 6f 67 6e 69 73 65 20 |don't recognise | 00000700 44 41 53 20 61 73 20 76 20 30 2e 30 33 0a 09 42 |DAS as v 0.03..B| 00000710 09 72 65 74 6d 65 73 73 0a 65 72 72 35 09 41 44 |.retmess.err5.AD| 00000720 52 09 72 30 2c 20 72 65 74 35 09 09 3b 63 61 6e |R.r0, ret5..;can| 00000730 27 74 20 6d 6f 76 65 20 74 6f 20 52 4d 41 0a 09 |'t move to RMA..| 00000740 42 09 72 65 74 6d 65 73 73 0a 72 65 74 6d 65 73 |B.retmess.retmes| 00000750 73 09 4c 44 4d 46 44 09 73 70 21 2c 20 7b 6c 72 |s.LDMFD.sp!, {lr| 00000760 7d 0a 09 4c 44 52 09 72 31 2c 20 76 65 72 62 6f |}..LDR.r1, verbo| 00000770 73 65 0a 09 43 4d 50 09 72 31 2c 20 23 31 0a 09 |se..CMP.r1, #1..| 00000780 4d 4f 56 4e 45 53 09 70 63 2c 20 6c 72 0a 09 4d |MOVNES.pc, lr..M| 00000790 4f 56 09 72 31 2c 20 23 26 31 31 0a 09 41 44 52 |OV.r1, #&11..ADR| 000007a0 4c 09 72 32 2c 20 64 61 73 70 61 74 63 68 6e 61 |L.r2, daspatchna| 000007b0 6d 65 0a 09 53 57 49 09 58 57 69 6d 70 5f 52 65 |me..SWI.XWimp_Re| 000007c0 70 6f 72 74 45 72 72 6f 72 0a 09 4d 4f 56 53 09 |portError..MOVS.| 000007d0 70 63 2c 20 6c 72 0a 0a 6e 61 6d 65 09 44 43 42 |pc, lr..name.DCB| 000007e0 09 22 44 72 61 67 41 53 70 72 69 74 65 22 2c 20 |."DragASprite", | 000007f0 30 0a 72 65 74 30 09 44 43 44 09 30 0a 09 44 43 |0.ret0.DCD.0..DC| 00000800 42 09 22 44 72 61 67 41 53 70 72 69 74 65 20 69 |B."DragASprite i| 00000810 73 20 6e 6f 77 20 20 70 61 74 63 68 65 64 2e 22 |s now patched."| 00000820 2c 20 30 0a 72 65 74 31 09 44 43 44 09 30 0a 09 |, 0.ret1.DCD.0..| 00000830 44 43 42 09 22 55 6e 61 62 6c 65 20 74 6f 20 70 |DCB."Unable to p| 00000840 61 74 63 68 20 44 72 61 67 41 53 70 72 69 74 65 |atch DragASprite| 00000850 20 61 73 20 63 61 6e 27 74 20 66 69 6e 64 20 69 | as can't find i| 00000860 74 2e 22 2c 20 30 0a 72 65 74 32 09 44 43 44 09 |t.", 0.ret2.DCD.| 00000870 30 0a 09 44 43 42 09 22 44 72 61 67 41 53 70 72 |0..DCB."DragASpr| 00000880 69 74 65 20 69 73 20 61 6c 72 65 61 64 79 20 70 |ite is already p| 00000890 61 74 63 68 65 64 2e 22 2c 20 30 0a 72 65 74 33 |atched.", 0.ret3| 000008a0 09 44 43 44 09 30 0a 09 44 43 42 09 22 55 6e 61 |.DCD.0..DCB."Una| 000008b0 62 6c 65 20 74 6f 20 70 61 74 63 68 20 44 72 61 |ble to patch Dra| 000008c0 67 41 53 70 72 69 74 65 20 64 75 65 20 74 6f 20 |gASprite due to | 000008d0 61 6e 20 75 6e 65 78 70 65 63 74 65 64 20 53 57 |an unexpected SW| 000008e0 49 20 65 72 72 6f 72 2e 22 2c 20 30 0a 72 65 74 |I error.", 0.ret| 000008f0 34 09 44 43 44 09 30 0a 09 44 43 42 09 22 55 6e |4.DCD.0..DCB."Un| 00000900 61 62 6c 65 20 74 6f 20 70 61 74 63 68 20 44 72 |able to patch Dr| 00000910 61 67 41 53 70 72 69 74 65 20 61 73 20 64 6f 6e |agASprite as don| 00000920 27 74 20 72 65 63 6f 67 6e 69 73 65 20 69 74 20 |'t recognise it | 00000930 61 73 20 76 20 30 2e 30 33 2e 22 2c 20 30 0a 72 |as v 0.03.", 0.r| 00000940 65 74 35 09 44 43 44 09 30 0a 09 44 43 42 09 22 |et5.DCD.0..DCB."| 00000950 55 6e 61 62 6c 65 20 74 6f 20 70 61 74 63 68 20 |Unable to patch | 00000960 44 72 61 67 41 53 70 72 69 74 65 20 61 73 20 63 |DragASprite as c| 00000970 61 6e 27 74 20 6d 6f 76 65 20 69 74 20 69 6e 74 |an't move it int| 00000980 6f 20 74 68 65 20 52 4d 41 2e 22 2c 20 30 0a 64 |o the RMA.", 0.d| 00000990 61 73 70 61 74 63 68 6e 61 6d 65 0a 09 44 43 42 |aspatchname..DCB| 000009a0 09 22 44 41 53 70 61 74 63 68 22 2c 20 30 0a 09 |."DASpatch", 0..| 000009b0 41 4c 49 47 4e 0a 76 65 72 62 6f 73 65 09 44 43 |ALIGN.verbose.DC| 000009c0 44 09 30 0a 6c 65 6e 67 74 68 09 44 43 44 09 26 |D.0.length.DCD.&| 000009d0 65 38 63 0a 63 72 63 6f 09 44 43 44 09 26 65 38 |e8c.crco.DCD.&e8| 000009e0 30 0a 63 72 63 09 44 43 44 09 26 36 37 33 32 0a |0.crc.DCD.&6732.| 000009f0 6f 6c 64 69 6e 73 09 4c 44 52 09 72 32 2c 20 5b |oldins.LDR.r2, [| 00000a00 72 31 32 2c 20 23 32 34 5d 0a 6e 65 77 69 6e 73 |r12, #24].newins| 00000a10 09 4c 44 52 09 72 32 2c 20 5b 72 31 32 2c 20 23 |.LDR.r2, [r12, #| 00000a20 32 38 5d 0a 0a 0a 0a 09 45 4e 44 0a |28].....END.| 00000a2c