Annotation of researchv10no/cmd/adb/68v/mchio.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * read or print machine-dependent data structures
                      3:  * stupid version, for vax debugging 68000
                      4:  */
                      5: 
                      6: #include "defs.h"
                      7: 
                      8: /*
                      9:  * read an ASCII expression
                     10:  */
                     11: 
                     12: char lastc;
                     13: 
                     14: WORD
                     15: ascval()
                     16: {
                     17:        TLONG l;
                     18:        register char *p;
                     19:        register int i;
                     20: 
                     21:        l = 0;
                     22:        p = (char *)&l;
                     23:        i = sizeof(l);
                     24:        while (quotchar()) {
                     25:                if (--i >= 0)
                     26:                        *p++ = lastc;
                     27:        }
                     28:        switch (i) {
                     29:        case 4:
                     30:                return (0);
                     31: 
                     32:        case 3:
                     33:                return (l);     /* just the char */
                     34: 
                     35:        case 2:
                     36:                return ((WORD)swab((TSHORT)l));
                     37: 
                     38:        default:
                     39:                return ((WORD)swal(l));
                     40:        }
                     41: }
                     42: 
                     43: /*
                     44:  * read a floating point number in VAX format
                     45:  * the result must fit in a WORD
                     46:  */
                     47: 
                     48: WORD
                     49: fpin(buf)
                     50: char *buf;
                     51: {
                     52:        error("no fp input");
                     53: }
                     54: 
                     55: /*
                     56:  * print a floating point number in VAX format
                     57:  */
                     58: 
                     59: fpout(flag, va)
                     60: char flag;
                     61: char *va;
                     62: {
                     63:        printf("FCONST%X:%X", ((long *)va)[0], ((long *)va)[1]);
                     64: }
                     65: 
                     66: /*
                     67:  * print a date
                     68:  */
                     69: 
                     70: printdate(tvec)
                     71: WORD tvec;
                     72: {
                     73:        char *p;
                     74:        char *ctime();
                     75: 
                     76:        p = ctime((long *)&tvec);
                     77:        p[strlen(p)-1] = 0;             /* stomp on newline */
                     78:        printf("%-25s", p);
                     79: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.