Home » Archimedes archive » Zipped Apps » BCPL » BCPL/armlib/a/MCLiblr

BCPL/armlib/a/MCLiblr

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/armlib/a/MCLiblr
Read OK:
File size: 0C09 bytes
Load address: 0000
Exec address: 0000
File contents
BaseAddress &1000

 LEADR BaseAddress

 GET $.Alib.BCPLMacs
 GET $.LispDir.BCPL.Asm.LispConsts

RootStackSize	*	&200

Kreadl		*	14  ; different between emulator & u-K
realarm 	*	1
lispmode	*	1
downStack	*	0

; description of stack-frame linkage
frrb		*	0
frrp		*	4
frrl		*	8
frpc		*	12

E_car		*	173
E_cdr		*	174
E_rplaca	*	175
E_rplacd	*	176
E_rplacw1	*	177
E_rplacw2	*	178

arg1		GlobNo	151
true		GlobNo	172
fringe		GlobNo	356
quotefringe	GlobNo	355
interLispFlag	GlobNo	443

PollSR		GlobNo	5
Add		GlobNo	527
Difference	GlobNo	571
Sub1		GlobNo	657
Add1		GlobNo	587
Equal		GlobNo	605
Greaterp	GlobNo	622
Lessp		GlobNo	626
Mult		GlobNo	536
Remainder	GlobNo	575
Quotient	GlobNo	574
Rclm		GlobNo	520
Funap		GlobNo	510
MixError	GlobNo	582
Poll		GlobNo	811
LinkFexprn	GlobNo	832

; The EQ tests at the beginning of each of these call
; sequences provides a free way to do slow function
; linkage (all calls forced through the interpreter).
; Normally, RGB has bit 1 set and branches to these
; sequences set the PSR, so on arrival the instructions
; get executed.  When slow linkage is selected, however,
; bit 1 is cleared in RGB so all these sequences (except
; the ICall ones) turn into no-ops

	MACRO
	CallN	$type
jcall$type
	MOV	rts, rp
	LDMED	rp, {r14, rl, rp}
call$type
	BIC	rb, w2, #P_key
	LDREQ	rb, [rb]
	MOVEQ	r0, #P_code$type.:SHR:24
	CMPEQS	r0, rb, LSR #24
	BNE	qcall$type
