; RegML.dsm
; Machine code for registration
; L. Stewart, September 30, 1983  10:38 AM

$INCLUDE(Lark.d)
$INCLUDE(8086LIB.D)

C←CODE	SEGMENT

C←DATA	SEGMENT
C←DATA	ENDS

ASSUME CS:C←CODE, DS:C←DATA

; from LarkMonIntML.dsm

; read 8259 IRR
←ReadIRR	PROC	NEAR
	MOV	AL,00AH
	OUT	intctl,AL
	IN	AL,intctl
	MOV	BL,AL
	XOR	BH,BH
	RET
←ReadIRR	ENDP

; int DoubleDecrement(px, y)
;	int *px, y;
; subtract a 16 bit integer from a 32 bit integer

←DoubleDecrement	PROC	NEAR
	PUSH	BP
	MOV	BP,SP
	MOV	SI,CX		; SI ← px, BX has y
	SUB	[SI],BX
	SBB	[SI+2],0
	MOV	BX,[SI]		; return ls word
	POP	BP
	RET
←DoubleDecrement	ENDP

PUBLIC	←ReadIRR
PUBLIC	←DoubleDecrement

C←CODE	ENDS
	END