[net.emacs] MicroEmacs 3.7 bug fixes

richk@pogo.UUCP (Richard G. Knowles) (08/19/86)

----------------------

  This addresses the following bugs:
     Auto CMODE on files that aren't .c or .h
     -- (the rest are MSC specific, somewhat IBM specific) --
     The real reason the structure REGS isn't defined for MSC
     ^P/^Q/^S problems with MSC
     Out of Stack Space when using the menu.cmd startup file.

     The real reason the structure REGS isn't defined for MSC.  Not
mismatched ifdef..end, but instead no ifdef for MSC.

diff original/estruct.h my_changes/estruct.h
92c94
< #if	MSDOS & LATTICE
---
> #if	MSDOS & (LATTICE | MSC)


----------------------------------------------------------------
     ^P/^Q/^S problems with MSC result from the fact that the library routine
kbhit() uses a dos call that does special character checking.  The real
catch is that MSC does not allow you to right a C routine that is a
replacement, since all the dos calls either wait for a character, do special
character checking, or return their status in a flag that is not returned
by the MSC dos interface routine 'intdos' (carry flag only - we need zero
flag).  Either set TYPAHEAD to 0 or use the following assembler code to
replace MSC's kbhit() routine (add to the list of routines to link).

--- start of kbhit.asm ---
	name	DOSINTF

assume	cs:_TEXT

_DATA	segment	para	public 'DATA'
_DATA	ends

_TEXT	segment	word	public	'CODE'

	public	_kbhit
;*******************************************************************
; int kbhit ();  -- returns true if char available, false otherwise
;*******************************************************************
_kbhit	proc	far
	push	bp
	mov	bp, sp
;
; setup for BIOS keyboard routine call via INT 16h
;   AH = 0 : read next ascii char, place in AL, scan code in AH
;   AH = 1 : check to see if char available; ZF = 1 : no; ZF = 0 : yes
;                   AX = the char (also left in buffer)
;   AH = 2 : return current shift status in AL
;
	mov	ah,1
	int	16h
	mov	ax,0
	jz	return
;
	inc	ax
;
return:	pop	bp
	ret
;
_kbhit	endp
;
_TEXT	ends
	end
--- end of kbhit.asm ---


----------------------------------------------------------------
     Out of Stack Space when using the menu.cmd startup file.  This is
exactly what it says.  Increase your stack space from the 2000 default
to something more (I used 4k) either by adding/changing the /STACK:4096
option to the link or use the EXEMOD program provided by Microsoft to
change the stack size as specified at load time (in hex):
  EXEMOD EMACS.EXE /stack 1000

richk@pogo.UUCP (Richard G. Knowles) (08/19/86)

----------------------

  This addresses the following bugs:
     Auto CMODE on files that aren't .c or .h.  Auto CMODE is invoked
whenever a file ends in h not just .h due to a missing set of parens.
The original is (.. && .. || .. ), which should be (.. && (.. || ..))


diff original/file.c my_changes/file.c
179c179
< 		   *(sptr + 1) == 'c' || *(sptr + 1) == 'h')
---
> 		    (*(sptr + 1) == 'c' || *(sptr + 1) == 'h'))



----------------------------

Richard G. Knowles         tektronix!pogo!richk
Tektronix, Inc
Del. Sta. 63-356
P.O. Box 1000
Wilsonville, Or 97070