NorthStar Pascal notes:

BOOTER.CODE - Copies boot track.
BINDER.CODE - Links gotoxy into p-system.
SETUP.CODE - Modifies SYSTEM.MISCINFO -> NEW.MISCINFO.

*GOTOXY.TEXT - Sample code for GOTOXY.
*GOTOXY.CODE - File ready to be bound to SYSTEM.PASCAL.


Tasks:

Create new blank disk:

From NS-DOS or CP/M format a disk.

Boot p-system, type 'F' for filer.

Type 'Z' to zero (initialize), specify drive with disk to be erased:

#4: - 1st drive (A under CP/M).
#5: - 2nd drive (B under CP/M).
#9: - 3rd drive (C under CP/M).
#10: - 4th drive (D under CP/M).

Destroy xxxx: ? y
Duplicate dir ? y
xxx blocks ? (170 for SSSD, 340 for SSDD, 690 for DSDD)
New vol name ? (anything you want)

Type 'Q' to exit filer.

Type 'X', BOOTER<CR> - To copy boot track:
4 - Copy from 1st drive.
5 - Copt to 2nd drive (9 or 10 if needed).


Change terminal parameters:

Edit/create a gotoxy program (examples included on disk).
Compile gotoxy program.
'X' execute BINDER to link file into SYSTEM.PASCAL.

'X' execute SETUP to edit other terminal characteristics.
KEY variable are keyboard entries otherwise terminal out codes.
Either one may have leadin character (such as escape).

Using filer 'T' NEW.MISCINFO -> SYSTEM.MISCINFO.

Reboot to apply changes.


BIOS jump table:

Finding the BIOS jump table can be difficult if it not an "original disk".

I created a pascal disk image NEWPAS.NSI, the IO routines are a NS DOS file.

The routines are located 2C00H bytes in (2D00H in debug).

NorthStar has two interpreters one starting at 0000h and the other at 2000h.

The jump table is located 0400h bytes in:


	org	0400h		; Or 2400h
nsjtst	equ	$		; Start of NS jump table
strtsr	equ	nsjtst+200H	; Memory sizing search start point

cononl	jmp	online
	jmp	coninp
	jmp	conout
	jmp	const

prtonl	jmp	online
	jmp	prtinp
	jmp	prtout

remonl	jmp	online
	jmp	reminp
	jmp	remout

	jmp	nsmsiz

	jmp	offline		; NSCLOK is off-line

	jmp	macint		; Machine initialization

ddens	equ	80h		; Double-density
dsided	equ	40h		; Quad density
blkstrk	equ	10		; Pascal Blocks/track
characs	equ	ddens+dsided+blkstrk

dv4chr	db	characs
dv5chr	db	characs
dv9chr	db	characs
dv10chr	db	characs

expansn	db	0,0		; Reserved for future use.

dle	equ	'P'-40h		; Control-P
cstat	equ	3
cdata	equ	2
pstat	equ	5
pdata	equ	4
rstat	equ	6
rdata	equ	0
mboard	equ	6
ramport	equ	0C0H
rpoflg	equ	20h
rda	equ	2
tbe	equ	1

coninp	in	cstat		; Check status
	ani	rda
	jz	coninp
	in	cdata
	ani	7FH
	cpi	dle		; Is char control-p?
	rnz
	ori	80H		; fool p-system by hiding control-P
	ret

conout	in	cstat		; check status
	ani	tbe
	jz	conout
	mov	a,c
	ani	0FFH		; can be changed to 7FH
	out	cdata
	xra	a		; Good I/O result
	ret

const	in	cstat		; Check status
	ani	rda
	jz	const1
	mvi	a,0FFH		; Flag char avail.
	ret

const1	mvi	a,0		; Flag no char avail.
	ret

prtinp	in	pstat		; Character input
	ani	rda
	jz	prtinp
	in	pdata
	ani	7Fh
	cpi	dle		; same as above
	jnz	prtinp1
	ori	80h
prtinp1	mov	c,a		; return char in C
	xra	a		; Good I/O result.
	ret

prtout	in	pstat		; Character output
	ani	tbe
	jz	prtout
	mov	a,c
	ani	0FFH		; Can be changed to 7FH
	out	pdata
	xra	a		; Good I/O result.
	ret

reminp	xra	a		; Good I/O result
	mov	c,a		; No parallel input
	ret

remout	in	rstat		; Check status
	ani	tbe
	jz	remout
	mvi	a,rpoflg	; Reset PO flag
	out	rstat
remout1	mov	a,c		; Output char in C
	ori	80h		; Set /strobe
	out	rdata
	xri	80h		; Assert strobe
	out	rdata
	xri	80h		; Set /strobe
	out	rdata
	xra	a		; Good I/O result.
	ret

; Vector to this routine if given device is available.

online	xra	a		; Good I/O result.
	ret

; Vector to this routine if given device is not available

offlin	mvi	a,0FFH		; Not ready result.
	ret

; Dynamic Memory Sizing
; Note sequence for returning to calling routine:
;	XTHL
;	PCHL
; It's crucial that a return is done in this way,
;   else system will probably crash.  When this
;   return sequence is executed, HL must be hold-
;   ing pointer to last WORD of contiguous memory
;   available.

nsmsiz	lxi	h,strtsr	; Starting size
	mvi	l,0FFH		; Last byte of page
nsmsiz1	mov	a,m		; Get contents
	mov	b,a		; Save it
	cma
	mov	m,a		; Modify it
	cmp	m		; Is it the same?
	jnz	endsrch		; No, done
	mov	m,b		; Restore memory
	inr	h		; Next page
	jnz	nsmsiz1		; Stop when 64K (not poss on NS)

endsrch	dcr	h		; Last good page
	dcr	l		; Last good word
	xthl			; put on stack get return address
	pchl			; return

macint	push	psw		; Initialize I/O
	push	h
	xra	a
	out	mboard
	mvi	a,40h		; Parity disabled
	out	ramport
	lxi	h,0E800H+0400H	; Start above disk controller
ramint	mov	a,m		; Get RAM
	mov	m,a		; Set parity
	inr	l		; Next byte
	jnz	ramint
	inr	h		; Next page
	mov	a,h		; High address
	cpi	0E8H		; Around to disk controller yet?
	jnz	raminit		; No, loop

	mvi	a,41H		; turn on parity checking
	out	ramport

; Now inialize USARTs, etc.

	mvi	a,3
	out	cstat
	out	pstat

	mvi	a,40H
	out	cstat
	out	cstat

	xthl			; Do
	xthl			;    nothing (pause)

	mvi	a,0CEH
	out	cstat

	mvi	a,0CEH
	out	pstat

	mvi	a,27H
	out	cstat

	mvi	a,27H
	out	pstat

	in	cdata		; Clear USART data
	in	pdata

;

	mvi	a,60H
	out	rstat

	mvi	a,0DH		; CR
	call	remout1
	pop	h
	pop	psw
	ret
	end
