; CallRam.asm -- Bcpl interface to Ram subroutines

;	Last modified May 20, 1978  7:09 PM

.ent CallRam

.srel

CallRam: .CallRam

.nrel


; result = CallRam(opcode, ac0, ac1, ac3)
; Executes opcode with the supplied values in ac0, ac1, and ac3, and
; returns the value put into ac0 by the opcode.  The opcode is assumed
; to be one of the trap instructions that calls a Ram subroutine.

.CallRam:
	sta 3 1 2
	jsr @370		; Get a frame
	 10
	 jsr @367
	lda 0 5 2		; Load ac0 arg
	lda 1 cJmpRet		; Put return instruction after opcode
	sta 1 5 2
	lda 1 6 2		; Load ac1 arg
	lda 3 7 2		; Load ac3 arg
	jmp 4 2			; Execute opcode and return

cJmpRet: jmp @366


	.end