Annotation of researchv9/sys/boot/stand/getidprom.s, revision 1.1

1.1     ! root        1: |
        !             2: |      @(#)getidprom.s 1.1 86/02/03 Copyright (c) 1985 by Sun Microsystems, Inc.
        !             3: |
        !             4: #ifdef SUN2
        !             5: #define        FC_MAP          3
        !             6: #define        BYTESPERPG      0x800
        !             7: #define        IDPROMOFF       8
        !             8: #endif
        !             9: #ifdef SUN3
        !            10: #define        FC_MAP          3
        !            11: #define        BYTESPERPG      0x2000
        !            12: #define        IDPROMOFF       0
        !            13: #endif
        !            14: 
        !            15: 
        !            16: |
        !            17: | getidprom(addr, size)
        !            18: |
        !            19: | Read back <size> bytes of the ID prom and store them at <addr>.
        !            20: | Typical use:  getidprom(&idprom_struct, sizeof(idprom_struct));
        !            21: |
        !            22:        .globl  _getidprom
        !            23: _getidprom:
        !            24:        movl    sp@(4),a0       | address to move ID prom bytes to
        !            25:        movl    sp@(8),d1       | How many bytes to move
        !            26:        movl    d2,sp@-         | save a reg
        !            27:        movc    sfc,d0          | save source func code
        !            28:        movl    #FC_MAP,d2
        !            29:        movc    d2,sfc          | set space 3
        !            30:        lea     IDPROMOFF,a1    | select id prom
        !            31:        jra     2$              | Enter loop at bottom as usual for dbra
        !            32: 1$:    movsb   a1@+,d2         | get a byte
        !            33:        movb    d2,a0@+         | save it
        !            34: #ifdef SUN2
        !            35:        addw    #BYTESPERPG-1,a1 | address next byte (in next page)
        !            36: #endif SUN2
        !            37: 2$:    dbra    d1,1$           | and loop
        !            38:        movc    d0,sfc          | restore sfc
        !            39:        movl    sp@+,d2         | restore d2
        !            40:        rts

unix.superglobalmegacorp.com

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