Home » Archimedes archive » Acorn User » AU 1993-04.adf » !ArmCode/Files/Debug
!ArmCode/Files/Debug
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 User » AU 1993-04.adf |
Filename: | !ArmCode/Files/Debug |
Read OK: | ✔ |
File size: | 070F bytes |
Load address: | FFFFFB44 |
Exec address: | 696F8354 |
File contents
10REM >Debug 20REM By Dave Lawrence 30REM For 32-bit machines 40REM (c) BAU April 1993 50: 60DEF PROCassemble_debug 70PROCdebug_bases 80[OPT pass 90.debug 100STMFD R13!,{R0-R12} 110BIC R9,R14,#&F0000003 120.debugloop 130LDRB R0,[R9],#1 140CMP R0,#0 150BEQ debugdone 160CMP R0,#128 170SWILT "OS_WriteC" 180BLT debugloop 190AND R8,R0,#%01110000 200AND R0,R0,#%00001111 210LDR R0,[R13,R0,LSL #2] 220ADD PC,PC,R8,LSR #2 230DCD 0 240B type000 250B type001 260B type010 270B type011 280B type100 290B type101 300B type110 310B type111 320.debugdone 330MOV R14,R9 340TST R14,#%11 350BICNE R14,R14,#%11 360ADDNE R14,R14,#4 370LDMFD R13!,{R0-R12} 380MOVS PC,R14 390: 400.type011 410.type100 420.type101 430.type110 440.type111 450B debugloop 460: 470.type000 \ _decimal 480ADR R1,numbuf 490MOV R2,#16 500SWI "OS_ConvertCardinal4" 510SWI "OS_Write0" 520B debugloop 530: 540.type001 \ _hex 550ADR R1,numbuf 560MOV R2,#16 570SWI "OS_ConvertHex8" 580SWI "OS_Write0" 590B debugloop 600: 610.type010 \bin8 620ADR R1,numbuf 630MOV R2,#16 640SWI "OS_ConvertBinary1" 650SWI "OS_Write0" 660B debugloop 670: 680.numbuf 690EQUD 0:EQUD 0:EQUD 0:EQUD 0 700] 710ENDPROC 720 730DEF PROCdebug_bases 740_decimal = 128 OR (%000 << 4) 750_hex = 128 OR (%001 << 4) 760_binary = 128 OR (%010 << 4) 770ENDPROC 780: 790DEF FNdebug(str$) 800LOCAL _base,_a,_b,a$ 810PROCdebug_bases 820[OPT pass 830BL debug 840] 850WHILE INSTR(str$,"\")>0 860 _a=INSTR(str$,"\") 870 _b=INSTR(str$,"\",_a+1)-_a-1 880 a$=MID$(str$,_a+1,_b) 890 CASE a$ OF 900 WHEN "" :str$=LEFT$(str$,_a)+MID$(str$,_a+2) 910 WHEN "n","N" : str$=LEFT$(str$,_a-1)+CHR$13+CHR$10+MID$(str$,_a+3) 920 OTHERWISE: 930 CASE LEFT$(a$,1) OF 940 WHEN "&" : _base=_hex : a$=MID$(a$,2) 950 WHEN "%" : _base=_binary : a$=MID$(a$,2) 960 OTHERWISE : _base=_decimal 970 ENDCASE 980 str$=LEFT$(str$,_a-1)+CHR$(_base OR EVALa$)+MID$(str$,_a+_b+2) 990 ENDCASE 1000ENDWHILE 1010[OPT pass 1020 EQUS str$ 1030 EQUB 0 1040 ALIGN 1050] 1060=""
� >Debug � By Dave Lawrence � For 32-bit machines (� (c) BAU April 1993 2: <� �assemble_debug F�debug_bases P [OPT pass Z .debug dSTMFD R13!,{R0-R12} nBIC R9,R14,#&F0000003 x.debugloop �LDRB R0,[R9],#1 � CMP R0,#0 �BEQ debugdone �CMP R0,#128 �SWILT "OS_WriteC" �BLT debugloop �� R8,R0,#%01110000 �� R0,R0,#%00001111 �LDR R0,[R13,R0,LSL #2] �ADD PC,PC,R8,LSR #2 � DCD 0 � B type000 � B type001 B type010 B type011 B type100 " B type101 , B type110 6 B type111 @.debugdone JMOV R14,R9 TTST R14,#%11 ^BICNE R14,R14,#%11 hADDNE R14,R14,#4 rLDMFD R13!,{R0-R12} |MOVS PC,R14 �: �.type011 �.type100 �.type101 �.type110 �.type111 �B debugloop �: �.type000 \ _decimal �ADR R1,numbuf �MOV R2,#16 �SWI "OS_ConvertCardinal4" �SWI "OS_Write0" B debugloop : .type001 \ _hex &ADR R1,numbuf 0MOV R2,#16 :SWI "OS_ConvertHex8" DSWI "OS_Write0" NB debugloop X: b.type010 \bin8 lADR R1,numbuf vMOV R2,#16 �SWI "OS_ConvertBinary1" �SWI "OS_Write0" �B debugloop �: �.numbuf �EQUD 0:EQUD 0:EQUD 0:EQUD 0 �] �� � �� �debug_bases � _decimal = 128 � (%000 << 4) � _hex = 128 � (%001 << 4) � _binary = 128 � (%010 << 4) � : � �debug(str$) � _base,_a,_b,a$ *�debug_bases 4 [OPT pass >BL debug H] Rȕ �str$,"\")>0 \ _a=�str$,"\") f _b=�str$,"\",_a+1)-_a-1 p a$=�str$,_a+1,_b) z Ȏ a$ � �& � "" :str$=�str$,_a)+�str$,_a+2) �6 � "n","N" : str$=�str$,_a-1)+�13+�10+�str$,_a+3) � : � Ȏ �a$,1) � �* � "&" : _base=_hex : a$=�a$,2) �* � "%" : _base=_binary : a$=�a$,2) � : _base=_decimal � � �5 str$=�str$,_a-1)+�(_base � �a$)+�str$,_a+_b+2) � � �� � [OPT pass � EQUS str$ EQUB 0 ALIGN ] $="" �
00000000 0d 00 0a 10 f4 20 20 20 20 20 3e 44 65 62 75 67 |..... >Debug| 00000010 0d 00 14 17 f4 20 42 79 20 20 44 61 76 65 20 4c |..... By Dave L| 00000020 61 77 72 65 6e 63 65 0d 00 1e 19 f4 20 46 6f 72 |awrence..... For| 00000030 20 33 32 2d 62 69 74 20 6d 61 63 68 69 6e 65 73 | 32-bit machines| 00000040 0d 00 28 18 f4 20 28 63 29 20 42 41 55 20 41 70 |..(.. (c) BAU Ap| 00000050 72 69 6c 20 31 39 39 33 0d 00 32 05 3a 0d 00 3c |ril 1993..2.:..<| 00000060 15 dd 20 f2 61 73 73 65 6d 62 6c 65 5f 64 65 62 |.. .assemble_deb| 00000070 75 67 0d 00 46 10 f2 64 65 62 75 67 5f 62 61 73 |ug..F..debug_bas| 00000080 65 73 0d 00 50 0d 5b 4f 50 54 20 70 61 73 73 0d |es..P.[OPT pass.| 00000090 00 5a 0a 2e 64 65 62 75 67 0d 00 64 17 53 54 4d |.Z..debug..d.STM| 000000a0 46 44 20 52 31 33 21 2c 7b 52 30 2d 52 31 32 7d |FD R13!,{R0-R12}| 000000b0 0d 00 6e 19 42 49 43 20 52 39 2c 52 31 34 2c 23 |..n.BIC R9,R14,#| 000000c0 26 46 30 30 30 30 30 30 33 0d 00 78 0e 2e 64 65 |&F0000003..x..de| 000000d0 62 75 67 6c 6f 6f 70 0d 00 82 13 4c 44 52 42 20 |bugloop....LDRB | 000000e0 52 30 2c 5b 52 39 5d 2c 23 31 0d 00 8c 0d 43 4d |R0,[R9],#1....CM| 000000f0 50 20 52 30 2c 23 30 0d 00 96 11 42 45 51 20 64 |P R0,#0....BEQ d| 00000100 65 62 75 67 64 6f 6e 65 0d 00 a0 0f 43 4d 50 20 |ebugdone....CMP | 00000110 52 30 2c 23 31 32 38 0d 00 aa 15 53 57 49 4c 54 |R0,#128....SWILT| 00000120 20 22 4f 53 5f 57 72 69 74 65 43 22 0d 00 b4 11 | "OS_WriteC"....| 00000130 42 4c 54 20 64 65 62 75 67 6c 6f 6f 70 0d 00 be |BLT debugloop...| 00000140 16 80 20 52 38 2c 52 30 2c 23 25 30 31 31 31 30 |.. R8,R0,#%01110| 00000150 30 30 30 0d 00 c8 16 80 20 52 30 2c 52 30 2c 23 |000..... R0,R0,#| 00000160 25 30 30 30 30 31 31 31 31 0d 00 d2 1a 4c 44 52 |%00001111....LDR| 00000170 20 52 30 2c 5b 52 31 33 2c 52 30 2c 4c 53 4c 20 | R0,[R13,R0,LSL | 00000180 23 32 5d 0d 00 dc 17 41 44 44 20 50 43 2c 50 43 |#2]....ADD PC,PC| 00000190 2c 52 38 2c 4c 53 52 20 23 32 0d 00 e6 09 44 43 |,R8,LSR #2....DC| 000001a0 44 20 30 0d 00 f0 0d 42 20 74 79 70 65 30 30 30 |D 0....B type000| 000001b0 0d 00 fa 0d 42 20 74 79 70 65 30 30 31 0d 01 04 |....B type001...| 000001c0 0d 42 20 74 79 70 65 30 31 30 0d 01 0e 0d 42 20 |.B type010....B | 000001d0 74 79 70 65 30 31 31 0d 01 18 0d 42 20 74 79 70 |type011....B typ| 000001e0 65 31 30 30 0d 01 22 0d 42 20 74 79 70 65 31 30 |e100..".B type10| 000001f0 31 0d 01 2c 0d 42 20 74 79 70 65 31 31 30 0d 01 |1..,.B type110..| 00000200 36 0d 42 20 74 79 70 65 31 31 31 0d 01 40 0e 2e |6.B type111..@..| 00000210 64 65 62 75 67 64 6f 6e 65 0d 01 4a 0e 4d 4f 56 |debugdone..J.MOV| 00000220 20 52 31 34 2c 52 39 0d 01 54 10 54 53 54 20 52 | R14,R9..T.TST R| 00000230 31 34 2c 23 25 31 31 0d 01 5e 16 42 49 43 4e 45 |14,#%11..^.BICNE| 00000240 20 52 31 34 2c 52 31 34 2c 23 25 31 31 0d 01 68 | R14,R14,#%11..h| 00000250 14 41 44 44 4e 45 20 52 31 34 2c 52 31 34 2c 23 |.ADDNE R14,R14,#| 00000260 34 0d 01 72 17 4c 44 4d 46 44 20 52 31 33 21 2c |4..r.LDMFD R13!,| 00000270 7b 52 30 2d 52 31 32 7d 0d 01 7c 0f 4d 4f 56 53 |{R0-R12}..|.MOVS| 00000280 20 50 43 2c 52 31 34 0d 01 86 05 3a 0d 01 90 0c | PC,R14....:....| 00000290 2e 74 79 70 65 30 31 31 0d 01 9a 0c 2e 74 79 70 |.type011.....typ| 000002a0 65 31 30 30 0d 01 a4 0c 2e 74 79 70 65 31 30 31 |e100.....type101| 000002b0 0d 01 ae 0c 2e 74 79 70 65 31 31 30 0d 01 b8 0c |.....type110....| 000002c0 2e 74 79 70 65 31 31 31 0d 01 c2 0f 42 20 64 65 |.type111....B de| 000002d0 62 75 67 6c 6f 6f 70 0d 01 cc 05 3a 0d 01 d6 17 |bugloop....:....| 000002e0 2e 74 79 70 65 30 30 30 20 5c 20 5f 64 65 63 69 |.type000 \ _deci| 000002f0 6d 61 6c 0d 01 e0 11 41 44 52 20 52 31 2c 6e 75 |mal....ADR R1,nu| 00000300 6d 62 75 66 0d 01 ea 0e 4d 4f 56 20 52 32 2c 23 |mbuf....MOV R2,#| 00000310 31 36 0d 01 f4 1d 53 57 49 20 22 4f 53 5f 43 6f |16....SWI "OS_Co| 00000320 6e 76 65 72 74 43 61 72 64 69 6e 61 6c 34 22 0d |nvertCardinal4".| 00000330 01 fe 13 53 57 49 20 22 4f 53 5f 57 72 69 74 65 |...SWI "OS_Write| 00000340 30 22 0d 02 08 0f 42 20 64 65 62 75 67 6c 6f 6f |0"....B debugloo| 00000350 70 0d 02 12 05 3a 0d 02 1c 13 2e 74 79 70 65 30 |p....:.....type0| 00000360 30 31 20 5c 20 5f 68 65 78 0d 02 26 11 41 44 52 |01 \ _hex..&.ADR| 00000370 20 52 31 2c 6e 75 6d 62 75 66 0d 02 30 0e 4d 4f | R1,numbuf..0.MO| 00000380 56 20 52 32 2c 23 31 36 0d 02 3a 18 53 57 49 20 |V R2,#16..:.SWI | 00000390 22 4f 53 5f 43 6f 6e 76 65 72 74 48 65 78 38 22 |"OS_ConvertHex8"| 000003a0 0d 02 44 13 53 57 49 20 22 4f 53 5f 57 72 69 74 |..D.SWI "OS_Writ| 000003b0 65 30 22 0d 02 4e 0f 42 20 64 65 62 75 67 6c 6f |e0"..N.B debuglo| 000003c0 6f 70 0d 02 58 05 3a 0d 02 62 12 2e 74 79 70 65 |op..X.:..b..type| 000003d0 30 31 30 20 5c 62 69 6e 38 0d 02 6c 11 41 44 52 |010 \bin8..l.ADR| 000003e0 20 52 31 2c 6e 75 6d 62 75 66 0d 02 76 0e 4d 4f | R1,numbuf..v.MO| 000003f0 56 20 52 32 2c 23 31 36 0d 02 80 1b 53 57 49 20 |V R2,#16....SWI | 00000400 22 4f 53 5f 43 6f 6e 76 65 72 74 42 69 6e 61 72 |"OS_ConvertBinar| 00000410 79 31 22 0d 02 8a 13 53 57 49 20 22 4f 53 5f 57 |y1"....SWI "OS_W| 00000420 72 69 74 65 30 22 0d 02 94 0f 42 20 64 65 62 75 |rite0"....B debu| 00000430 67 6c 6f 6f 70 0d 02 9e 05 3a 0d 02 a8 0b 2e 6e |gloop....:.....n| 00000440 75 6d 62 75 66 0d 02 b2 1f 45 51 55 44 20 30 3a |umbuf....EQUD 0:| 00000450 45 51 55 44 20 30 3a 45 51 55 44 20 30 3a 45 51 |EQUD 0:EQUD 0:EQ| 00000460 55 44 20 30 0d 02 bc 05 5d 0d 02 c6 05 e1 0d 02 |UD 0....].......| 00000470 d0 04 0d 02 da 12 dd 20 f2 64 65 62 75 67 5f 62 |....... .debug_b| 00000480 61 73 65 73 0d 02 e4 20 5f 64 65 63 69 6d 61 6c |ases... _decimal| 00000490 20 3d 20 31 32 38 20 84 20 28 25 30 30 30 20 3c | = 128 . (%000 <| 000004a0 3c 20 34 29 0d 02 ee 20 5f 68 65 78 20 20 20 20 |< 4)... _hex | 000004b0 20 3d 20 31 32 38 20 84 20 28 25 30 30 31 20 3c | = 128 . (%001 <| 000004c0 3c 20 34 29 0d 02 f8 20 5f 62 69 6e 61 72 79 20 |< 4)... _binary | 000004d0 20 3d 20 31 32 38 20 84 20 28 25 30 31 30 20 3c | = 128 . (%010 <| 000004e0 3c 20 34 29 0d 03 02 05 e1 0d 03 0c 05 3a 0d 03 |< 4).........:..| 000004f0 16 12 dd 20 a4 64 65 62 75 67 28 73 74 72 24 29 |... .debug(str$)| 00000500 0d 03 20 14 ea 20 5f 62 61 73 65 2c 5f 61 2c 5f |.. .. _base,_a,_| 00000510 62 2c 61 24 0d 03 2a 10 f2 64 65 62 75 67 5f 62 |b,a$..*..debug_b| 00000520 61 73 65 73 0d 03 34 0d 5b 4f 50 54 20 70 61 73 |ases..4.[OPT pas| 00000530 73 0d 03 3e 0c 42 4c 20 64 65 62 75 67 0d 03 48 |s..>.BL debug..H| 00000540 05 5d 0d 03 52 13 c8 95 20 a7 73 74 72 24 2c 22 |.]..R... .str$,"| 00000550 5c 22 29 3e 30 0d 03 5c 12 20 5f 61 3d a7 73 74 |\")>0..\. _a=.st| 00000560 72 24 2c 22 5c 22 29 0d 03 66 1c 20 5f 62 3d a7 |r$,"\")..f. _b=.| 00000570 73 74 72 24 2c 22 5c 22 2c 5f 61 2b 31 29 2d 5f |str$,"\",_a+1)-_| 00000580 61 2d 31 0d 03 70 16 20 61 24 3d c1 73 74 72 24 |a-1..p. a$=.str$| 00000590 2c 5f 61 2b 31 2c 5f 62 29 0d 03 7a 0c 20 c8 8e |,_a+1,_b)..z. ..| 000005a0 20 61 24 20 ca 0d 03 84 26 20 20 c9 20 22 22 20 | a$ ....& . "" | 000005b0 3a 73 74 72 24 3d c0 73 74 72 24 2c 5f 61 29 2b |:str$=.str$,_a)+| 000005c0 c1 73 74 72 24 2c 5f 61 2b 32 29 0d 03 8e 36 20 |.str$,_a+2)...6 | 000005d0 20 c9 20 22 6e 22 2c 22 4e 22 20 3a 20 73 74 72 | . "n","N" : str| 000005e0 24 3d c0 73 74 72 24 2c 5f 61 2d 31 29 2b bd 31 |$=.str$,_a-1)+.1| 000005f0 33 2b bd 31 30 2b c1 73 74 72 24 2c 5f 61 2b 33 |3+.10+.str$,_a+3| 00000600 29 0d 03 98 08 20 20 7f 3a 0d 03 a2 12 20 20 20 |).... .:.... | 00000610 c8 8e 20 c0 61 24 2c 31 29 20 ca 0d 03 ac 2a 20 |.. .a$,1) ....* | 00000620 20 20 20 c9 20 22 26 22 20 20 3a 20 5f 62 61 73 | . "&" : _bas| 00000630 65 3d 5f 68 65 78 20 20 20 20 3a 20 61 24 3d c1 |e=_hex : a$=.| 00000640 61 24 2c 32 29 0d 03 b6 2a 20 20 20 20 c9 20 22 |a$,2)...* . "| 00000650 25 22 20 20 3a 20 5f 62 61 73 65 3d 5f 62 69 6e |%" : _base=_bin| 00000660 61 72 79 20 3a 20 61 24 3d c1 61 24 2c 32 29 0d |ary : a$=.a$,2).| 00000670 03 c0 1a 20 20 20 20 7f 20 3a 20 5f 62 61 73 65 |... . : _base| 00000680 3d 5f 64 65 63 69 6d 61 6c 0d 03 ca 08 20 20 20 |=_decimal.... | 00000690 cb 0d 03 d4 35 20 20 20 73 74 72 24 3d c0 73 74 |....5 str$=.st| 000006a0 72 24 2c 5f 61 2d 31 29 2b bd 28 5f 62 61 73 65 |r$,_a-1)+.(_base| 000006b0 20 84 20 a0 61 24 29 2b c1 73 74 72 24 2c 5f 61 | . .a$)+.str$,_a| 000006c0 2b 5f 62 2b 32 29 0d 03 de 06 20 cb 0d 03 e8 05 |+_b+2).... .....| 000006d0 ce 0d 03 f2 0d 5b 4f 50 54 20 70 61 73 73 0d 03 |.....[OPT pass..| 000006e0 fc 0e 20 45 51 55 53 20 73 74 72 24 0d 04 06 0b |.. EQUS str$....| 000006f0 20 45 51 55 42 20 30 0d 04 10 0a 20 41 4c 49 47 | EQUB 0.... ALIG| 00000700 4e 0d 04 1a 05 5d 0d 04 24 07 3d 22 22 0d ff |N....]..$.=""..| 0000070f