mkweb

PDP-8 Emulator written in Javascipt with HTML5 Canvas based frontend.

Abs	Inst
Addr	Data	Tag		Instruction
-----	----	--------	-----------
0010,	6777	HEAD,		BUFINIT	
0011,	6777	TAIL,		BUFINIT	
0012,	0577	MSGPTR,		WELMSG-1	
    :
0020,	0000	ADDR,		0	
0021,	0000	STADDR,		0	
0022,	0000	STDATA,		0	
0023,	0000	LSTADR,		0	
0024,	6777	BUFRST,		BUFINIT	
0025,	0577	MSGRST,		WELMSG-1	
0026,	0012	NL,		12			/ ASCII New Line
0027,	0134	BSLSH,		134			/ ASCII Back Slash
0030,	0072	COLON,		72			/ ASCII Colon
0031,	0040	SPACE,		40			/ ASCII Space
0032,	0056	DOT,		56			/ ASCII Period
0033,	0122	R,		122			/ ASCII 'R'
0034,	7710	CA8,		7710			/ -(ASCII 8)
0035,	7720	CA0,		7720			/ 000 000 110 000 > 111 111 001 111 > 111 111 010 000 > 7720
0036,	0000	PUTNM,		0			/ Put number stub. Allows calling from any page
0037,	5440			JMP I PUTNMA		/ Jump indirectly to put number address
0040,	0400	PUTNMA,		PUTNMR	
0041,	0000	GETNM,		0			/ Get number stub. Allows calling from any page
0042,	5443			JMP I GETNMA		/ Jump indirectly to get number routine address
0043,	0515	GETNMA,		GETNMR	
0044,	0000	PUTCH,		0	
0045,	6041			TSF			/ Skip if teleprinter flag set
0046,	5045			JMP .-1			/ Else jump back and loop
0047,	6046			TLS			/ Transfer char in AC, print, clear flag
0050,	5444			JMP I PUTCH		/ Return from subroutine
0051,	0000	GETCH,		0	
0052,	6031			KSF			/ Skip if reader flag is set (meaning there is a char available)
0053,	5052			JMP .-1			/ Else jumpback and wait
0054,	6036			KRB			/ Clear AC, load char, clear flag
0055,	5451			JMP I GETCH		/ Return from subroutine
0056,	0000	RESET,		0			/ Reset subroutine
0057,	7200			CLA			/ Clear AC
0060,	1024			TAD BUFRST		/ Load starting address of buffer
0061,	3010			DCA HEAD		/ Store it in HEAD
0062,	1024			TAD BUFRST		/ Load starting address of buffer
0063,	3011			DCA TAIL		/ Store it in TAIL
0064,	5456			JMP I RESET		/ Return from subroutine
0065,	0000	CMD,		0			/ Command subroutine dispatches the correct subcommand routine based on the command character
0066,	1011			TAD TAIL		/ Load TAIL location into AC
0067,	7041			CMA IAC			/ Complement and increment to form two's complement
0070,	1010			TAD HEAD		/ Add HEAD location to AC
0071,	7500			SMA			/ Skip on -AC, meaning we have more characters in buffer
0072,	5121			JMP READ		/ Read is the default action
0073,	7200			CLA	
0074,	1410			TAD I HEAD		/ Load command char into AC
0075,	3120			DCA CDAT		/ Save it temporarily
0076,	1032			TAD DOT			/ Load value of ascii period
0077,	7041			CMA IAC			/ Complement and increment AC to form two's complement
0100,	1120			TAD CDAT		/ Add character value
0101,	7450			SNA			/ Skip if AC != 0 (not a '.')
0102,	5136			JMP RANGE		/ Jump to range command routine
0103,	7200			CLA			/ Clear AC
0104,	1030			TAD COLON		/ Load value of ascii colon
0105,	7041			CMA IAC			/ Complement and increment to form two's complement
0106,	1120			TAD CDAT		/ Add character value
0107,	7450			SNA			/ Skip if AC != 0 (not a ':')
0110,	5140			JMP WRITE		/ Jump to write command routine
0111,	7200			CLA			/ Clear AC
0112,	1033			TAD R			/ Load value of ascii 'R'
0113,	7041			CMA IAC			/ Complement and increment to form two's complement
0114,	1120			TAD CDAT		/ Add character value
0115,	7450			SNA			/ Skip if AC != 0 (not a 'R')
0116,	5165			JMP RUN			/ Jump to run command routine
0117,	5167			JMP ERROR		/ Jump to error routine if command not found
0120,	0000	CDAT,		0	
0121,	7200	READ,		CLA	
0122,	1021			TAD STADDR	
0123,	4036			JMS PUTNM	
0124,	7200			CLA	
0125,	1030			TAD COLON	
0126,	4044			JMS PUTCH	
0127,	7200			CLA	
0130,	1031			TAD SPACE	
0131,	4044			JMS PUTCH	
0132,	7200			CLA	
0133,	1022			TAD STDATA	
0134,	4036			JMS PUTNM	
0135,	5465			JMP I CMD	
0136,	5537	RANGE,		JMP I RANGEA	
0137,	0446	RANGEA,		RANGER	
0140,	7200	WRITE,		CLA			/ Clear AC
0141,	1011			TAD TAIL		/ Load TAIL location into AC
0142,	7041			CMA IAC			/ Complement and increment to form two's complement
0143,	1010			TAD HEAD		/ Add HEAD location to AC
0144,	7500			SMA			/ Skip on -AC, meaning we have more characters in buffer
0145,	5161			JMP ENDWR		/ Jump to end of write
0146,	4041			JMS GETNM		/ Get write data from command
0147,	3420			DCA I ADDR		/ Store new data at address
0150,	1031			TAD SPACE		/ Add ascii space value
0151,	7041			CMA IAC			/ Complement and increment to form two's complement
0152,	1410			TAD I HEAD		/ Add HEAD
0153,	7440			SZA			/ Skip if char is space
0154,	5161			JMP ENDWR		/ Jump to end of write
0155,	1020			TAD ADDR		/ Load address
0156,	7001			IAC			/ Increment it
0157,	3020			DCA ADDR		/ Store incremented address
0160,	5141			JMP WRITE+1		/ Jump back to write next address
0161,	7240	ENDWR,		CLA CMA			/ Form a -1 in AC
0162,	1010			TAD HEAD		/ Decrement HEAD
0163,	3010			DCA HEAD		/ Store it
0164,	5121			JMP READ		/ Return from command routine
0165,	7300	RUN,		CLA CLL			/ Clear AC and Link
0166,	5423			JMP I LSTADR		/ Jump to last address
0167,	7200	ERROR,		CLA			/ Clear AC
0170,	1026			TAD NL			/ load value of ascii newline
0171,	4044			JMS PUTCH		/ Print character
0172,	7200			CLA	
0173,	5574			JMP I RESTRT		/ Restart program
0174,	0211	RESTRT,		START	
    :
