Home » Archimedes archive » Zipped Apps » BCPL » BCPL/alib/BcplMacsB

BCPL/alib/BcplMacsB

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 » Zipped Apps » BCPL
Filename: BCPL/alib/BcplMacsB
Read OK:
File size: 07B7 bytes
Load address: 0000
Exec address: 0000
File contents
pc		RN	15
r14		RN	14
rb		RN	8
rl		RN	12
rts		RN	11
rp		RN	10
rg		RN	9
rgb		RN	7
w1		RN	4
w2		RN	5
nil		RN	13
nilbase 	RN	6
r0		RN	0
a1		RN	4
a2		RN	3
a3		RN	2
a4		RN	1

; SWI calls
KWrch		*	0
KWrite0 	*	2
KNewline	*	3
KRdch		*	4
KCLI		*	5
KByte		*	6
KWord		*	7
KFile		*	8
KArgs		*	9
KBget		*	&a
KBput		*	&b
Kgbpb		*	&c
KFind		*	&d
KControl	*	&f
KReadEnv	*	&10
KExit		*	&11
KSetEnv 	*	&12
KCallBack	*	&15

PSRBits 	*	&fc000000
OverflowBit	*	&10000000

; 3rd argument (what to do) for SetEventHandler
ev_ignore	*	0
ev_set_flag	*	1
ev_call_proc	*	2
ev_buffer	*	3

	GBLA	xxrelocs
	GBLA	xxglobs
	GBLA	xxtopglobal
	GBLA	tempa
	GBLS	temps
xxrelocs SETA	0
xxglobs SETA	0
UserGlobals * 150

xxtopglobal SETA  UserGlobals

	MACRO
	Module $name,$date
Start
	=	"BCPL"
	&	globinits-Start
	=	("$name":CC:"        "):LEFT:8
 [ "$date"=""
	=	"<unset> <unset>",0,0,0,0,0
  |
	=	"$date",0,0
 ]
	&	0
	MEND

	MACRO
$name	GlobNo $no
G_$name *	($no)*4
 [ $no>xxtopglobal
xxtopglobal SETA $no
 ]
	MEND

	MACRO
	GlobDef $no,$name
	&	-1
	=	7,("$name":CC:"       "):LEFT:7
G_$name *	($no)*4
 [ $no>xxtopglobal
xxtopglobal SETA $no
 ]
temps	SETS	"xxgname":CC:"$xxglobs"
	GBLS	$temps
$temps	SETS	"$name"
xxglobs SETA	xxglobs+1
$name
	MEND

	MACRO
	GlobInits
globinits
tempa	SETA	0
     WHILE tempa<xxglobs
temps	SETS	"xxgname":CC:"$tempa"
temps	SETS	$temps
	GlobInit $temps
tempa	SETA	tempa+1
     WEND
	MEND

	MACRO
$lab	Address $value
 [ "$lab"<>""
$lab
 ]
temps	SETS	"rx":CC:"$xxrelocs"
$temps
	&	$value-Start
xxrelocs SETA	xxrelocs+1
	MEND

	MACRO
	GlobInit $name
	&	G_$name/4
temps	SETS	"rx":CC:"$xxrelocs"
$temps
	&	$name-Start
xxrelocs SETA	xxrelocs+1
	MEND

	MACRO
	EndModule
globinits
tempa	SETA	0
     WHILE tempa<xxglobs
temps	SETS	"xxgname":CC:"$tempa"
temps	SETS	$temps
	GlobInit $temps
tempa	SETA	tempa+1
     WEND
	&	&$xxtopglobal
	&	0

	&	&12345678
tempa	SETA	0
     WHILE tempa<>xxrelocs
temps	SETS	"rx":CC:"$tempa"
tempa	SETA	tempa+1
	&	$temps-Start
     WEND
	&	&87654321
	MEND

	END