zxcall$type
	BIC	r0, rb, #P_key
	LDR	r0, [r0, #0]
	CMPS	w1, r0, LSR #16
	BNE	qcall$type
icall$type
	LDR	r0, [rg, #G_fringe]
	CMPS	r0, rts
	ADDGE	pc, rb, #4
	B	gc$type
	& 0
	MEND

	MACRO
	Call	$type
jcall$type
	MOV	rts, rp
	LDMED	rp, {r14, rl, rp}
call$type
	BIC	rb, w2, #P_key
	LDREQ	rb, [rb]
	MOVEQ	r0, #P_code$type.:SHR:24
	CMPEQS	r0, rb, LSR #24
	BNE	qcall$type
zxcall$type
icall$type
	LDR	r0, [rg, #G_fringe]
	CMPS	r0, rts
	BICGE	pc, rb, #P_key
	B	gc$type
	MEND

	MACRO
	XCall	$type
xjcall$type
	MOV	rts, rp
	LDMED	rp, {r14, rl, rp}
xcall$type
	MOV	rb, w2
	MOV	r0, #P_code$type.:SHR:24
	CMPS	r0, rb,LSR #24
	BEQ	zxcall$type
	MOV	r0, #P_id:SHR:24
	CMPS	r0, w2, LSR #24
	BEQ	call$type
	B	qcall$type
	MEND

; No special action need be taken here to deal with the case
; of slow linkage, because in that case rb has tag bits 00.

	MACRO
	QCallBody $type
qcall$type
	MOV	r0, #P_id:SHR:24  ; was it an ID
	CMPS	r0, rb, LSR #24
	MOV	r0, w2
	BICEQ	rb, rb, #P_key	  ; if so, is its value the right sort of thing
	LDREQ	rb, [rb]
	MOVEQ	r0, #P_code$type.:SHR:24
	CMPEQS	r0, rb, LSR #24
	BEQ	zxcall$type	  ; if so, go ahead and call it
	MEND

; BCalln are normal call sequences for functions internal to
; a block.  The sequence used depends only on the number of
; arguments in registers; not at all on the function type.
; Call of these sequences is via
;	ADD	w2, rb, #offset
;	MOV	r14, pc
;	SUB	pc, rgb, #Bcalln
; and again rb must be loaded with the address of the base of
; the block.
; The sequence looks much like ordinary ILinks, except that
; a different register is used.

	MACRO
	BCall	$type
bcall$type
	LDR	r0, [rg, #G_fringe]
	CMPS	r0, rts
	BICGE	pc, w2, #P_key
	B	bgc$type
	MEND

	LNK a.mclibr
00000000  42 61 73 65 41 64 64 72  65 73 73 20 26 31 30 30  |BaseAddress &100|
00000010  30 0a 0a 20 4c 45 41 44  52 20 42 61 73 65 41 64  |0.. LEADR BaseAd|
00000020  64 72 65 73 73 0a 0a 20  47 45 54 20 24 2e 41 6c  |dress.. GET $.Al|
00000030  69 62 2e 42 43 50 4c 4d  61 63 73 0a 20 47 45 54  |ib.BCPLMacs. GET|
00000040  20 24 2e 4c 69 73 70 44  69 72 2e 42 43 50 4c 2e  | $.LispDir.BCPL.|
00000050  41 73 6d 2e 4c 69 73 70  43 6f 6e 73 74 73 0a 0a  |Asm.LispConsts..|
00000060  52 6f 6f 74 53 74 61 63  6b 53 69 7a 65 09 2a 09  |RootStackSize.*.|
00000070  26 32 30 30 0a 0a 4b 72  65 61 64 6c 09 09 2a 09  |&200..Kreadl..*.|
00000080  31 34 20 20 3b 20 64 69  66 66 65 72 65 6e 74 20  |14  ; different |
00000090  62 65 74 77 65 65 6e 20  65 6d 75 6c 61 74 6f 72  |between emulator|
000000a0  20 26 20 75 2d 4b 0a 72  65 61 6c 61 72 6d 20 09  | & u-K.realarm .|
000000b0  2a 09 31 0a 6c 69 73 70  6d 6f 64 65 09 2a 09 31  |*.1.lispmode.*.1|
000000c0  0a 64 6f 77 6e 53 74 61  63 6b 09 2a 09 30 0a 0a  |.downStack.*.0..|
000000d0  3b 20 64 65 73 63 72 69  70 74 69 6f 6e 20 6f 66  |; description of|
000000e0  20 73 74 61 63 6b 2d 66  72 61 6d 65 20 6c 69 6e  | stack-frame lin|
000000f0  6b 61 67 65 0a 66 72 72  62 09 09 2a 09 30 0a 66  |kage.frrb..*.0.f|
00000100  72 72 70 09 09 2a 09 34  0a 66 72 72 6c 09 09 2a  |rrp..*.4.frrl..*|
00000110  09 38 0a 66 72 70 63 09  09 2a 09 31 32 0a 0a 45  |.8.frpc..*.12..E|
00000120  5f 63 61 72 09 09 2a 09  31 37 33 0a 45 5f 63 64  |_car..*.173.E_cd|
00000130  72 09 09 2a 09 31 37 34  0a 45 5f 72 70 6c 61 63  |r..*.174.E_rplac|
00000140  61 09 2a 09 31 37 35 0a  45 5f 72 70 6c 61 63 64  |a.*.175.E_rplacd|
00000150  09 2a 09 31 37 36 0a 45  5f 72 70 6c 61 63 77 31  |.*.176.E_rplacw1|
00000160  09 2a 09 31 37 37 0a 45  5f 72 70 6c 61 63 77 32  |.*.177.E_rplacw2|
00000170  09 2a 09 31 37 38 0a 0a  61 72 67 31 09 09 47 6c  |.*.178..arg1..Gl|
00000180  6f 62 4e 6f 09 31 35 31  0a 74 72 75 65 09 09 47  |obNo.151.true..G|
00000190  6c 6f 62 4e 6f 09 31 37  32 0a 66 72 69 6e 67 65  |lobNo.172.fringe|
000001a0  09 09 47 6c 6f 62 4e 6f  09 33 35 36 0a 71 75 6f  |..GlobNo.356.quo|
000001b0  74 65 66 72 69 6e 67 65  09 47 6c 6f 62 4e 6f 09  |tefringe.GlobNo.|
000001c0  33 35 35 0a 69 6e 74 65  72 4c 69 73 70 46 6c 61  |355.interLispFla|
000001d0  67 09 47 6c 6f 62 4e 6f  09 34 34 33 0a 0a 50 6f  |g.GlobNo.443..Po|
000001e0  6c 6c 53 52 09 09 47 6c  6f 62 4e 6f 09 35 0a 41  |llSR..GlobNo.5.A|
000001f0  64 64 09 09 47 6c 6f 62  4e 6f 09 35 32 37 0a 44  |dd..GlobNo.527.D|
00000200  69 66 66 65 72 65 6e 63  65 09 47 6c 6f 62 4e 6f  |ifference.GlobNo|
00000210  09 35 37 31 0a 53 75 62  31 09 09 47 6c 6f 62 4e  |.571.Sub1..GlobN|
00000220  6f 09 36 35 37 0a 41 64  64 31 09 09 47 6c 6f 62  |o.657.Add1..Glob|
00000230  4e 6f 09 35 38 37 0a 45  71 75 61 6c 09 09 47 6c  |No.587.Equal..Gl|
00000240  6f 62 4e 6f 09 36 30 35  0a 47 72 65 61 74 65 72  |obNo.605.Greater|
00000250  70 09 47 6c 6f 62 4e 6f  09 36 32 32 0a 4c 65 73  |p.GlobNo.622.Les|
00000260  73 70 09 09 47 6c 6f 62  4e 6f 09 36 32 36 0a 4d  |sp..GlobNo.626.M|
00000270  75 6c 74 09 09 47 6c 6f  62 4e 6f 09 35 33 36 0a  |ult..GlobNo.536.|
00000280  52 65 6d 61 69 6e 64 65  72 09 47 6c 6f 62 4e 6f  |Remainder.GlobNo|
00000290  09 35 37 35 0a 51 75 6f  74 69 65 6e 74 09 47 6c  |.575.Quotient.Gl|
000002a0  6f 62 4e 6f 09 35 37 34  0a 52 63 6c 6d 09 09 47  |obNo.574.Rclm..G|
000002b0  6c 6f 62 4e 6f 09 35 32  30 0a 46 75 6e 61 70 09  |lobNo.520.Funap.|
000002c0  09 47 6c 6f 62 4e 6f 09  35 31 30 0a 4d 69 78 45  |.GlobNo.510.MixE|
000002d0  72 72 6f 72 09 47 6c 6f  62 4e 6f 09 35 38 32 0a  |rror.GlobNo.582.|
000002e0  50 6f 6c 6c 09 09 47 6c  6f 62 4e 6f 09 38 31 31  |Poll..GlobNo.811|
000002f0  0a 4c 69 6e 6b 46 65 78  70 72 6e 09 47 6c 6f 62  |.LinkFexprn.Glob|
00000300  4e 6f 09 38 33 32 0a 0a  3b 20 54 68 65 20 45 51  |No.832..; The EQ|
00000310  20 74 65 73 74 73 20 61  74 20 74 68 65 20 62 65  | tests at the be|
00000320  67 69 6e 6e 69 6e 67 20  6f 66 20 65 61 63 68 20  |ginning of each |
00000330  6f 66 20 74 68 65 73 65  20 63 61 6c 6c 0a 3b 20  |of these call.; |
00000340  73 65 71 75 65 6e 63 65  73 20 70 72 6f 76 69 64  |sequences provid|
00000350  65 73 20 61 20 66 72 65  65 20 77 61 79 20 74 6f  |es a free way to|
00000360  20 64 6f 20 73 6c 6f 77  20 66 75 6e 63 74 69 6f  | do slow functio|
00000370  6e 0a 3b 20 6c 69 6e 6b  61 67 65 20 28 61 6c 6c  |n.; linkage (all|
00000380  20 63 61 6c 6c 73 20 66  6f 72 63 65 64 20 74 68  | calls forced th|
00000390  72 6f 75 67 68 20 74 68  65 20 69 6e 74 65 72 70  |rough the interp|
000003a0  72 65 74 65 72 29 2e 0a  3b 20 4e 6f 72 6d 61 6c  |reter)..; Normal|
000003b0  6c 79 2c 20 52 47 42 20  68 61 73 20 62 69 74 20  |ly, RGB has bit |
000003c0  31 20 73 65 74 20 61 6e  64 20 62 72 61 6e 63 68  |1 set and branch|
000003d0  65 73 20 74 6f 20 74 68  65 73 65 0a 3b 20 73 65  |es to these.; se|
000003e0  71 75 65 6e 63 65 73 20  73 65 74 20 74 68 65 20  |quences set the |
000003f0  50 53 52 2c 20 73 6f 20  6f 6e 20 61 72 72 69 76  |PSR, so on arriv|
00000400  61 6c 20 74 68 65 20 69  6e 73 74 72 75 63 74 69  |al the instructi|
00000410  6f 6e 73 0a 3b 20 67 65  74 20 65 78 65 63 75 74  |ons.; get execut|
00000420  65 64 2e 20 20 57 68 65  6e 20 73 6c 6f 77 20 6c  |ed.  When slow l|
00000430  69 6e 6b 61 67 65 20 69  73 20 73 65 6c 65 63 74  |inkage is select|
00000440  65 64 2c 20 68 6f 77 65  76 65 72 2c 0a 3b 20 62  |ed, however,.; b|
00000450  69 74 20 31 20 69 73 20  63 6c 65 61 72 65 64 20  |it 1 is cleared |
00000460  69 6e 20 52 47 42 20 73  6f 20 61 6c 6c 20 74 68  |in RGB so all th|
00000470  65 73 65 20 73 65 71 75  65 6e 63 65 73 20 28 65  |ese sequences (e|
00000480  78 63 65 70 74 0a 3b 20  74 68 65 20 49 43 61 6c  |xcept.; the ICal|
00000490  6c 20 6f 6e 65 73 29 20  74 75 72 6e 20 69 6e 74  |l ones) turn int|
000004a0  6f 20 6e 6f 2d 6f 70 73  0a 0a 09 4d 41 43 52 4f  |o no-ops...MACRO|
000004b0  0a 09 43 61 6c 6c 4e 09  24 74 79 70 65 0a 6a 63  |..CallN.$type.jc|
000004c0  61 6c 6c 24 74 79 70 65  0a 09 4d 4f 56 09 72 74  |all$type..MOV.rt|
000004d0  73 2c 20 72 70 0a 09 4c  44 4d 45 44 09 72 70 2c  |s, rp..LDMED.rp,|
000004e0  20 7b 72 31 34 2c 20 72  6c 2c 20 72 70 7d 0a 63  | {r14, rl, rp}.c|
000004f0  61 6c 6c 24 74 79 70 65  0a 09 42 49 43 09 72 62  |all$type..BIC.rb|
00000500  2c 20 77 32 2c 20 23 50  5f 6b 65 79 0a 09 4c 44  |, w2, #P_key..LD|
00000510  52 45 51 09 72 62 2c 20  5b 72 62 5d 0a 09 4d 4f  |REQ.rb, [rb]..MO|
00000520  56 45 51 09 72 30 2c 20  23 50 5f 63 6f 64 65 24  |VEQ.r0, #P_code$|
00000530  74 79 70 65 2e 3a 53 48  52 3a 32 34 0a 09 43 4d  |type.:SHR:24..CM|
00000540  50 45 51 53 09 72 30 2c  20 72 62 2c 20 4c 53 52  |PEQS.r0, rb, LSR|
00000550  20 23 32 34 0a 09 42 4e  45 09 71 63 61 6c 6c 24  | #24..BNE.qcall$|
00000560  74 79 70 65 0a 7a 78 63  61 6c 6c 24 74 79 70 65  |type.zxcall$type|
00000570  0a 09 42 49 43 09 72 30  2c 20 72 62 2c 20 23 50  |..BIC.r0, rb, #P|
00000580  5f 6b 65 79 0a 09 4c 44  52 09 72 30 2c 20 5b 72  |_key..LDR.r0, [r|
00000590  30 2c 20 23 30 5d 0a 09  43 4d 50 53 09 77 31 2c  |0, #0]..CMPS.w1,|
000005a0  20 72 30 2c 20 4c 53 52  20 23 31 36 0a 09 42 4e  | r0, LSR #16..BN|
000005b0  45 09 71 63 61 6c 6c 24  74 79 70 65 0a 69 63 61  |E.qcall$type.ica|
000005c0  6c 6c 24 74 79 70 65 0a  09 4c 44 52 09 72 30 2c  |ll$type..LDR.r0,|
000005d0  20 5b 72 67 2c 20 23 47  5f 66 72 69 6e 67 65 5d  | [rg, #G_fringe]|
000005e0  0a 09 43 4d 50 53 09 72  30 2c 20 72 74 73 0a 09  |..CMPS.r0, rts..|
000005f0  41 44 44 47 45 09 70 63  2c 20 72 62 2c 20 23 34  |ADDGE.pc, rb, #4|
00000600  0a 09 42 09 67 63 24 74  79 70 65 0a 09 26 20 30  |..B.gc$type..& 0|
00000610  0a 09 4d 45 4e 44 0a 0a  09 4d 41 43 52 4f 0a 09  |..MEND...MACRO..|
00000620  43 61 6c 6c 09 24 74 79  70 65 0a 6a 63 61 6c 6c  |Call.$type.jcall|
00000630  24 74 79 70 65 0a 09 4d  4f 56 09 72 74 73 2c 20  |$type..MOV.rts, |
00000640  72 70 0a 09 4c 44 4d 45  44 09 72 70 2c 20 7b 72  |rp..LDMED.rp, {r|
00000650  31 34 2c 20 72 6c 2c 20  72 70 7d 0a 63 61 6c 6c  |14, rl, rp}.call|
00000660  24 74 79 70 65 0a 09 42  49 43 09 72 62 2c 20 77  |$type..BIC.rb, w|
00000670  32 2c 20 23 50 5f 6b 65  79 0a 09 4c 44 52 45 51  |2, #P_key..LDREQ|
00000680  09 72 62 2c 20 5b 72 62  5d 0a 09 4d 4f 56 45 51  |.rb, [rb]..MOVEQ|
00000690  09 72 30 2c 20 23 50 5f  63 6f 64 65 24 74 79 70  |.r0, #P_code$typ|
000006a0  65 2e 3a 53 48 52 3a 32  34 0a 09 43 4d 50 45 51  |e.:SHR:24..CMPEQ|
000006b0  53 09 72 30 2c 20 72 62  2c 20 4c 53 52 20 23 32  |S.r0, rb, LSR #2|
000006c0  34 0a 09 42 4e 45 09 71  63 61 6c 6c 24 74 79 70  |4..BNE.qcall$typ|
000006d0  65 0a 7a 78 63 61 6c 6c  24 74 79 70 65 0a 69 63  |e.zxcall$type.ic|
000006e0  61 6c 6c 24 74 79 70 65  0a 09 4c 44 52 09 72 30  |all$type..LDR.r0|
000006f0  2c 20 5b 72 67 2c 20 23  47 5f 66 72 69 6e 67 65  |, [rg, #G_fringe|
00000700  5d 0a 09 43 4d 50 53 09  72 30 2c 20 72 74 73 0a  |]..CMPS.r0, rts.|
00000710  09 42 49 43 47 45 09 70  63 2c 20 72 62 2c 20 23  |.BICGE.pc, rb, #|
00000720  50 5f 6b 65 79 0a 09 42  09 67 63 24 74 79 70 65  |P_key..B.gc$type|
00000730  0a 09 4d 45 4e 44 0a 0a  09 4d 41 43 52 4f 0a 09  |..MEND...MACRO..|
00000740  58 43 61 6c 6c 09 24 74  79 70 65 0a 78 6a 63 61  |XCall.$type.xjca|
00000750  6c 6c 24 74 79 70 65 0a  09 4d 4f 56 09 72 74 73  |ll$type..MOV.rts|
00000760  2c 20 72 70 0a 09 4c 44  4d 45 44 09 72 70 2c 20  |, rp..LDMED.rp, |
00000770  7b 72 31 34 2c 20 72 6c  2c 20 72 70 7d 0a 78 63  |{r14, rl, rp}.xc|
00000780  61 6c 6c 24 74 79 70 65  0a 09 4d 4f 56 09 72 62  |all$type..MOV.rb|
00000790  2c 20 77 32 0a 09 4d 4f  56 09 72 30 2c 20 23 50  |, w2..MOV.r0, #P|
000007a0  5f 63 6f 64 65 24 74 79  70 65 2e 3a 53 48 52 3a  |_code$type.:SHR:|
000007b0  32 34 0a 09 43 4d 50 53  09 72 30 2c 20 72 62 2c  |24..CMPS.r0, rb,|
000007c0  4c 53 52 20 23 32 34 0a  09 42 45 51 09 7a 78 63  |LSR #24..BEQ.zxc|
000007d0  61 6c 6c 24 74 79 70 65  0a 09 4d 4f 56 09 72 30  |all$type..MOV.r0|
000007e0  2c 20 23 50 5f 69 64 3a  53 48 52 3a 32 34 0a 09  |, #P_id:SHR:24..|
000007f0  43 4d 50 53 09 72 30 2c  20 77 32 2c 20 4c 53 52  |CMPS.r0, w2, LSR|
00000800  20 23 32 34 0a 09 42 45  51 09 63 61 6c 6c 24 74  | #24..BEQ.call$t|
00000810  79 70 65 0a 09 42 09 71  63 61 6c 6c 24 74 79 70  |ype..B.qcall$typ|
00000820  65 0a 09 4d 45 4e 44 0a  0a 3b 20 4e 6f 20 73 70  |e..MEND..; No sp|
00000830  65 63 69 61 6c 20 61 63  74 69 6f 6e 20 6e 65 65  |ecial action nee|
00000840  64 20 62 65 20 74 61 6b  65 6e 20 68 65 72 65 20  |d be taken here |
00000850  74 6f 20 64 65 61 6c 20  77 69 74 68 20 74 68 65  |to deal with the|
00000860  20 63 61 73 65 0a 3b 20  6f 66 20 73 6c 6f 77 20  | case.; of slow |
00000870  6c 69 6e 6b 61 67 65 2c  20 62 65 63 61 75 73 65  |linkage, because|
00000880  20 69 6e 20 74 68 61 74  20 63 61 73 65 20 72 62  | in that case rb|
00000890  20 68 61 73 20 74 61 67  20 62 69 74 73 20 30 30  | has tag bits 00|
000008a0  2e 0a 0a 09 4d 41 43 52  4f 0a 09 51 43 61 6c 6c  |....MACRO..QCall|
000008b0  42 6f 64 79 20 24 74 79  70 65 0a 71 63 61 6c 6c  |Body $type.qcall|
000008c0  24 74 79 70 65 0a 09 4d  4f 56 09 72 30 2c 20 23  |$type..MOV.r0, #|
000008d0  50 5f 69 64 3a 53 48 52  3a 32 34 20 20 3b 20 77  |P_id:SHR:24  ; w|
000008e0  61 73 20 69 74 20 61 6e  20 49 44 0a 09 43 4d 50  |as it an ID..CMP|
000008f0  53 09 72 30 2c 20 72 62  2c 20 4c 53 52 20 23 32  |S.r0, rb, LSR #2|
00000900  34 0a 09 4d 4f 56 09 72  30 2c 20 77 32 0a 09 42  |4..MOV.r0, w2..B|
00000910  49 43 45 51 09 72 62 2c  20 72 62 2c 20 23 50 5f  |ICEQ.rb, rb, #P_|
00000920  6b 65 79 09 20 20 3b 20  69 66 20 73 6f 2c 20 69  |key.  ; if so, i|
00000930  73 20 69 74 73 20 76 61  6c 75 65 20 74 68 65 20  |s its value the |
00000940  72 69 67 68 74 20 73 6f  72 74 20 6f 66 20 74 68  |right sort of th|
00000950  69 6e 67 0a 09 4c 44 52  45 51 09 72 62 2c 20 5b  |ing..LDREQ.rb, [|
00000960  72 62 5d 0a 09 4d 4f 56  45 51 09 72 30 2c 20 23  |rb]..MOVEQ.r0, #|
00000970  50 5f 63 6f 64 65 24 74  79 70 65 2e 3a 53 48 52  |P_code$type.:SHR|
00000980  3a 32 34 0a 09 43 4d 50  45 51 53 09 72 30 2c 20  |:24..CMPEQS.r0, |
00000990  72 62 2c 20 4c 53 52 20  23 32 34 0a 09 42 45 51  |rb, LSR #24..BEQ|
000009a0  09 7a 78 63 61 6c 6c 24  74 79 70 65 09 20 20 3b  |.zxcall$type.  ;|
000009b0  20 69 66 20 73 6f 2c 20  67 6f 20 61 68 65 61 64  | if so, go ahead|
000009c0  20 61 6e 64 20 63 61 6c  6c 20 69 74 0a 09 4d 45  | and call it..ME|
000009d0  4e 44 0a 0a 3b 20 42 43  61 6c 6c 6e 20 61 72 65  |ND..; BCalln are|
000009e0  20 6e 6f 72 6d 61 6c 20  63 61 6c 6c 20 73 65 71  | normal call seq|
000009f0  75 65 6e 63 65 73 20 66  6f 72 20 66 75 6e 63 74  |uences for funct|
00000a00  69 6f 6e 73 20 69 6e 74  65 72 6e 61 6c 20 74 6f  |ions internal to|
00000a10  0a 3b 20 61 20 62 6c 6f  63 6b 2e 20 20 54 68 65  |.; a block.  The|
00000a20  20 73 65 71 75 65 6e 63  65 20 75 73 65 64 20 64  | sequence used d|
00000a30  65 70 65 6e 64 73 20 6f  6e 6c 79 20 6f 6e 20 74  |epends only on t|
00000a40  68 65 20 6e 75 6d 62 65  72 20 6f 66 0a 3b 20 61  |he number of.; a|
00000a50  72 67 75 6d 65 6e 74 73  20 69 6e 20 72 65 67 69  |rguments in regi|
00000a60  73 74 65 72 73 3b 20 6e  6f 74 20 61 74 20 61 6c  |sters; not at al|
00000a70  6c 20 6f 6e 20 74 68 65  20 66 75 6e 63 74 69 6f  |l on the functio|
00000a80  6e 20 74 79 70 65 2e 0a  3b 20 43 61 6c 6c 20 6f  |n type..; Call o|
00000a90  66 20 74 68 65 73 65 20  73 65 71 75 65 6e 63 65  |f these sequence|
00000aa0  73 20 69 73 20 76 69 61  0a 3b 09 41 44 44 09 77  |s is via.;.ADD.w|
00000ab0  32 2c 20 72 62 2c 20 23  6f 66 66 73 65 74 0a 3b  |2, rb, #offset.;|
00000ac0  09 4d 4f 56 09 72 31 34  2c 20 70 63 0a 3b 09 53  |.MOV.r14, pc.;.S|
00000ad0  55 42 09 70 63 2c 20 72  67 62 2c 20 23 42 63 61  |UB.pc, rgb, #Bca|
00000ae0  6c 6c 6e 0a 3b 20 61 6e  64 20 61 67 61 69 6e 20  |lln.; and again |
00000af0  72 62 20 6d 75 73 74 20  62 65 20 6c 6f 61 64 65  |rb must be loade|
00000b00  64 20 77 69 74 68 20 74  68 65 20 61 64 64 72 65  |d with the addre|
00000b10  73 73 20 6f 66 20 74 68  65 20 62 61 73 65 20 6f  |ss of the base o|
00000b20  66 0a 3b 20 74 68 65 20  62 6c 6f 63 6b 2e 0a 3b  |f.; the block..;|
00000b30  20 54 68 65 20 73 65 71  75 65 6e 63 65 20 6c 6f  | The sequence lo|
00000b40  6f 6b 73 20 6d 75 63 68  20 6c 69 6b 65 20 6f 72  |oks much like or|
00000b50  64 69 6e 61 72 79 20 49  4c 69 6e 6b 73 2c 20 65  |dinary ILinks, e|
00000b60  78 63 65 70 74 20 74 68  61 74 0a 3b 20 61 20 64  |xcept that.; a d|
00000b70  69 66 66 65 72 65 6e 74  20 72 65 67 69 73 74 65  |ifferent registe|
00000b80  72 20 69 73 20 75 73 65  64 2e 0a 0a 09 4d 41 43  |r is used....MAC|
00000b90  52 4f 0a 09 42 43 61 6c  6c 09 24 74 79 70 65 0a  |RO..BCall.$type.|
00000ba0  62 63 61 6c 6c 24 74 79  70 65 0a 09 4c 44 52 09  |bcall$type..LDR.|
00000bb0  72 30 2c 20 5b 72 67 2c  20 23 47 5f 66 72 69 6e  |r0, [rg, #G_frin|
00000bc0  67 65 5d 0a 09 43 4d 50  53 09 72 30 2c 20 72 74  |ge]..CMPS.r0, rt|
00000bd0  73 0a 09 42 49 43 47 45  09 70 63 2c 20 77 32 2c  |s..BICGE.pc, w2,|
00000be0  20 23 50 5f 6b 65 79 0a  09 42 09 62 67 63 24 74  | #P_key..B.bgc$t|
00000bf0  79 70 65 0a 09 4d 45 4e  44 0a 0a 09 4c 4e 4b 20  |ype..MEND...LNK |
00000c00  61 2e 6d 63 6c 69 62 72  0a                       |a.mclibr.|
00000c09