View Single Post
Old 18th Jun 2021, 2:59 am   #23
Mark1960
Octode
 
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,298
Default Re: Multiprocessing SCMPII on MK14

SBASM3 installed OK and seems to be working. I already had Python3 as I've been using this for a panelize tool with eagle .brd files.

Playing around a bit and it seems to allow use of PC, P1 etc by using .EQ.

Code:
	.LF scmp.lst
	.CR scmp
	.TF scmp.hex,INT

	;	Kernel of multithreaded operating system for SC/MP multiprocessor

	;	Entry point at 0000 so there is no need to save the contents of P3
	;	This allows P3 to be used as temporary pointer within user routines
	
	;	MK14 saving pointers in RAM was big endian
	;	SBASM defaults to little endian, use .DR instead of .DW

CODE	.EQ $0000
DATA	.EQ $1000

PC	.EQ 0
P1	.EQ 1
P2	.EQ 2
P3	.EQ 3

	.OR CODE

	.DB 0		; DUMMY INSTRUCTION - NOT EXECUTED
	.DR $1234


ENTRY			; Entry point from reset or to call another thread/routine
	
	XPAH P3		; If P3 == 0000 this was hardware reset
	JNZ FORK1
	XPAH P3
	XPAL P3
	JNZ FORK2
	XPAL P3

	LD (P3)
	LD 8(P3)
	LD @8(P3)
			; Reset thread table


FORK1
	XPAH P3		; Restore P3 high byte
	XPAL P3
FORK2
	XPAL P3		; Restore P3 low byte

			; (P3) contains the start address of the new thread
Mark1960 is offline