home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / misc / rosesw33 / rosezsw.lst < prev    next >
File List  |  1989-03-30  |  12KB  |  231 lines

  1.  
  2.  
  3. HI-TECH SOFTWARE Z80 Macro Assembler: rzsw.as
  4.                                                                                                                           Page   1
  5.  
  6.  
  7.    1    0000'                       psect    data
  8.    2                                global    _node_addr, _l2_user_info, _l2_info, Copyright
  9.    3                                global    _L3CALL,_L3DIGI, _L3PORT, _L3_MAXVC, _L3_WI, _L3DELAY
  10.    4                                global    _L3CSIZ, _L3NSIZ, _NPAroute, _userport
  11.    5                                global     _l2parms, _dl2parms, _l3parms, _dl3parms
  12.    6                                global    _USER_MAXVC, _USER_L3_W, _DNics, _ndnics
  13.    7                                global    _sumchk, __Lbssck, mycall, mydigi, myaddr
  14.    8                            
  15.    9    0000'                   initdta:
  16.   10    0000' 0A 31 00 00       myaddr:    defb    10,31h,00h,00h,00h,00h,00h    ;node address
  17.         0004' 00 00 00          
  18.   11    0007' 0029'                 defw    _l2_info            ;dummies message
  19.   12    0009' 0105'                 defw    l2parms                ;l2 user config
  20.   13    000B' 0111'                 defw    l3parms                ;l3 link config
  21.   14    000D' 0004                  defw    4                ;L3 user pkt window
  22.   15    000F' 0005                  defw    5                ;L3 user max vc cnt
  23.   16    0011' 000F                  defw    15                ;_L3CSIZ, no L3 users
  24.   17    0013        =           initlen    equ    $-initdta
  25.   18    0013' 04 31 00          defdnic: defb    4,31h,00h            ;Default DNIC
  26.   19                            
  27.   20    0016' 43 6F 70 79       Copyright: defm    'Copyright 1988 W2VY'
  28.         001A' 72 69 67 68       
  29.         001E' 74 20 31 39       
  30.         0022' 38 38 20 57       
  31.         0026' 32 56 59          
  32.   21    0029' 0000 0000 0033'   _l2_info: defw    0,0,l2rdta,l2wdta,l2eob
  33.         002F' 006E' 006D'       
  34.   22    0033' 52 4F 53 45       l2rdta:    defm    'ROSE X.25 Switch Version 033089 by Thomas A. Moulton, W2VY'
  35.         0037' 20 58 2E 32       
  36.         003B' 35 20 53 77       
  37.         003F' 69 74 63 68       
  38.         0043' 20 56 65 72       
  39.         0047' 73 69 6F 6E       
  40.         004B' 20 30 33 33       
  41.         004F' 30 38 39 20       
  42.         0053' 62 79 20 54       
  43.         0057' 68 6F 6D 61       
  44.   23    006D' 0D                l2eob:    defb    0dh
  45.   24    006E' 00                l2wdta:    defb    0
  46.   25                            
  47.   26    0007        =           AXALEN    equ    7
  48.   27    0001        =           nnodes    equ    1    ;1 nodes in default config
  49.   28    0000        =           nusers    equ    0    ; No Level 3 users in default config
  50.   29    0018        =           maxl3    equ    24    ; My Calls + 15 Node Paths + 8 Users
  51.   30                            
  52.   31                                GLOBAL    _maxl3dev
  53.   32    006F' 0018              _maxl3dev: defw    maxl3    ;Tell rest of world how big it is
  54.   33                            
  55.   34    0071' A4 9E A6 8A       mycall:    defb    0a4h,9eh,0a6h,08ah,040h,40h,06h    ;ROSE-3
  56.         0075' 40 40 06          
  57.   35    0078' A4 9E A6 8A       mydigi:    defb    0a4h,9eh,0a6h,08ah,040h,40h,04h    ;ROSE-2
  58.         007C' 40 40 04          
  59.   36    007F' 00                myport:    defb    0
  60.   37    0080' 0000              mydelay: defw    0        ;900 =15 Mins before retry network link
  61.   38    0082' 14                myvc:    defb    20        ;network links can have 20 vc's default
  62.  
  63.  
  64. HI-TECH SOFTWARE Z80 Macro Assembler: rzsw.as
  65.                                                                                                                           Page   2
  66.  
  67.  
  68.   39    0083' 04                mywi:    defb    4        ;default window of 4
  69.   40                            
  70.   41    0084' 0318 0104' 0103'  initab:    defw    FLAG2-BSSCK-1,BSSCK+1,BSSCK    ;Length, Dest, Src
  71.   42    008A' 0013 011D' 0000'      defw    initlen,initbss,initdta
  72.   43    0090' 0007 0130' 0071'      defw    7*nnodes,_L3CALL,mycall
  73.   44    0096' 0007 01D8' 0078'      defw    7*nnodes,_L3DIGI,mydigi
  74.   45    009C' 0001 0280' 007F'      defw    nnodes,_L3PORT,myport
  75.   46    00A2' 0001 02E0' 0082'      defw    nnodes,_L3_MAXVC,myvc
  76.   47    00A8' 0001 02B0' 0083'      defw    nnodes,_L3_WI,mywi
  77.   48    00AE' 0002 02F8' 0080'      defw    nnodes*2,_L3DELAY,mydelay
  78.   49    00B4' 000C 0105' 0000*      defw    12,l2parms,_dl2parms    ;init l2 parms ram table
  79.   50    00BA' 000C 0111' 0000*      defw    12,l3parms,_dl3parms    ;init l3 parms ram table
  80.   51    00C0' 0003 001B' 0013'  initwm:    defw    3,_DNics,defdnic    ;Default DNIC (3100)
  81.   52    00C6' 0000                  defw    0
  82.   53                            
  83.   54    0000'                       psect    text
  84.   55                                global    __init
  85.   56    0000'                   __init:
  86.   57    0000' 3A 0104'              ld    a,(FLAG1)    ;check flags
  87.   58    0003' FE AA                 cp    0aah
  88.   59    0005' 20 1C                 jp    nz,1f
  89.   60    0007' 3A 041C'              ld    a,(FLAG2)
  90.   61    000A' FE AA                 cp    0aah
  91.   62    000C' 20 15                 jp    nz,1f
  92.   63    000E' CD 0050'              call    sumchk        ;compute the checksum (xor of bytes)
  93.   64    0011' 47                    ld    b,a
  94.   65    0012' 3A 0103'              ld    a,(BSSCK)
  95.   66    0015' B8                    cp    b
  96.   67    0016' 20 0B                 jp    nz,1f
  97.   68    0018' 21 0029'              ld    hl,_l2_info
  98.   69    001B' 22 0124'              ld    (_l2_user_info),hl    ;Only the default message is in rom
  99.   70    001E' 21 00C0'              ld    hl,initwm        ;Warm Start init's
  100.   71    0021' 18 07                 jp    initlp
  101.   72                            
  102.   73    0023' AF                1:    xor    a        ;Clear A
  103.   74    0024' 32 0103'              ld    (BSSCK),a    ;IPAGE and MEMSIZ are set elsewhere
  104.   75                            ;
  105.   76    0027' 21 0084'              ld    hl,initab    ;start of init table
  106.   77    002A' 4E                initlp:    ld    c,(hl)
  107.   78    002B' 23                    inc    hl
  108.   79    002C' 46                    ld    b,(hl)
  109.   80    002D' 23                    inc    hl
  110.   81    002E' 78                    ld    a,b
  111.   82    002F' B1                    or    c        ;done yet?
  112.   83    0030' 28 0F                 jp    z,initeof    ;yes, get out!
  113.   84    0032' 5E                    ld    e,(hl)
  114.   85    0033' 23                    inc    hl
  115.   86    0034' 56                    ld    d,(hl)
  116.   87    0035' 23                    inc    hl
  117.   88    0036' 7E                    ld    a,(hl)
  118.   89    0037' 23                    inc    hl
  119.   90    0038' E5                    push    hl
  120.   91    0039' 66                    ld    h,(hl)
  121.   92    003A' 6F                    ld    l,a
  122.   93    003B' ED B0                 ldir
  123.  
  124.  
  125. HI-TECH SOFTWARE Z80 Macro Assembler: rzsw.as
  126.                                                                                                                           Page   3
  127.  
  128.  
  129.   94    003D' E1                    pop    hl
  130.   95    003E' 23                    inc    hl
  131.   96    003F' 18 E9                 jp    initlp
  132.   97                            
  133.   98    0041'                   initeof:
  134.   99    0041' 3E AA                 ld    a,0aah
  135.  100    0043' 32 0104'              ld    (FLAG1),a
  136.  101    0046' 32 041C'              ld    (FLAG2),a
  137.  102                            
  138.  103                            ;            Now set the checksum value for next time.
  139.  104    0049'                   _sumchk:
  140.  105    0049' CD 0050'              call    sumchk
  141.  106    004C' 32 0103'              ld    (BSSCK),a
  142.  107    004F' C9                    ret
  143.  108                            
  144.  109    0050'                   sumchk:
  145.  110    0050' 21 0104'              ld    hl,FLAG1
  146.  111    0053' 01 0318               ld    bc,FLAG2-FLAG1
  147.  112    0056' 7E                    ld    a,(hl)
  148.  113    0057' 23                    inc    hl
  149.  114    0058' E5                    push    hl
  150.  115    0059' D1                    pop    de        ;source and dest same, the LD is a nop
  151.  116    005A' AE                1:    xor    (hl)
  152.  117    005B' ED A0                 ldi
  153.  118    005D' E0                    ret    po        ;until BC = 0
  154.  119    005E' 18 FA                 jp    1b
  155.  120                            
  156.  121                                COND 0
  157.  122                                global _COLD, restart, _restart
  158.  123                            restart: ld a,(_COLD)        ;Cold Start?
  159.  124                                or    a        ;Well?
  160.  125                                jp    z,0000h        ;Yes, restart (Power Fail!)
  161.  126                                jp    _restart    ;Nope, call C function instead
  162.  127                                ENDC
  163.  128                            
  164.  129    0000'                       psect    bssck        ;bss with checksum protection
  165.  130                                global    IPAGE, _MEMSIZ, _HEAPUSD, _HEAPSIZ, _COLD
  166.  131    0000'                   IPAGE:    DEFS    256        ;Interrupt pointer table (HDWINT.AS)
  167.  132    0100'                   _MEMSIZ: DEFS    2        ;Size of Dynamic RAM (BOOT.AS)
  168.  133    0102'                   _COLD:    defs    1        ;Reason for Restart (BOOT.AS)
  169.  134    0103'                   BSSCK:    defs    1
  170.  135    0104'                   FLAG1:    defs    1
  171.  136    0105'                   l2parms: defs 12
  172.  137    0111'                   l3parms: defs 12
  173.  138    011D'                   initbss:
  174.  139    011D'                   _node_addr: defs AXALEN
  175.  140    0124'                   _l2_user_info: defs 2
  176.  141    0126'                   _l2parms: defs 2
  177.  142    0128'                   _l3parms: defs 2
  178.  143    012A'                   _USER_L3_W: defs 2
  179.  144    012C'                   _USER_MAXVC: defs 2
  180.  145    012E'                   _L3CSIZ: defs 2
  181.  146    0130'                   _L3CALL: defs AXALEN*maxl3    ;7 * 18 - 16 Nodes and 2 Users (bbs?)
  182.  147    01D8'                   _L3DIGI: defs AXALEN*maxl3
  183.  148    0280'                   _L3PORT: defs 2*maxl3
  184.  
  185.  
  186. HI-TECH SOFTWARE Z80 Macro Assembler: rzsw.as
  187.                                                                                                                           Page   4
  188.  
  189.  
  190.  149    02B0'                   _L3_WI:  defs 2*maxl3
  191.  150    02E0'                   _L3_MAXVC: defs maxl3
  192.  151    02F8'                   _L3DELAY: defs 2*16    ;2 * 16    Nodes only
  193.  152    0318'                   _L3NSIZ: defs 2
  194.  153    031A'                   _NPAroute: defs 256        ;16 * 16 Alternatives in routing list
  195.  154    041A'                   _userport: defs 2        ;Port number for out-bound User connect requests
  196.  155    041C'                   FLAG2:    defs 1
  197.  156    0000'                       psect    bss
  198.  157                                global    _Init_bss, _SAVE, _SAVEA, _taskq, _timerq
  199.  158    0000'                   _Init_bss:
  200.  159    0000'                   _HEAPUSD: defs 2
  201.  160    0002'                   _HEAPSIZ: defs 2
  202.  161    0004'                   _taskq: defs 2
  203.  162    0006'                   _timerq: defs 2
  204.  163    0008'                   _SAVE: defs 2
  205.  164    000A'                   _SAVEA: defs 16
  206.  165    001A'                   _ndnics: defs 1
  207.  166    001B'                   _DNics:    defs 35        ; 5 - 7 byte entries
  208.  
  209.  
  210. HI-TECH SOFTWARE Z80 Macro Assembler: rzsw.as
  211.                                                                                                                           Page   5
  212.  
  213.  
  214.  
  215.                                                 ---------- Symbol Table ----------
  216.  
  217.         (ABS) 0000#         AXALEN 0007           BSSCK 0103'      Copyright 0016'          FLAG1 0104'          FLAG2 041C'  
  218.         IPAGE 0000'          _COLD 0102'         _DNics 001B'       _HEAPSIZ 0002'       _HEAPUSD 0000'      _Init_bss 0000'  
  219.       _L3CALL 0130'        _L3CSIZ 012E'       _L3DELAY 02F8'        _L3DIGI 01D8'        _L3NSIZ 0318'        _L3PORT 0280'  
  220.     _L3_MAXVC 02E0'         _L3_WI 02B0'        _MEMSIZ 0100'      _NPAroute 031A'          _SAVE 0008'         _SAVEA 000A'  
  221.    _USER_L3_W 012A'    _USER_MAXVC 012C'       __Lbssck 0000*         __init 0000'      _dl2parms 0000*      _dl3parms 0000*  
  222.      _l2_info 0029'  _l2_user_info 0124'       _l2parms 0126'       _l3parms 0128'      _maxl3dev 006F'        _ndnics 001A'  
  223.    _node_addr 011D'        _sumchk 0049'         _taskq 0004'        _timerq 0006'      _userport 041A'            bss 003E#  
  224.         bssck 041D#           data 00C8#        defdnic 0013'         initab 0084'        initbss 011D'        initdta 0000'  
  225.       initeof 0041'        initlen 0013          initlp 002A'         initwm 00C0'          l2eob 006D'        l2parms 0105'  
  226.        l2rdta 0033'         l2wdta 006E'        l3parms 0111'          maxl3 0018          myaddr 0000'         mycall 0071'  
  227.       mydelay 0080'         mydigi 0078'         myport 007F'           myvc 0082'           mywi 0083'         nnodes 0001   
  228.        nusers 0000          sumchk 0050'           text 0060#  
  229.  
  230. 7 jump optimizations
  231.