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