[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in MacLisp
- To: bug-lisp @ ai
- Subject: Bug in MacLisp
- From: David McDonald <David.McDonald at CMU-10A>
- Date: Fri, 27 Jul 79 00:44:00 GMT
- Original-date: Thursday, 26 July 1979 2044-EDT
The code to get the width of a terminal in the CMU version
of MacLisp is incorrect. The current code is:
seto 11,0 ; current job for getlin uuo
calli 11,34 ; get sixbit terminal name.
tlz 11,-1 ; zero left half of result.
movei 10,1012 ; parameter to trmop uuo
; to return tty width.
move 12,[xwd -2,10] ; 10 contains 1012 (get widthof
; terminal). 11 contains the
; users terminal index.
calli 12,116
movei 10,111 ; default width of 73(decimal).
subi 10,1 ; make it one less so that wrap
; around doesn't occur.
movem 10,? ; store it in a random location
The calli 11,34 returns the sixbit name of the terminal
attached to the current job. The trmop uuo (calli ,116) requires
the universail I/O index for the terminal. The sixbit name is not
wanted, thus the calli 11,34 should be replaced with calli 11,115.
This will return the universal I/O index for the terminal. Note
that the calli 11,115 may give an error return by not skipping the
next instruction.
The -2 in the [xwd -2,10] operand should be a 2 as the calli
12,116 UUO needs the absolute length of its parameter block. Since
the calli 116 should return the width of the terminal in register 12,
the three following instructions should use 12 not 10. In the
current system the calli 116 takes the error return and uses the
default of 72 characters.
The code that should be used to get the width of the terminal
should be something along the following lines:
seto 11,0 ; current job for trmno uuo
calli 11,115 ; get universal I/O index for
; terminal
jrst Default ; use default length on error.
movei 10,1012 ; parameter to trmop uuo
; to return tty width.
move 12,[xwd 2,10] ; 10 contains 1012 (get widthof
; terminal). 11 contains the
; users terminal index.
calli 12,116 ; get current width of terminal
Default: movei 12,111 ; default width of 73(decimal).
subi 12,1 ; make it one less so that wrap
; around doesn't occur.
movem 12,? ; store it in a random location
This is not a high priority bug, since the current MacLisp
uses the default value of 72 because the calli 12,116 gets an error.
- David McDonald.