"CP/M compatible" vs. "MS-DOS Compatible" machines?

Roy J. Tellason rtellason at verizon.net
Tue Feb 5 01:06:42 CST 2008


On Monday 04 February 2008 07:21, Dave Dunfield wrote:
> I don't think he was talking about pushing data on the stack,
> I thought he was refering to putting the system service request
> number inline with the code.

Yup...

> This is exactly what I do on both my DMF (8080) and CUBIX (6809)
> OS's.
>
> I use an 'SSR' macro which looks something like (DMF/8080):
>
> SSR	MACRO
> 	RST	2
> 	DB	\1
> 	END
>
>
> It's fairly easy to fetch this:
>
> SSRENT:	STA		savea		; Save accumulator
> 		XTHL				; HL = calling address
> 		MOV		A,M			; Get service request number
> 		INX		H			; Skip for return
> 		XTHL				; Restore HL & new return address
> ; Now you have the SSR number in A
> ; most likely you would use it to index into a handler
> ; table sith something like: (untested)
> 		PUSH	H			; Save application HL
> 		MOV		L,A			; L = SSR number
> 		MVI		H,0			; Zero high
> 		DAD		H			; x2 for two byte entries
> 		PUSH	B			; Save BC
> 		LXI		B,JMPTAB	; Point to jump table
> 		DAD		B			; Offset to table
> 		POP		B			; Restore B
> 		MOV		A,M			; Get low address
> 		INX		H			; Advance to high
> 		MOV		H,M			; Get high address
> 		MOV		L,A			; Set low address
> 		XTHL				; Restore HL, dest on stack
> 		LDA		savea		; Restore A
> 		RET					; Jump to caller
>
> 'JMPTAB' would contain a series of 2-byte addresses of
> the individual SSR handlers.

Only I called mine "OPTAB".   And the register usage was slightly different,  
but that's pretty darn close to what I was doing.  :-)

> In practice it's usually a bit more complex ... iirc
> in my SSR entry I save most of the registers (so that
> the handlers don't have to) and switch to my own stack
> (but it's been a very long time so I may be mistaken).

Yup  I had some entry points just do as little as what was necessary and 
others save *all* registers so we could do things like display them if we 
wanted to or whatever,  and that included switching to the monitor's stack as 
well.

> In the application code, you can then do things like:
>
> 		MVI		A,'?'		; Get prompt
> 		SSR		3			; Output to console (two byte OS call)

Just so,  which strikes me as a whole lot more efficient than having to use a 
3-byte CALL instruction after loading a function code into one register (and 
maybe needing to save that beforehand) and maybe the same with some other 
registers as well.  It was the days when every byte counted,  right?  :-)

-- 
Member of the toughest, meanest, deadliest, most unrelenting -- and
ablest -- form of life in this section of space,  a critter that can
be killed but can't be tamed.  --Robert A. Heinlein, "The Puppet Masters"
-
Information is more dangerous than cannon to a society ruled by lies. --James 
M Dakin




More information about the cctech mailing list