; Calls.asm
; Copyright Xerox Corporation 1979, 1981
; Last modified October 27, 1981  2:42 PM by Boggs

.bext Call0, Call1, Call2, Call3, Call4, Call5, Call6, Call7, Call8, Call9
.bext Call10, Call11, Call12, Call13, Call14, Call15
.bext Closes, Gets, Puts, Resets, Putbacks, Errors, Endofs, Stateofs
.bext ActOnDiskPages, WriteDiskPages, CreateDiskFile, DeleteDiskPages
.bext AssignDiskPage, ReleaseDiskPage, VirtualDiskDA, RealDiskDA
.bext InitializeDiskCBZ, DoDiskCommand, GetDiskCb, CloseDisk
.bext OpenDD, LockDD, ReadDDPage, UnlockDD, FlushDD, CloseDD, DestroyDDMgr
.bext Allocate, Free

	.srel

; Generic "calls"

Call0:	.call0
Call1:	.call1
Call2:	.call2
Call3:	.call3
Call4:	.call4
Call5:	.call5
Call6:	.call6
Call7:	.call7
Call8:	.call8
Call9:	.call9
Call10:	.call10
Call11:	.call11
Call12:	.call12
Call13:	.call13
Call14:	.call14
Call15:	.call15

; "Stream" equivalents:

Closes:	.call2
Gets:	.call3
Puts:	.call4
Resets:	.call5
Putbacks: .call6
Errors: .call7
Endofs: .call8
Stateofs: .call9

; "BFS" equivalents:

ActOnDiskPages:	.call0
WriteDiskPages:	.call1
CreateDiskFile:	.call2
DeleteDiskPages: .call3
AssignDiskPage:	.call4
ReleaseDiskPage: .call5
VirtualDiskDA:	.call6
RealDiskDA:	.call7
InitializeDiskCBZ: .call9
DoDiskCommand:	.call10
GetDiskCb:	.call14
CloseDisk:	.call15

; "TFS/BFS DDMgr" equivalents:

OpenDD:		.call0
LockDD:		.call1
ReadDDPage:	.call2
UnlockDD:	.call3
FlushDD:	.call4
CloseDD:	.call5
DestroyDDMgr:	.call6

; Storage Allocator equivalents:
Allocate:	.call0
Free:		.call1

	.nrel

; Note the convention for routines called in this way:
; they must start with
;	sta 3 savedPC,2
; and the next instruction must not assume that ac3 contains
; anything useful.  Of course routines produced by Bcpl obey
; this convention

	savedPC=1

.call0:	sta 3 savedPC,2
	mov 0 3
	lda 3 0,3
	jmp 1,3

.call1:	sta 3 savedPC,2
	mov 0,3
	lda 3 1,3
	jmp 1,3

.call2:	sta 3 savedPC,2
	mov 0 3
	lda 3 2,3
	jmp 1,3

.call3:	sta 3 savedPC,2
	mov 0 3
	lda 3 3,3
	jmp 1,3

.call4:	sta 3 savedPC,2
	mov 0 3
	lda 3 4,3
	jmp 1,3

.call5:	sta 3 savedPC,2
	mov 0 3
	lda 3 5,3
	jmp 1,3

.call6:	sta 3 savedPC,2
	mov 0 3
	lda 3 6,3
	jmp 1,3

.call7:	sta 3 savedPC,2
	mov 0 3
	lda 3 7,3
	jmp 1,3

.call8:	sta 3 savedPC,2
	mov 0 3
	lda 3 8.,3
	jmp 1,3

.call9:	sta 3 savedPC,2
	mov 0 3
	lda 3 9.,3
	jmp 1,3

.call10: sta 3 savedPC,2
	mov 0 3
	lda 3 10.,3
	jmp 1,3

.call11: sta 3 savedPC,2
	mov 0 3
	lda 3 11.,3
	jmp 1,3

.call12: sta 3 savedPC,2
	mov 0 3
	lda 3 12.,3
	jmp 1,3

.call13: sta 3 savedPC,2
	mov 0 3
	lda 3 13.,3
	jmp 1,3

.call14: sta 3 savedPC,2
	mov 0 3
	lda 3 14.,3
	jmp 1,3

.call15: sta 3 savedPC,2
	mov 0 3
	lda 3 15.,3
	jmp 1,3

	.end