0200,	7200	INIT,		CLA			/ Clear AC
0201,	1025			TAD MSGRST		/ Load start of string
0202,	3012			DCA MSGPTR		/ Store in pointer
0203,	1412			TAD I MSGPTR		/ Get next character
0204,	7450			SNA			/ Skip if not null
0205,	5211			JMP START		/ Return from subroutine
0206,	4044			JMS PUTCH		/ Print character
0207,	7200			CLA			/ Clear AC
0210,	5203			JMP .-5			/ Loop until null is reached
0211,	1027	START,		TAD BSLSH		/ Add the ASCII value of '\'
0212,	4044			JMS PUTCH		/ Print '\'
0213,	4056	LOOP,		JMS RESET		/ Reset HEAD and TAIL
0214,	1026			TAD NL			/ Load the ASCII value of '\n'
0215,	4044			JMS PUTCH		/ Print '\n'
0216,	7200			CLA			/ Clear AC
0217,	4237			JMS RDLN		/ Read command line
0220,	4041			JMS GETNM		/ Get the starting address
0221,	3020			DCA ADDR		/ Store it for use
0222,	1020			TAD ADDR		/ Load it back
0223,	3021			DCA STADDR		/ Store it for keeping
0224,	1421			TAD I STADDR		/ Get data at address
0225,	3022			DCA STDATA		/ Store it for keeping
0226,	1026			TAD NL			/ Load an ascii NL
0227,	4044			JMS PUTCH		/ Print it
0230,	4044			JMS PUTCH		/ Print it
0231,	7200			CLA			/ Clear AC
0232,	4065			JMS CMD			/ Run command
0233,	7200			CLA			/ Clear AC
0234,	1021			TAD STADDR		/ Load starting address
0235,	3023			DCA LSTADR		/ Save it as last address
0236,	5213			JMP LOOP		/ Jump to beginng of loop
0237,	0000	RDLN,		0	
0240,	4051			JMS GETCH	
0241,	3260			DCA CHAR		/ Store char
0242,	1260			TAD CHAR		/ And load it back
0243,	1261			TAD CCR			/ Add the two's complement of '\r' (ascii 13 or 015)
0244,	7450			SNA			/ Skip if input not a newline
0245,	5637			JMP I RDLN		/ If it is, return from readline subroutine
0246,	7200			CLA			/ Clear AC
0247,	1260			TAD CHAR		/ And load it back
0250,	1262			TAD CBS			/ Add the two's complement of '\b' (ascii 8 or 010)
0251,	7450			SNA			/ Skip if input not a backspace
0252,	5263			JMP BSPACE		/ If it is, jump to BSPACE subroutine
0253,	7200			CLA			/ Clear AC
0254,	1260			TAD CHAR		/ And load it back
0255,	4044			JMS PUTCH		/ Echo character back
0256,	3411			DCA I TAIL		/ Store input char at tail
0257,	5240			JMP RDLN+1		/ Read next char
0260,	0000	CHAR,		0	
0261,	7763	CCR,		7763			/ Complement of 015 - ASCII Carrige Return
0262,	7770	CBS,		7770			/ Complement of 010 - ASCII Backspace
0263,	7240	BSPACE,		CLA CMA			/ Set AC to -1
0264,	1011			TAD TAIL		/ Remove last char from tail
0265,	3011			DCA TAIL		/ Store new value
0266,	1027			TAD BSLSH		/ Load backslash
0267,	4044			JMS PUTCH		/ Print it
0270,	5240			JMP RDLN+1		/ Read next character
    :
