🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #2854

cexec oddness

#2854
From: Lawrence D'Oliveiro, Waikato Uni...
Date: Wed, 22 Aug 1990 00:25
50 lines
2084 bytes
I discovered some odd behaviour in my messing about with cexecs. It
appears that things left on the stack--that are *not* accessed by the
cexec code--can trigger "invalidaccess" errors! Here's a PostScript
sequence containing an absolutely trivial, "do nothing" cexec:

% begin PostScript sequence
(Hello.)		% troublesome stack object (try dropping the full stop)

% do the cexec
<79CD33990012000104020010000000004E75>
(BAB2CD7AD2DAABB1603D) eexec % just says "cexec" in secret code

% check what's on stack
stack clear
% end of PostScript sequence

As it stands, it works fine on our LaserWriter IINTX (PostScript version
47.0). However, try replacing "(Hello.)" with "(Hello)" (i e just drop
the full stop). Now you'll get "Error: invalidaccess; OffendingCommand: cexec".

If you think the cexec code is doing something funny, here's the complete
source (in MPW Assembler):

;+
; A completely trivial, "do nothing" cexec.
;-

	main
CexecBase
	dc.w	$79CD		; checksum
	dc.w	$3399		; "signature"
	dc.w	$0012		; length of entire cexec block
	dc.w	$0001		; seemingly fixed value
	dc.b	$04		; ditto
	dc.b	2		; minimum version of PostScript required
	dc.w	EntryPoint - CexecBase ; offset to entry point
	dc.w	0, 0		; offset to and length in bytes of relocation table
EntryPoint
	rts
	endmain

	end

See anything funny there?

Lawrence D'Oliveiro                       fone: +64-71-562-889
Computer Services Dept                     fax: +64-71-384-066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
The net never sleeps. It just gets knocked unconscious every now and then.
Technical Details
Message-ID: <1290.26d279cc@waikato.ac.nz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!comp.vuw.ac.nz!virtue!ccc_ldo

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!comp.vuw.ac.nz!virtue!ccc_ldo
From: ccc_ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.lang.postscript
Subject: cexec oddness
Message-ID: <1290.26d279cc@waikato.ac.nz>
Date: 22 Aug 90 00:25:47 GMT
Organization: University of Waikato, Hamilton, New Zealand
Lines: 50