[net.sources] 2 bugs in Princeton FORTH v2.0 for VAX 44.X BSD

wls@astrovax.UUCP (William L. Sebok) (08/04/84)

I regret to announce two bugs in Princeton v2.0 Forth for 4.[12] BSD Unix
running on a VAX. 

_F_I_X #1

  In screen 14 in the default load file ./vaxforth/forth.blk the lines:

CODE FROLL  1 S )+ MOVL  F ) F -) 1 ] MOVL  1 1 2 # ASHL
 F ) F )+ 1 MOVC3  END-CODE
 
 should be replaced by:

CODE FROLL  1 S )+ MOVL  -4 F )) -4 F )) 1 ] MOVL  1 1 2 # ASHL
 F ) -4 F )) 1 MOVC3  END-CODE

 It was clever but wrong.  The autoincrement on the MOVC3 instruction
increments by 1 byte rather than the 4 that I had intended.

_F_I_X #2

*** ./vaxforth/forth3.S.OLD
--- ./vaxforth/forth3.S
***************
*** 1239,1245
  	  .long	  0	/* ()		used for graphics and number output */
  	  .long	  0	/* SSBOT	  string stack bottom */
  	  .long	  0	/* FSBOT	  bottom of floating point stack */
! 	  .long	  0	/* ERRNO    unix error number */
  	  .long	  0	/* QUITADD  intercept forth QUIT (like a Unix signal).*/
  
  hinit:			/* dictionary starts here */

--- 1239,1246 -----
  	  .long	  0	/* ()		used for graphics and number output */
  	  .long	  0	/* SSBOT	  string stack bottom */
  	  .long	  0	/* FSBOT	  bottom of floating point stack */
! _errno: .long	  0	/* ERRNO    unix error number */
! .globl  _errno
  	  .long	  0	/* QUITADD  intercept forth QUIT (like a Unix signal).*/
  
  hinit:			/* dictionary starts here */

Unfortunately the loader allocated the variable _errno right in the middle of
the code for E. , the word to print a number in exponential format.  Thus
any unsuccessful call to a Unix interface word would make E. abort with an
"Illegal Instruction!!" message.
-- 
Bill Sebok			Princeton University, Astrophysics
{allegra,akgua,burl,cbosgd,decvax,ihnp4,noao,princeton,vax135}!astrovax!wls