0400,	7006	PUTNMR,		RTL			/ Rotate left twice, twice
0401,	7006			RTL			/ Should put the top octal digit in the lower 3 bits
0402,	3245			DCA PTMPNM		/ Store shifted value
0403,	1245			TAD PTMPNM		/ Load it back
0404,	0244			AND BOTDIG		/ And the lower 3 bits to extract a single digit
0405,	1243			TAD ASCII0		/ Add offset to get ASCII char value
0406,	4044			JMS PUTCH		/ Print digit
0407,	7200			CLA			/ Clear AC
0410,	1245			TAD PTMPNM		/ Load temp num into AC
0411,	7004			RAL			/ Rotate left once
0412,	7006			RTL			/ Rotate left two more times to get the next digit
0413,	3245			DCA PTMPNM		/ Store shifted value
0414,	1245			TAD PTMPNM		/ Load it back
0415,	0244			AND BOTDIG		/ And the lower 3 bits to extract a single digit
0416,	1243			TAD ASCII0		/ Add offset to get ASCII char value
0417,	4044			JMS PUTCH		/ Print digit
0420,	7200			CLA			/ Clear AC
0421,	1245			TAD PTMPNM		/ Load temp num into AC
0422,	7004			RAL			/ Rotate left once
0423,	7006			RTL			/ Rotate left two more times to get the next digit
0424,	3245			DCA PTMPNM		/ Store shifted value
0425,	1245			TAD PTMPNM		/ Load it back
0426,	0244			AND BOTDIG		/ And the lower 3 bits to extract a single digit
0427,	1243			TAD ASCII0		/ Add offset to get ASCII char value
0430,	4044			JMS PUTCH		/ Print digit
0431,	7200			CLA			/ Clear AC
0432,	1245			TAD PTMPNM		/ Load temp num into AC
0433,	7004			RAL			/ Rotate left once
0434,	7006			RTL			/ Rotate left two more times to get the next digit
0435,	3245			DCA PTMPNM		/ Store shifted value
0436,	1245			TAD PTMPNM		/ Load it back
0437,	0244			AND BOTDIG		/ And the lower 3 bits to extract a single digit
0440,	1243			TAD ASCII0		/ Add offset to get ASCII char value
0441,	4044			JMS PUTCH		/ Print digit
0442,	5436			JMP I PUTNM		/ Return from subroutine via zero page stub
0443,	0060	ASCII0,		60	
0444,	0007	BOTDIG,		7	
0445,	0000	PTMPNM,		0	
0446,	7200	RANGER,		CLA			/ Clear AC
0447,	1020			TAD ADDR		/ Load address
0450,	4036			JMS PUTNM		/ Print number
0451,	7200			CLA			/ Clear AC
0452,	1030			TAD COLON		/ Load ascii colon value
0453,	4044			JMS PUTCH		/ Print it
0454,	7200			CLA			/ Clear AC
0455,	4041			JMS GETNM		/ Get ending address of range
0456,	7040			CMA			/ Form one's complement of it
0457,	3314			DCA ENDADR		/ Store ending address
0460,	5302			JMP RDATA		/ Print first data
0461,	1020	RLOOP,		TAD ADDR		/ Load address
0462,	1314			TAD ENDADR		/ Subtract ending address
0463,	7450			SNA			/ Skip if not equal
0464,	5465			JMP I CMD		/ Return from routine
0465,	7200			CLA			/ Clear AC
0466,	1020			TAD ADDR		/ Load address
0467,	0244			AND BOTDIG		/ And with three low bits
0470,	7440			SZA			/ Skip if AC == 0 (beginning of row)
0471,	5302			JMP RDATA		/ Jump to print data
0472,	1026			TAD NL			/ Load ascii NL
0473,	4044			JMS PUTCH		/ Print it
0474,	7200			CLA			/ Clear AC
0475,	1020			TAD ADDR		/ Load address
0476,	4036			JMS PUTNM		/ Print number
0477,	7200			CLA			/ Clear AC
0500,	1030			TAD COLON		/ Load ascii colon value
0501,	4044			JMS PUTCH		/ Print it
0502,	7200	RDATA,		CLA			/ Clear AC
0503,	1031			TAD SPACE		/ Load ascii space value
0504,	4044			JMS PUTCH		/ Print it
0505,	7200			CLA			/ Clear AC
0506,	1420			TAD I ADDR		/ Get address contents
0507,	4036			JMS PUTNM		/ Print number in AC
0510,	7201			CLA IAC			/ Set AC to 1
0511,	1020			TAD ADDR		/ Increment address
0512,	3020			DCA ADDR		/ Store new address
0513,	5261			JMP RLOOP		/ Jump for next address
0514,	0000	ENDADR,		0	
0515,	7200	GETNMR,		CLA			/ Clear AC
0516,	3376			DCA TNUM		/ Clear temp num
0517,	3377			DCA NNUM		/ Clear number count
0520,	7300			CLA CLL			/ Clear AC and L
0521,	1011			TAD TAIL		/ Load TAIL location into AC
0522,	7041			CMA IAC			/ Complement and increment to form two's complement
0523,	1010			TAD HEAD		/ Add HEAD location to AC
0524,	7500			SMA			/ Skip on -AC, meaning we have more characters in buffer
0525,	5363			JMP ENDNM		/ Else return from subroutine1
0526,	7200			CLA			/ Clear AC
0527,	1410			TAD I HEAD		/ Load HEAD into AC
0530,	3375			DCA THEAD		/ Store char in THEAD
0531,	1375			TAD THEAD		/ Load value back into AC
0532,	1035			TAD CA0			/ Load two's complement of ascii 0
0533,	7510			SPA			/ Skip on positive ac (AC >= 0) (might be a 0-7)
0534,	5360			JMP ENDCH		/ Not a number char - put it back
0535,	7200			CLA			/ Clear AC
0536,	1375			TAD THEAD		/ Load value of char into AC
0537,	1034			TAD CA8			/ Add two's complement of ascii 8
0540,	7500			SMA			/ Skip on minus AC (definitely 0-7)
0541,	5360			JMP ENDCH		/ Not a number (or out of range) - put it back
0542,	7200			CLA			/ Clear AC
0543,	1375			TAD THEAD		/ Load value into AC
0544,	1035			TAD CA0			/ Add two's complement of ascii 0 to get number value
0545,	3375			DCA THEAD		/ Store value
0546,	1376			TAD TNUM		/ Load temp number
0547,	7104			CLL RAL			/ Clear L and rotate left (shift)
0550,	7104			CLL RAL			/ Shift left
0551,	7104			CLL RAL			/ Shift left
0552,	1375			TAD THEAD		/ Combine new number with working number
0553,	3376			DCA TNUM		/ Save new number
0554,	1377			TAD NNUM		/ Load number count
0555,	7001			IAC			/ Increment count
0556,	3377			DCA NNUM		/ Save it
0557,	5320			JMP GETNMR+3		/ Jump back for next number
0560,	7240	ENDCH,		CLA CMA			/ Set AC to -1
0561,	1010			TAD HEAD		/ Decrement HEAD
0562,	3010			DCA HEAD		/ Store new value
0563,	7200	ENDNM,		CLA			/ Clear AC
0564,	1377			TAD NNUM		/ Load number count into AC
0565,	7450			SNA			/ Skip if we found at least one number
0566,	5372			JMP ENDLA		/ Jump to end - last address subroutine
0567,	7200			CLA			/ Clear AC
0570,	1376			TAD TNUM		/ Load number into AC
0571,	5441			JMP I GETNM		/ Return from subroutine
0572,	7200	ENDLA,		CLA			/ Clear AC
0573,	1023			TAD LSTADR		/ Load last address
0574,	5441			JMP I GETNM		/ Return from subroutine
0575,	0000	THEAD,		0	
0576,	0000	TNUM,		0	
0577,	0000	NNUM,		0	
0600,	0155	WELMSG,		"macmon v0.1.0\n"	/ "m"
0601,	0141						/ "a"
0602,	0143						/ "c"
0603,	0155						/ "m"
0604,	0157						/ "o"
0605,	0156						/ "n"
0606,	0040						/ " "
0607,	0166						/ "v"
0610,	0060						/ "0"
0611,	0056						/ "."
0612,	0061						/ "1"
0613,	0056						/ "."
0614,	0060						/ "0"
0615,	0012						/ "\n"
0616,	0000						/ NULL
$