From: utzoo!decvax!pur-ee!ks
Newsgroups: net.unix-wizar
Title: Re: Uppercase printf on BSD - (nf)
Article-I.D.: pur-ee.500
Posted: Wed Aug 11 01:26:47 1982
Received: Fri Aug 13 05:12:52 1982

#R:harpo:-93700:pur-ee:500011:000:1114
pur-ee!ks    Aug 11 00:06:00 1982

To make printf() from 4.1BSD work "right", copy /usr/src/libc/stdio/doprnt.s
into a file of your own.  Only a one line change is necessary to use the
3.0 standard format for %X.  Around line 203, comment out the line directing
it to hex, and put in the line directing it to capital.  This is an assembly
language switch table. This is how lines 202 through 205 should now appear.

	.word fmtbad-L5			# W
#	.word hex-L5			# X
 	.word capital-L5		# X
	.word fmtbad-L5			# Y

To assemble doprnt.s, you may need to do something like:

	% cp doprnt.s doprnt.c
	% cc -E doprnt.c | as -o doprnt.s
	% rm -f doprnt.c

(The file contains several #define's that must be run through
the C pre-processor.)  Now that you have doprnt.o, just use it like any
object file as in: "cc prog.c doprnt.o"  This works just fine for me,
as I had the same problem with hex files downloaded through an MDS system.

Thanks to Berkeley for the fine commenting in this assembly language monster.

					Kirk Smith
					Purdue EE

P.S.  If someone has a similar fix for v7 PDP UNIX doprnt.s, let me know
so I won't have to figure it out myself.