Annotation of coherent/d/bin/as/list.c, revision 1.1

1.1     ! root        1: #include "asm.h"
        !             2: 
        !             3: /*
        !             4:  * Copy a block of source and code to
        !             5:  * the listing file. If no listing file or
        !             6:  * the current line is not to be listed
        !             7:  * just return. Multiple code bytes get
        !             8:  * put out on extra lines after the source
        !             9:  * line.
        !            10:  */
        !            11: list()
        !            12: {
        !            13:        register char *wp;
        !            14:        register nb;
        !            15: 
        !            16:        if (lflag==0 || lmode==NLIST)
        !            17:                return;
        !            18:        slew();
        !            19:        while (ep < &eb[NERR])
        !            20:                *ep++ = ' ';
        !            21:        printf("%.10s", eb);
        !            22:        if (lmode == SLIST) {
        !            23:                printf("%31s %5d %s\n", "", line, ib);
        !            24:                return;
        !            25:        }
        !            26:        printf(ADRFMT, laddr);
        !            27:        if (lmode == ALIST) {
        !            28:                printf("%24s %5d %s\n", "", line, ib);
        !            29:                return;
        !            30:        }
        !            31:        wp = cb;
        !            32:        nb = cp - cb;
        !            33:        list1(wp, nb, 1);
        !            34:        printf(" %5d %s\n", line, ib);
        !            35:        while ((nb -= NBOL) > 0) {
        !            36:                wp += NBOL;
        !            37:                slew();
        !            38:                printf("%17s", "");
        !            39:                list1(wp, nb, 0);
        !            40:                putchar('\n');
        !            41:        }
        !            42: }
        !            43: 
        !            44: list1(wp, nb, f)
        !            45: register char *wp;
        !            46: register nb;
        !            47: {
        !            48:        register d, i;
        !            49: 
        !            50:        if (nb > NBOL)
        !            51:                nb = NBOL;
        !            52:        for (i=0; i<nb; ++i) {
        !            53:                d = (*wp++)&0377;
        !            54:                if (lmode == BLIST)
        !            55:                        printf(BFMT, d);
        !            56:                else {
        !            57: #if LOHI
        !            58:                        d |= ((*wp++) << 8);
        !            59: #else
        !            60:                        d = (d<<8) | ((*wp++)&0377);
        !            61: #endif
        !            62:                        printf(WFMT, d);
        !            63:                        ++i;
        !            64:                }
        !            65:        }
        !            66:        if (f) {
        !            67:                while (i < NBOL) {
        !            68:                        printf(SKIP);
        !            69:                        ++i;
        !            70:                }
        !            71:        }
        !            72: }
        !            73: 
        !            74: slew()
        !            75: {
        !            76:        if (lop++ >= NLPP) {
        !            77:                if (page)
        !            78:                        putchar('\f');
        !            79:                printf("Coherent assembler (%s), page %d\n", CPU, ++page);
        !            80:                printf("%s\n\n", tb);
        !            81:                lop = 4;
        !            82:        }
        !            83: }

unix.superglobalmegacorp.com

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