00000000  70 63 09 09 52 4e 09 31  35 0a 72 31 34 09 09 52  |pc..RN.15.r14..R|
00000010  4e 09 31 34 0a 72 62 09  09 52 4e 09 38 0a 72 6c  |N.14.rb..RN.8.rl|
00000020  09 09 52 4e 09 31 32 0a  72 74 73 09 09 52 4e 09  |..RN.12.rts..RN.|
00000030  31 31 0a 72 70 09 09 52  4e 09 31 30 0a 72 67 09  |11.rp..RN.10.rg.|
00000040  09 52 4e 09 39 0a 72 67  62 09 09 52 4e 09 37 0a  |.RN.9.rgb..RN.7.|
00000050  77 31 09 09 52 4e 09 34  0a 77 32 09 09 52 4e 09  |w1..RN.4.w2..RN.|
00000060  35 0a 6e 69 6c 09 09 52  4e 09 31 33 0a 6e 69 6c  |5.nil..RN.13.nil|
00000070  62 61 73 65 20 09 52 4e  09 36 0a 72 30 09 09 52  |base .RN.6.r0..R|
00000080  4e 09 30 0a 61 31 09 09  52 4e 09 34 0a 61 32 09  |N.0.a1..RN.4.a2.|
00000090  09 52 4e 09 33 0a 61 33  09 09 52 4e 09 32 0a 61  |.RN.3.a3..RN.2.a|
000000a0  34 09 09 52 4e 09 31 0a  0a 3b 20 53 57 49 20 63  |4..RN.1..; SWI c|
000000b0  61 6c 6c 73 0a 4b 57 72  63 68 09 09 2a 09 30 0a  |alls.KWrch..*.0.|
000000c0  4b 57 72 69 74 65 30 20  09 2a 09 32 0a 4b 4e 65  |KWrite0 .*.2.KNe|
000000d0  77 6c 69 6e 65 09 2a 09  33 0a 4b 52 64 63 68 09  |wline.*.3.KRdch.|
000000e0  09 2a 09 34 0a 4b 43 4c  49 09 09 2a 09 35 0a 4b  |.*.4.KCLI..*.5.K|
000000f0  42 79 74 65 09 09 2a 09  36 0a 4b 57 6f 72 64 09  |Byte..*.6.KWord.|
00000100  09 2a 09 37 0a 4b 46 69  6c 65 09 09 2a 09 38 0a  |.*.7.KFile..*.8.|
00000110  4b 41 72 67 73 09 09 2a  09 39 0a 4b 42 67 65 74  |KArgs..*.9.KBget|
00000120  09 09 2a 09 26 61 0a 4b  42 70 75 74 09 09 2a 09  |..*.&a.KBput..*.|
00000130  26 62 0a 4b 67 62 70 62  09 09 2a 09 26 63 0a 4b  |&b.Kgbpb..*.&c.K|
00000140  46 69 6e 64 09 09 2a 09  26 64 0a 4b 43 6f 6e 74  |Find..*.&d.KCont|
00000150  72 6f 6c 09 2a 09 26 66  0a 4b 52 65 61 64 45 6e  |rol.*.&f.KReadEn|
00000160  76 09 2a 09 26 31 30 0a  4b 45 78 69 74 09 09 2a  |v.*.&10.KExit..*|
00000170  09 26 31 31 0a 4b 53 65  74 45 6e 76 20 09 2a 09  |.&11.KSetEnv .*.|
00000180  26 31 32 0a 4b 43 61 6c  6c 42 61 63 6b 09 2a 09  |&12.KCallBack.*.|
00000190  26 31 35 0a 0a 50 53 52  42 69 74 73 20 09 2a 09  |&15..PSRBits .*.|
000001a0  26 66 63 30 30 30 30 30  30 0a 4f 76 65 72 66 6c  |&fc000000.Overfl|
000001b0  6f 77 42 69 74 09 2a 09  26 31 30 30 30 30 30 30  |owBit.*.&1000000|
000001c0  30 0a 0a 3b 20 33 72 64  20 61 72 67 75 6d 65 6e  |0..; 3rd argumen|
000001d0  74 20 28 77 68 61 74 20  74 6f 20 64 6f 29 20 66  |t (what to do) f|
000001e0  6f 72 20 53 65 74 45 76  65 6e 74 48 61 6e 64 6c  |or SetEventHandl|
000001f0  65 72 0a 65 76 5f 69 67  6e 6f 72 65 09 2a 09 30  |er.ev_ignore.*.0|
00000200  0a 65 76 5f 73 65 74 5f  66 6c 61 67 09 2a 09 31  |.ev_set_flag.*.1|
00000210  0a 65 76 5f 63 61 6c 6c  5f 70 72 6f 63 09 2a 09  |.ev_call_proc.*.|
00000220  32 0a 65 76 5f 62 75 66  66 65 72 09 2a 09 33 0a  |2.ev_buffer.*.3.|
00000230  0a 09 47 42 4c 41 09 78  78 72 65 6c 6f 63 73 0a  |..GBLA.xxrelocs.|
00000240  09 47 42 4c 41 09 78 78  67 6c 6f 62 73 0a 09 47  |.GBLA.xxglobs..G|
00000250  42 4c 41 09 78 78 74 6f  70 67 6c 6f 62 61 6c 0a  |BLA.xxtopglobal.|
00000260  09 47 42 4c 41 09 74 65  6d 70 61 0a 09 47 42 4c  |.GBLA.tempa..GBL|
00000270  53 09 74 65 6d 70 73 0a  78 78 72 65 6c 6f 63 73  |S.temps.xxrelocs|
00000280  20 53 45 54 41 09 30 0a  78 78 67 6c 6f 62 73 20  | SETA.0.xxglobs |
00000290  53 45 54 41 09 30 0a 55  73 65 72 47 6c 6f 62 61  |SETA.0.UserGloba|
000002a0  6c 73 20 2a 20 31 35 30  0a 0a 78 78 74 6f 70 67  |ls * 150..xxtopg|
000002b0  6c 6f 62 61 6c 20 53 45  54 41 20 20 55 73 65 72  |lobal SETA  User|
000002c0  47 6c 6f 62 61 6c 73 0a  0a 09 4d 41 43 52 4f 0a  |Globals...MACRO.|
000002d0  09 4d 6f 64 75 6c 65 20  24 6e 61 6d 65 2c 24 64  |.Module $name,$d|
000002e0  61 74 65 0a 53 74 61 72  74 0a 09 3d 09 22 42 43  |ate.Start..=."BC|
000002f0  50 4c 22 0a 09 26 09 67  6c 6f 62 69 6e 69 74 73  |PL"..&.globinits|
00000300  2d 53 74 61 72 74 0a 09  3d 09 28 22 24 6e 61 6d  |-Start..=.("$nam|
00000310  65 22 3a 43 43 3a 22 20  20 20 20 20 20 20 20 22  |e":CC:"        "|
00000320  29 3a 4c 45 46 54 3a 38  0a 20 5b 20 22 24 64 61  |):LEFT:8. [ "$da|
00000330  74 65 22 3d 22 22 0a 09  3d 09 22 3c 75 6e 73 65  |te"=""..=."<unse|
00000340  74 3e 20 3c 75 6e 73 65  74 3e 22 2c 30 2c 30 2c  |t> <unset>",0,0,|
00000350  30 2c 30 2c 30 0a 20 20  7c 0a 09 3d 09 22 24 64  |0,0,0.  |..=."$d|
00000360  61 74 65 22 2c 30 2c 30  0a 20 5d 0a 09 26 09 30  |ate",0,0. ]..&.0|
00000370  0a 09 4d 45 4e 44 0a 0a  09 4d 41 43 52 4f 0a 24  |..MEND...MACRO.$|
00000380  6e 61 6d 65 09 47 6c 6f  62 4e 6f 20 24 6e 6f 0a  |name.GlobNo $no.|
00000390  47 5f 24 6e 61 6d 65 20  2a 09 28 24 6e 6f 29 2a  |G_$name *.($no)*|
000003a0  34 0a 20 5b 20 24 6e 6f  3e 78 78 74 6f 70 67 6c  |4. [ $no>xxtopgl|
000003b0  6f 62 61 6c 0a 78 78 74  6f 70 67 6c 6f 62 61 6c  |obal.xxtopglobal|
000003c0  20 53 45 54 41 20 24 6e  6f 0a 20 5d 0a 09 4d 45  | SETA $no. ]..ME|
000003d0  4e 44 0a 0a 09 4d 41 43  52 4f 0a 09 47 6c 6f 62  |ND...MACRO..Glob|
000003e0  44 65 66 20 24 6e 6f 2c  24 6e 61 6d 65 0a 09 26  |Def $no,$name..&|
000003f0  09 2d 31 0a 09 3d 09 37  2c 28 22 24 6e 61 6d 65  |.-1..=.7,("$name|
00000400  22 3a 43 43 3a 22 20 20  20 20 20 20 20 22 29 3a  |":CC:"       "):|
00000410  4c 45 46 54 3a 37 0a 47  5f 24 6e 61 6d 65 20 2a  |LEFT:7.G_$name *|
00000420  09 28 24 6e 6f 29 2a 34  0a 20 5b 20 24 6e 6f 3e  |.($no)*4. [ $no>|
00000430  78 78 74 6f 70 67 6c 6f  62 61 6c 0a 78 78 74 6f  |xxtopglobal.xxto|
00000440  70 67 6c 6f 62 61 6c 20  53 45 54 41 20 24 6e 6f  |pglobal SETA $no|
00000450  0a 20 5d 0a 74 65 6d 70  73 09 53 45 54 53 09 22  |. ].temps.SETS."|
00000460  78 78 67 6e 61 6d 65 22  3a 43 43 3a 22 24 78 78  |xxgname":CC:"$xx|
00000470  67 6c 6f 62 73 22 0a 09  47 42 4c 53 09 24 74 65  |globs"..GBLS.$te|
00000480  6d 70 73 0a 24 74 65 6d  70 73 09 53 45 54 53 09  |mps.$temps.SETS.|
00000490  22 24 6e 61 6d 65 22 0a  78 78 67 6c 6f 62 73 20  |"$name".xxglobs |
000004a0  53 45 54 41 09 78 78 67  6c 6f 62 73 2b 31 0a 24  |SETA.xxglobs+1.$|
000004b0  6e 61 6d 65 0a 09 4d 45  4e 44 0a 0a 09 4d 41 43  |name..MEND...MAC|
000004c0  52 4f 0a 09 47 6c 6f 62  49 6e 69 74 73 0a 67 6c  |RO..GlobInits.gl|
000004d0  6f 62 69 6e 69 74 73 0a  74 65 6d 70 61 09 53 45  |obinits.tempa.SE|
000004e0  54 41 09 30 0a 20 20 20  20 20 57 48 49 4c 45 20  |TA.0.     WHILE |
000004f0  74 65 6d 70 61 3c 78 78  67 6c 6f 62 73 0a 74 65  |tempa<xxglobs.te|
00000500  6d 70 73 09 53 45 54 53  09 22 78 78 67 6e 61 6d  |mps.SETS."xxgnam|
00000510  65 22 3a 43 43 3a 22 24  74 65 6d 70 61 22 0a 74  |e":CC:"$tempa".t|
00000520  65 6d 70 73 09 53 45 54  53 09 24 74 65 6d 70 73  |emps.SETS.$temps|
00000530  0a 09 47 6c 6f 62 49 6e  69 74 20 24 74 65 6d 70  |..GlobInit $temp|
00000540  73 0a 74 65 6d 70 61 09  53 45 54 41 09 74 65 6d  |s.tempa.SETA.tem|
00000550  70 61 2b 31 0a 20 20 20  20 20 57 45 4e 44 0a 09  |pa+1.     WEND..|
00000560  4d 45 4e 44 0a 0a 09 4d  41 43 52 4f 0a 24 6c 61  |MEND...MACRO.$la|
00000570  62 09 41 64 64 72 65 73  73 20 24 76 61 6c 75 65  |b.Address $value|
00000580  0a 20 5b 20 22 24 6c 61  62 22 3c 3e 22 22 0a 24  |. [ "$lab"<>"".$|
00000590  6c 61 62 0a 20 5d 0a 74  65 6d 70 73 09 53 45 54  |lab. ].temps.SET|
000005a0  53 09 22 72 78 22 3a 43  43 3a 22 24 78 78 72 65  |S."rx":CC:"$xxre|
000005b0  6c 6f 63 73 22 0a 24 74  65 6d 70 73 0a 09 26 09  |locs".$temps..&.|
000005c0  24 76 61 6c 75 65 2d 53  74 61 72 74 0a 78 78 72  |$value-Start.xxr|
000005d0  65 6c 6f 63 73 20 53 45  54 41 09 78 78 72 65 6c  |elocs SETA.xxrel|
000005e0  6f 63 73 2b 31 0a 09 4d  45 4e 44 0a 0a 09 4d 41  |ocs+1..MEND...MA|
000005f0  43 52 4f 0a 09 47 6c 6f  62 49 6e 69 74 20 24 6e  |CRO..GlobInit $n|
00000600  61 6d 65 0a 09 26 09 47  5f 24 6e 61 6d 65 2f 34  |ame..&.G_$name/4|
00000610  0a 74 65 6d 70 73 09 53  45 54 53 09 22 72 78 22  |.temps.SETS."rx"|
00000620  3a 43 43 3a 22 24 78 78  72 65 6c 6f 63 73 22 0a  |:CC:"$xxrelocs".|
00000630  24 74 65 6d 70 73 0a 09  26 09 24 6e 61 6d 65 2d  |$temps..&.$name-|
00000640  53 74 61 72 74 0a 78 78  72 65 6c 6f 63 73 20 53  |Start.xxrelocs S|
00000650  45 54 41 09 78 78 72 65  6c 6f 63 73 2b 31 0a 09  |ETA.xxrelocs+1..|
00000660  4d 45 4e 44 0a 0a 09 4d  41 43 52 4f 0a 09 45 6e  |MEND...MACRO..En|
00000670  64 4d 6f 64 75 6c 65 0a  67 6c 6f 62 69 6e 69 74  |dModule.globinit|
00000680  73 0a 74 65 6d 70 61 09  53 45 54 41 09 30 0a 20  |s.tempa.SETA.0. |
00000690  20 20 20 20 57 48 49 4c  45 20 74 65 6d 70 61 3c  |    WHILE tempa<|
000006a0  78 78 67 6c 6f 62 73 0a  74 65 6d 70 73 09 53 45  |xxglobs.temps.SE|
000006b0  54 53 09 22 78 78 67 6e  61 6d 65 22 3a 43 43 3a  |TS."xxgname":CC:|
000006c0  22 24 74 65 6d 70 61 22  0a 74 65 6d 70 73 09 53  |"$tempa".temps.S|
000006d0  45 54 53 09 24 74 65 6d  70 73 0a 09 47 6c 6f 62  |ETS.$temps..Glob|
000006e0  49 6e 69 74 20 24 74 65  6d 70 73 0a 74 65 6d 70  |Init $temps.temp|
000006f0  61 09 53 45 54 41 09 74  65 6d 70 61 2b 31 0a 20  |a.SETA.tempa+1. |
00000700  20 20 20 20 57 45 4e 44  0a 09 26 09 26 24 78 78  |    WEND..&.&$xx|
00000710  74 6f 70 67 6c 6f 62 61  6c 0a 09 26 09 30 0a 0a  |topglobal..&.0..|
00000720  09 26 09 26 31 32 33 34  35 36 37 38 0a 74 65 6d  |.&.&12345678.tem|
00000730  70 61 09 53 45 54 41 09  30 0a 20 20 20 20 20 57  |pa.SETA.0.     W|
00000740  48 49 4c 45 20 74 65 6d  70 61 3c 3e 78 78 72 65  |HILE tempa<>xxre|
00000750  6c 6f 63 73 0a 74 65 6d  70 73 09 53 45 54 53 09  |locs.temps.SETS.|
00000760  22 72 78 22 3a 43 43 3a  22 24 74 65 6d 70 61 22  |"rx":CC:"$tempa"|
00000770  0a 74 65 6d 70 61 09 53  45 54 41 09 74 65 6d 70  |.tempa.SETA.temp|
00000780  61 2b 31 0a 09 26 09 24  74 65 6d 70 73 2d 53 74  |a+1..&.$temps-St|
00000790  61 72 74 0a 20 20 20 20  20 57 45 4e 44 0a 09 26  |art.     WEND..&|
000007a0  09 26 38 37 36 35 34 33  32 31 0a 09 4d 45 4e 44  |.&87654321..MEND|
000007b0  0a 0a 09 45 4e 44 0a                              |...END.|
000007b7