Home » Archimedes archive » Micro User » MU 1991-09.adf » PD-Stuff » FracTrace/FTS-Files/Recursion

FracTrace/FTS-Files/Recursion

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 » Micro User » MU 1991-09.adf » PD-Stuff
Filename: FracTrace/FTS-Files/Recursion
Read OK:
File size: 00E5 bytes
Load address: 0000
Exec address: 0000
File contents
\ Recursion
\ Demonstrates the use of (recursive) subroutines
\ in FracTrace
             
var count,max

count=1
max=20
call recurcount
show count
stop

.recurcount 
 count=count+1
 if count<max
  call recurcount
 endif
 return
00000000  5c 20 52 65 63 75 72 73  69 6f 6e 0a 5c 20 44 65  |\ Recursion.\ De|
00000010  6d 6f 6e 73 74 72 61 74  65 73 20 74 68 65 20 75  |monstrates the u|
00000020  73 65 20 6f 66 20 28 72  65 63 75 72 73 69 76 65  |se of (recursive|
00000030  29 20 73 75 62 72 6f 75  74 69 6e 65 73 0a 5c 20  |) subroutines.\ |
00000040  69 6e 20 46 72 61 63 54  72 61 63 65 0a 20 20 20  |in FracTrace.   |
00000050  20 20 20 20 20 20 20 20  20 20 0a 76 61 72 20 63  |          .var c|
00000060  6f 75 6e 74 2c 6d 61 78  0a 0a 63 6f 75 6e 74 3d  |ount,max..count=|
00000070  31 0a 6d 61 78 3d 32 30  0a 63 61 6c 6c 20 72 65  |1.max=20.call re|
00000080  63 75 72 63 6f 75 6e 74  0a 73 68 6f 77 20 63 6f  |curcount.show co|
00000090  75 6e 74 0a 73 74 6f 70  0a 0a 2e 72 65 63 75 72  |unt.stop...recur|
000000a0  63 6f 75 6e 74 20 0a 20  63 6f 75 6e 74 3d 63 6f  |count . count=co|
000000b0  75 6e 74 2b 31 0a 20 69  66 20 63 6f 75 6e 74 3c  |unt+1. if count<|
000000c0  6d 61 78 0a 20 20 63 61  6c 6c 20 72 65 63 75 72  |max.  call recur|
000000d0  63 6f 75 6e 74 0a 20 65  6e 64 69 66 0a 20 72 65  |count. endif. re|
000000e0  74 75 72 6e 0a                                    |turn.|
000000e5