ex2.asm (1569B)
1 ; 2 ; 3 ; This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 ; 5 ; Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 ; 7 ; 8 ;Here is an example program for programming the LEDs on the 5605. 9 ; 10 ;The situation is this: 11 ; 12 ; 26 ports (port 0-25) each have three LEDs. 13 ; led 0: RX 14 ; led 1: TX 15 ; led 2: COLL 16 ; 17 ; The scan out order is RX, TX, COLL status for port 0, then 18 ; for port 1, ... 19 ; 20 ; 21 ;-------------------------- start of program -------------------------- 22 23 begin: 24 ld A,0 ; start with port 0 25 ld (portnum),A 26 27 portloop: 28 port A ; specify which port we're dealing with 29 pushst RX 30 pack ; send to output buffer 31 pushst TX 32 pack ; send to output buffer 33 pushst COLL 34 pack ; send to output buffer 35 36 inc (portnum) 37 ld A,(portnum) 38 cmp A,26 39 jnz portloop 40 41 send 78 ; send 26*3 LED pulses and halt 42 43 44 ; data storage 45 portnum equ 0x7F ; temp to hold which port we're working on 46 47 48 ; symbolic labels 49 ; this gives symbolic names to the various bits of the port status fields 50 51 RX equ 0x0 ; received packet 52 TX equ 0x1 ; transmitted packet 53 COLL equ 0x2 ; collision indicator 54 SPEED_C equ 0x3 ; 100 Mbps 55 SPEED_M equ 0x4 ; 1000 Mbps 56 DUPLEX equ 0x5 ; half/full duplex 57 FLOW equ 0x6 ; flow control capable 58 LINKUP equ 0x7 ; link down/up status 59 LINKEN equ 0x8 ; link disabled/enabled status 60 61 ;-------------------------- end of program -------------------------- 62 ; 63 ;This program is 24 bytes in length and is only slightly more complicated 64 ;than Example #1.