********************************************************
*                                                      *
*  This is a demo for the 8255 Programmable Peripheral *
*  Interface. This demo uses an 8086 microprocessor    *
*  running in the minimum mode. The 8255 is configured *
*  for Port A in mode 2 and Port B in mode 0 (input).  *
*  Data is then read in from both ports and their sum  *
*  output through the bidirectional Port A.            *
*                                                      *
*  The demo uses references elements for the 8086mn    *
*  and the 8255. The 8086mn is modelled as a dynamic   *
*  device and the 8255 as a static device.             *
*                                                      *
********************************************************




	ASEG 	0FFFFH
	JMPS 	START


	ASEG 	0000H

START:	MOV	BX,#200H
	MOVB	AL,[BX]
	MOV	DX,#0EH
	OUT	DX,AX
	INC	BX
	INC	BX
	MOVB	AL,[BX]
	OUT	DX,AX
	MOV	DX,#8H
	IN	AX,DX
	MOV	CX,AX
	MOV	BX,#300H
	MOV	[BX],AX
	MOV	DX,#0AH
	IN	AX,DX
	INC	BX
	INC	BX
	MOV	[BX],AX
	ADD	AX,CX
	MOV	BX,#304H
	MOV	[BX],AX
	MOV	DX,#08H
	OUT	DX,AX


	ORG 	200H
	DB	0C3H
	DB	00H
	DB	09H



	END
