Annotation of xinu/sys/sizmem7300.s, revision 1.1

1.1     ! root        1: |* sizmem.s - sizmem */
        !             2: 
        !             3: MEMMAP =       0x400000
        !             4: GCR    =       0xe40000
        !             5: TPAT   =       0x5533
        !             6: |*------------------------------------------------------------------------
        !             7: |*  sizmem  --  size memory, placing highest valid address in _maxaddr
        !             8: |*  for  ATT7300, all possible 4M acts real even if not there--
        !             9: |*  have to detect wrapped memory addresses.  So write a test pattern
        !            10: |*  to location 0 (not used for reset vector on this system), and
        !            11: |*  then check each start of .5M block for same pattern.  When
        !            12: |*  it shows up again, that's not really memory, just a reflection
        !            13: |*  of prior memory.  This works for up to 2M of onboard memory.
        !            14: |*  If you need more than that for Xinu, you're serious enough to
        !            15: |*  know how to fix this for more memory.
        !            16: |*------------------------------------------------------------------------
        !            17:        .text
        !            18:        .globl  _sizmem
        !            19: _sizmem:
        !            20:        clrl d0
        !            21:        movl d0,a0        | moving pointer
        !            22:        movw #TPAT,0      | put test pattern in loc 0
        !            23:        movw #TPAT,d0     | and in d0
        !            24: sizloop:
        !            25:        addl #0x80000,a0  | next .5M block
        !            26:        cmpl #0x200000,a0 | up to 2M of mem
        !            27:        bge  sizdone
        !            28:        cmpw a0@,d0       | ck for wrapped val showing up
        !            29:        bne sizloop
        !            30: sizdone:movl a0,d0        | here with wrap detected or 2M OK
        !            31:        subl #4,d0        | Xinu wants last valid word, not first invalid
        !            32:        movl d0,_maxaddr
        !            33:        rts

unix.superglobalmegacorp.com

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