
/EAE OVERLAY FOR ROGALGOL INTEGER OPERATING SYSTEM

POP=JMS 37
T4=72
OR=655
MUL=447
DIV=457
PNEXT=43
PC=10
SET1=735
T1=67
WORD=26
PRINT=1075
SP=30
XNEXT6=201
NEXA=236
PSDMUY=1254
PSDDVI=1220
SUDOMQ=47

FIELD 0

*XNEXT6+15;	LSR; 5; JMP I XNEXT6

*NEXA+7
	LSR; 5; TAD .+3; DCA .+1; HLT; JMP I 100

*MUL;	DCA T4; JMS SIGN1; DCA M1; JMS SIGN1
	MQL MUY
M1,	0; JMP SIGN2

*DIV;	DCA T4; JMS SIGN1; DCA D1; JMS SIGN1
	MQL DVI
D1,	0
SIGN2,	CLA; TAD T4; RAR
	CLA MQA; SZL; CIA; JMP I PNEXT+1
SIGN1,	0; ISZ SP; TAD I SP; SPA; ISZ T4; SPA; CIA; JMP I SIGN1

*PRINT+4;	MQL
*PRINT+12;	DVI
*PRINT+15;	DVI
*PRINT+20;	DVI
*PRINT+23;	MQA

*PSDDVI
	0; DCA PSD1; TAD I PSDDVI; ISZ PSDDVI; DCA PSD2
	TAD SUDOMQ; MQL; TAD PSD1; DVI
PSD2,	0; DCA PSD1; MQA; DCA SUDOMQ; TAD PSD1; JMP I PSDDVI
PSD1,	0

*PSDMUY
	0; DCA PSM1; TAD I PSDMUY; ISZ PSDMUY; DCA PSM2
	TAD SUDOMQ; MQL; TAD PSM1; MUY
PSM2,	0; DCA PSM1; MQA; DCA SUDOMQ; TAD PSM1; JMP I PSDMUY
PSM1,	0

*OR
	POP; MQL; POP; MQA; JMP PNEXT

*SET1
	TAD WORD; DCA T1	/HAS MS BITS
	CDF 10; TAD I PC; CDF; DCA WORD
	TAD WORD; MQL; TAD T1
	SHL; 5; JMP I PNEXT+1
$
