?? bal.lst
字號:
A51 MACRO ASSEMBLER BAL 30/05/00 10:40:54 PAGE 1
DOS MACRO ASSEMBLER A51 V5.28m
OBJECT MODULE PLACED IN BAL.OBJ
ASSEMBLER INVOKED BY: C:\C51\BIN\A51.EXE BAL.A51 RB(0) DB EP
LOC OBJ LINE SOURCE
1 NAME ButtonsAndLightsForHIDVersion11
2 ; Adapted from ButtonsAndLights Version 3.0
3 ;
4 ; This version works with dScope monSIO0.hex (uses Serial Port 0, loads at 1200H)
5
6 ;Changes from Version 3.0
7 ;BALHID11 is an alternate version of John Hyde's BAL 3.0 (www.usb-by-example.com)
8 ;This version will use Interrupt Out transfers for HID reports if the host is running
9 ;Windows 98 SE or later.
10 ;All changes to the original code are commented with "Jan's code"
11 ;Changes were made to all modules except decode.a51.
12 ;This version was created by Jan Axelson (jan@lvr.com, www.lvr.com)
13
14 ; Changes from Version 2.0
15 ; a) Two misplaced labels corrected
16 ; b) CommandTable moved outside of the constrained page
17 ; c) SETUPDAT buffer copied to direct access memory, simplified coding
18 ; d) Optional Set_Idle now not supported (returns STALL, not ignorred)
19 ; e) R7 used in place of Temp, saved code space
20 ; f) Code reorganized to separate hardware dependant sections
21 ; Old New
22 ; USBINT.A51 Decode.A51
23 ; Vectors.A51 EZInt.A51
24 ; Timer.A51 EZInt.A51
25 ; Main.A51 EZMain.A51
26 ; g) EP0Size made an equate to ease coding of other components
0040 27 EP0Size EQU 64 ; For EZ-USB
28 ; h) Code added for descriptors > EP0Size
29 ;
30 ; Changes from Version 1.0
31 ; a) Register saving removed from Vectors.A51
32 ; Main has no context which needs to be saved
33 ; b) There was a race condition in USB_INT::Set_Report: which
34 ; could cause OLD data to be read. Busy algorithm changed
35 ; c) The USB Version# was incorrectly declared in the Device Descriptor
36 ; It was 0101H and is now 0110H (data from USB IF)
37 ;
38 $INCLUDE(Declare.A51)
=1 39 ; This module declares the variables and constants used in the examples
=1 40 ; It is common to all of the examples
=1 41 ;
=1 42 ; Declare Special Function Registers used
0088 =1 43 TimerControl DATA 088H
0089 =1 44 TimerMode DATA 089H
008C =1 45 Timer0High DATA 08CH
00A8 =1 46 EI DATA 0A8H
00E8 =1 47 EIE DATA 0E8H ; EZ-USB specific
0091 =1 48 EXIF DATA 091H ; EZ-USB specific
00D8 =1 49 EICON DATA 0D8H ; EZ-USB specific
0092 =1 50 PageReg DATA 092H ; EZ-USB specific, used with MOVX @Ri
0086 =1 51 DPS DATA 086H ; EZ-USB specific, used with dual data pointers
=1 52 ;
=1 53 ; "External" memory locations used, EZ-USB specific
=1 54 ; Note that most of these variables are in Page 7FH
7FE8 =1 55 SETUPDAT EQU 07FE8H
7FD4 =1 56 SUDPTR EQU 07FD4H
7FB4 =1 57 EP0Control EQU 07FB4H
7F00 =1 58 EP0InBuffer EQU 07F00H
A51 MACRO ASSEMBLER BAL 30/05/00 10:40:54 PAGE 2
7EC0 =1 59 EP0OutBuffer EQU 07EC0H ; Not in Page 7FH
7E80 =1 60 EP1InBuffer EQU 07E80H ; Not in Page 7FH
7FB5 =1 61 IN0ByteCount EQU 07FB5H
7FC5 =1 62 Out0ByteCount EQU 07FC5H
7FB7 =1 63 IN1ByteCount EQU 07FB7H
=1 64
7FAC =1 65 IN07IEN EQU 07FACH
7FA9 =1 66 IN07IRQ EQU 07FA9H
7FAD =1 67 OUT07IEN EQU 07FADH
7FAA =1 68 OUT07IRQ EQU 07FAAH
7FAE =1 69 USBIEN EQU 07FAEH
7FAB =1 70 USBIRQ EQU 07FABH
7FD6 =1 71 USBControl EQU 07FD6H
7FA6 =1 72 I2CData EQU 07FA6H
7FA5 =1 73 I2CControl EQU 07FA5H
7F93 =1 74 PortA_Config EQU 07F93H
7F94 =1 75 PortB_Config EQU 07F94H
7F95 =1 76 PortC_Config EQU 07F95H
7F96 =1 77 PortA_OUT EQU 07F96H
7F97 =1 78 PortB_OUT EQU 07F97H
7F98 =1 79 PortC_OUT EQU 07F98H
7F99 =1 80 PortA_PINS EQU 07F99H
7F9A =1 81 PortB_PINS EQU 07F9AH
7F9B =1 82 PortC_PINS EQU 07F9BH
7F9C =1 83 PortA_OE EQU 07F9CH
7F9D =1 84 PortB_OE EQU 07F9DH
7F9E =1 85 PortC_OE EQU 07F9EH
=1 86
=1 87 ;*Jan's code start
=1 88 ; These are used for interrupt Out transfers at Endpoint 2
7DC0 =1 89 EP2OutBuffer EQU 07DC0H ; For Endpoint 2 interrupt Out transfers
7FC9 =1 90 OUT2ByteCount EQU 07FC9H ; Endpoint 2 byte count
7FC8 =1 91 OUT2CS EQU 07FC8H ; Endpoint 2 control and status
=1 92 ;*Jan's code end
=1 93 ;
=1 94 ; Byte Variables
=1 95
---- =1 96 DSEG AT 20H
0020 =1 97 FLAGS: DS 1 ; This register is bit-addressable
=1 98 ; Bit Variables
0000 =1 99 Configured EQU FLAGS.0 ; Is this device configured
0001 =1 100 STALL EQU FLAGS.1 ; Need to STALL endpoint 0
0002 =1 101 SendData EQU FLAGS.2 ; Need to send data to PC Host
0003 =1 102 IsDescriptor EQU FLAGS.3 ; Enable a shortcut reply
0004 =1 103 SetAddress EQU FLAGS.4 ; Set the SIE address
=1 104 ;
0021 =1 105 MonitorSpace: DS 1FH ; Used by Dscope
=1 106 ;Expired_Time: DS 1 ; A downcounter for timed Reports
0040 =1 107 ReplyCount: DS 1 ; Byte count for following buffer
0041 =1 108 ReplyBuffer: DS 2 ; Buffer for immediate reply
0043 =1 109 CurrentConfiguration:
0043 =1 110 DS 1 ; Some examples support > 1 configurations
0044 =1 111 SaveDPH: DS 1 ; Needed to save Descriptor Pointer ..
0045 =1 112 SaveDPL: DS 1 ; .. for descriptors > EP0Size
0046 =1 113 SaveLength: DS 1 ; Number of bytes still to send
0047 =1 114 SetupData: ; Buffer in direct access memory
0047 =1 115 RequestType: DS 1
0048 =1 116 Request: DS 1
0049 =1 117 wValueLow: DS 1
004A =1 118 wValueHigh: DS 1
004B =1 119 wIndexLow: DS 1
004C =1 120 wIndexHigh: DS 1
004D =1 121 wLengthLow: DS 1
004E =1 122 wLengthHigh: DS 1
=1 123 ;
004F =1 124 Old_Buttons: DS 1 ; Used by BAL: stores current button position
A51 MACRO ASSEMBLER BAL 30/05/00 10:40:54 PAGE 3
0050 =1 125 LEDstrobe: DS 1 ; Used by BAL: strobe one LED on at a time
0051 =1 126 LEDvalue: DS 1 ; Used by BAL: stores current LED value
0052 =1 127 Msec_Counter: DS 1 ; Used by BAL: counts up to 4 msec
=1 128 ;
129 $INCLUDE(EZInt.A51)
=1 130 ; This module contains all the EZUSB-specific hardware code
=1 131 ; This module also contains all of the interrupt vector declarations and
=1 132 ; the first level interrupt servicing (register save, call subroutine,
=1 133 ; clear interrupt source, restore registers, return)
=1 134 ; Suspend and Resume are handled totally in this module
=1 135 ;
=1 136 ; A Reset sends us to Program space location 0
---- =1 137 CSEG AT 0 ; Code space
=1 138 USING 0 ; Reset forces Register Bank 0
0000 021323 =1 139 LJMP Reset
=1 140 ;
=1 141 ; The interrupt vector table is also located here
=1 142 ; EZ-USB has two levels of USB interrupts:
=1 143 ; 1-the main level is described in this table (at ORG 43H)
=1 144 ; 2-there are 21 sources of USB interrupts and these are described in USB_ISR
=1 145 ; This means that two levels of acknowledgement and clearing will be required
=1 146 ; LJMP INT0_ISR ; Features not used are commented out
=1 147 ; ORG 0BH
=1 148 ; LJMP Timer0_ISR
=1 149 ; ORG 13H
=1 150 ; LJMP INT1_ISR
=1 151 ; ORG 1BH
=1 152 ; LJMP Timer1_ISR
=1 153 ; ORG 23H
=1 154 ; LJMP UART0_ISR
=1 155 ; ORG 2BH
=1 156 ; LJMP Timer2_ISR
=1 157 ; ORG 33H
=1 158 ; LJMP WakeUp_ISR
=1 159 ; ORG 3BH
=1 160 ; LJMP UART1_ISR
0043 =1 161 ORG 43H
0043 021200 =1 162 LJMP USB_ISR ; Auto Vector will replace byte 45H
=1 163 ; ORG 4BH
=1 164 ; LJMP I2C_ISR
=1 165 ; ORG 53H
=1 166 ; LJMP INT4_ISR
=1 167 ; ORG 5BH
=1 168 ; LJMP INT5_ISR
=1 169 ; ORG 63H
=1 170 ; LJMP INT6_ISR
=1 171
1200 =1 172 ORG 1200H ; Load above monSIO0.hex
1200 02129C =1 173 USB_ISR:LJMP SUDAV_ISR
1203 00 =1 174 DB 0 ; Pad entries to 4 bytes
1204 021280 =1 175 LJMP SOF_ISR
1207 00 =1 176 DB 0
1208 02122F =1 177 LJMP SUTOK_ISR
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -