File OCTDEC.PA (PAL assembler source file)

Directory of image this file is from
This file as a plain text file

OCTDEC,	.-.			/ OCTAL TO DECIMAL
	TAD	(-1750		/ THOUSANDS
	SPA			/ POSITIF?
	JMP	OCDE1		/ YEP
	ISZ	THOU		/ NOT YET
	JMP	OCTDEC+1	/ GO
OCDE1,	TAD	(1750		/ REBUILD
	TAD	(-144		/ MINUS 100
	SPA			/ POSITIF?
	JMP	OCDE2		/ YES
	ISZ	HUN		/ UPDATE HUNDREDS
	JMP	OCDE1+1		/ NOT YET
OCDE2,	TAD	(144		/ REBUILD
	TAD	(-12		/ TENS
	SPA			/ POSITIF?
	JMP	OCDE3		/ NEXT
	ISZ	TEN		/ UPDATE TENS
	JMP	OCDE2+1		/ GO
OCDE3,	TAD	(12		/ REBUILD
	DCA	ONE		/ SAVE ONES
	DCA	ZROFLG		/ SET ZERO FLAG
OCDE4,	TAD	THOU		/ GET THE TOUSANDS
	JMS	DECOUT		/ PRINT
	TAD	HUN		/ PRINT HUNDREDS
	JMS	DECOUT		/
	TAD	TEN		/ GET TENS
	JMS	DECOUT		/ PRINT
	ISZ	ZROFLG		/ SET FLAG
	TAD	ONE		/ PRINT ONES
	JMS	DECOUT		/
	DCA	ONE		/ CLEAR ALL LOCATIONS
	DCA	TEN		/
	DCA	HUN		/
	DCA	THOU		/
	JMP I	OCTDEC		/ RETURN

DECOUT,	.-.			/ PRINT FIGURE,CHECK FOR 0 PRINT
	SZA			/ ZERO?
	JMP	DC1		/ YES
	TAD	ZROFLG		/ CHECK THE FLAG
	SNA CLA			/ WAS IT SET?
	TAD	(" -"0					/ SKIP
DC1,	ISZ	ZROF		/ GET A ZERO
	JMS	PRIUT		/ RETURN

ONE,    / ONES
TEN,	.-.			/ TENS
HUN,	.-.			/ HUNDREDS
THOU,	.-.			/ THOUSANDS
ZROFLG,	.-.			/ FLAG ZERO OR NOT

        PAGE



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search