* Scaled down version of C Library printf.
* Only %s %u %d (==%u) %o %x %D are recognized.
* Used to print diagnostic information
* directly on console tty.
* Since it is not interrupt driven,
* all system activities are pretty much
* Printf should not be used for chit-chat.
register unsigned int *adx
;
while((c
= *fmt
++) != '%') {
if(c
== 'd' || c
== 'u' || c
== 'o' || c
== 'x')
printn((long)*adx
, c
=='o'? 8: (c
=='x'? 16:10));
printn(*(long *)adx
, 10);
adx
+= (sizeof(long) / sizeof(int)) - 1;
* Print an unsigned integer in base b.
if (n
<0) { /* shouldn't happen */
putchar("0123456789ABCDEF"[(int)(n
%b
)]);
struct device
*KLADDR
{0177560};
* If last char was a break or null, don't print
if ((KLADDR->rbuf&0177) == 0)
* Try waiting for the console tty to come ready,
* otherwise give up after a reasonable time.
while((KLADDR
->tcsr
&0200) == 0)
while((KLADDR
->rcsr
&0200)==0);
if (lp
!= buf
&& *(lp
-1) == '\\') {