?? bal.lst
字號:
120B 00 =1 178 DB 0
120C 02123C =1 179 LJMP Suspend_ISR
120F 00 =1 180 DB 0
1210 021237 =1 181 LJMP USBReset_ISR
1213 00 =1 182 DB 0
1214 02122F =1 183 LJMP Reserved
1217 00 =1 184 DB 0
1218 02124B =1 185 LJMP EP0In_ISR
121B 00 =1 186 DB 0 ; Comment out features not used
=1 187
=1 188 ;*Jan's code start
=1 189 ;Uncomment everything up to EP2OUT_ISR
121C 02122F =1 190 LJMP EP0Out_ISR
A51 MACRO ASSEMBLER BAL 30/05/00 10:40:54 PAGE 4
121F 00 =1 191 DB 0
1220 02122F =1 192 LJMP EP1In_ISR
1223 00 =1 193 DB 0
1224 02122F =1 194 LJMP EP1Out_ISR
1227 00 =1 195 DB 0
1228 02122F =1 196 LJMP EP2In_ISR
122B 00 =1 197 DB 0
122C 021261 =1 198 LJMP EP2Out_ISR
=1 199 ;Jan's code end
=1 200
=1 201 ; DB 0
=1 202 ; LJMP EP3In_ISR
=1 203 ; DB 0
=1 204 ; LJMP EP3Out_ISR
=1 205 ; DB 0
=1 206 ; LJMP EP4In_ISR
=1 207 ; DB 0
=1 208 ; LJMP EP4Out_ISR
=1 209 ; DB 0
=1 210 ; LJMP EP5In_ISR
=1 211 ; DB 0
=1 212 ; LJMP EP5Out_ISR
=1 213 ; DB 0
=1 214 ; LJMP EP6In_ISR
=1 215 ; DB 0
=1 216 ; LJMP EP6Out_ISR
=1 217 ; DB 0
=1 218 ; LJMP EP7In_ISR
=1 219 ; DB 0
=1 220 ; LJMP EP7Out_ISR
=1 221 ; End of Interrupt Vector tables
=1 222
=1 223 ; When a feature is used insert the required interrupt processing here
=1 224 ; The example use only used Endpoints 0 and 1 and also SOF for timing
=1 225 ; *Jan's code also uses the Endpoint 2 Out ISR.
122F =1 226 Reserved:
122F =1 227 INT0_ISR:
122F =1 228 Timer0_ISR:
122F =1 229 INT1_ISR:
122F =1 230 Timer1_ISR:
122F =1 231 UART0_ISR:
122F =1 232 Timer2_ISR:
122F =1 233 UART1_ISR:
122F =1 234 I2C_ISR:
122F =1 235 INT4_ISR:
122F =1 236 INT5_ISR:
122F =1 237 INT6_ISR:
122F =1 238 SUTOK_ISR:
122F =1 239 EP0Out_ISR:
122F =1 240 EP1In_ISR:
122F =1 241 EP1Out_ISR:
122F =1 242 EP2In_ISR:
=1 243 ;EP2Out_ISR: ;*Jan's code uses this interrupt
122F =1 244 EP3In_ISR:
122F =1 245 EP3Out_ISR:
122F =1 246 EP4In_ISR:
122F =1 247 EP4Out_ISR:
122F =1 248 EP5In_ISR:
122F =1 249 EP5Out_ISR:
122F =1 250 EP6In_ISR:
122F =1 251 EP6Out_ISR:
122F =1 252 EP7In_ISR :
122F =1 253 EP7Out_ISR:
122F =1 254 Not_Used: ; Should not get any of these
122F 32 =1 255 RETI
=1 256
A51 MACRO ASSEMBLER BAL 30/05/00 10:40:54 PAGE 5
1230 =1 257 ClearINT2: ; Tell the hardware that we're done
1230 E591 =1 258 MOV A, EXIF
1232 C2E4 =1 259 CLR ACC.4 ; Clear the Interrupt 2 bit
1234 F591 =1 260 MOV EXIF, A
1236 22 =1 261 RET
=1 262
1237 =1 263 USBReset_ISR: ; Bus has been Reset, move to DEFAULT state
1237 C200 =1 264 CLR Configured
1239 5130 =1 265 CALL ClearINT2
=1 266 ; No need to clear source of interrupt
123B 32 =1 267 RETI
=1 268
123C =1 269 Suspend_ISR: ; SIE detected an Idle bus
123C E587 =1 270 MOV A, PCON
123E 4401 =1 271 ORL A, #1
1240 F587 =1 272 MOV PCON, A ; Go to sleep!
1242 00 =1 273 NOP
1243 00 =1 274 NOP ; Wake up here due to a USBResume
1244 00 =1 275 NOP
1245 5130 =1 276 CALL ClearINT2
1247 32 =1 277 RETI
=1 278
1248 =1 279 WakeUp_ISR: ; Not using external WAKEUP in these examples
=1 280 ; So this must be due to a USBResume
1248 C2DC =1 281 CLR EICON.4 ; Clear the wakeup interrupt source
124A 32 =1 282 RETI
=1 283
124B =1 284 EP0In_ISR: ; A prepared packet has been read by PC host
124B E546 =1 285 MOV A, SaveLength ; Do I have any more data to send?
124D 6009 =1 286 JZ NoMoreToSend
124F 854483 =1 287 MOV DPH, SaveDPH ; Retreive descriptor pointer
1252 854582 =1 288 MOV DPL, SaveDPL
1255 1212EA =1 289 CALL SendNextPieceOfDescriptor
=1 290
1258 =1 291 NoMoreToSend:
1258 5130 =1 292 CALL ClearINT2
125A 7401 =1 293 MOV A, #00000001b
125C 907FA9 =1 294 MOV DPTR, #IN07IRQ
125F F0 =1 295 MOVX @DPTR, A ; Clear source of interrupt
1260 32 =1 296 RETI
=1 297
=1 298 ;*Jan's code starts
1261 =1 299 EP2Out_ISR:
=1 300 ;This version of the code enables the chip to do interrupt Out report transfers.
=1 301 ;Windows 98 SE and later support interrupt Out transfers for HIDs.
=1 302 ;The code is similar to the ProcessOutputReport code used for Get_Report control transfers
=1 303 ; The report is only one byte long in this first example
=1 304 ; It contains a new value for the LEDs
1261 C082 =1 305 PUSH DPL
1263 C083 =1 306 PUSH DPH
=1 307 ; PUSH DPL1 ; Uncomment if not using evaluation version
=1 308 ; PUSH DPH1
1265 C0E0 =1 309 PUSH ACC
1267 5130 =1 310 CALL ClearINT2 ; Clear the 8051 USB interrupt
1269 907FAA =1 311 MOV DPTR, #OUT07IRQ ; Clear Endpoint 2 Out's interrupt request bit
126C 7404 =1 312 MOV A, #00000100b
126E F0 =1 313 MOVX @DPTR, A
=1 314 ; MOV DPTR, #OUT2ByteCount ; How many bytes were received?
=1 315 ; MOVX A, @DPTR ; (This example doesn't use the count value)
126F 907DC0 =1 316 MOV DPTR, #EP2OutBuffer ; Get the data from the endpoint's buffer
1272 E0 =1 317 MOVX A, @DPTR
1273 F551 =1 318 MOV LEDValue, A ; Update the local variable
=1 319 ;Write any value to Endpoint 2's OUT ByteCount register
=1 320 ;to enable receiving new data at Endpoint 2.
1275 907FC9 =1 321 MOV DPTR, #OUT2ByteCount ; Store the address of EP2 Out's ByteCount register
1278 F0 =1 322 MOVX @DPTR, A ; Write any value to the ByteCount register
A51 MACRO ASSEMBLER BAL 30/05/00 10:40:54 PAGE 6
1279 D0E0 =1 323 POP ACC
=1 324 ; POP DPH1 ; Uncomment if not using evaluation version
=1 325 ; POP DPL1
127B D083 =1 326 POP DPH
127D D082 =1 327 POP DPL
127F 32 =1 328 RETI
=1 329 ;*Jan's code ends
=1 330
1280 =1 331 SOF_ISR: ; A Start-Of-Frame packet has been received
=1 332 ; CALL ServiceTimerRoutine
=1 333 ; This routine services the real time interrupt
=1 334 ; It is also responsible for the "real world" buttons and lights
=1 335 ;
1280 =1 336 ServiceTimerRoutine:
1280 D55210 =1 337 DJNZ Msec_counter, Done ; Only need to check every 4msec
1283 755204 =1 338 MOV Msec_counter, #4 ; Reinitialize
=1 339 ; LED task
1286 E551 =1 340 MOV A, LEDValue
1288 907F97 =1 341 MOV DPTR, #PortB_Out
128B F0 =1 342 MOVX @DPTR, A ; Update the real world
=1 343 ;
=1 344 ; Create an Input Report from the Buttons value
=1 345 ; This will be continually overwritten while the PCHost is not polling for data
128C =1 346 ReadButtons:
128C 907F99 =1 347 MOV DPTR, #PortA_Pins
128F E0 =1 348 MOVX A, @DPTR
1290 12139B =1 349 CALL CreateInputReport
1293 5130 =1 350 Done: CALL ClearINT2
=1 351 ; Clear the source of the interrupt
1295 7402 =1 352 MOV A, #00000010b
1297 907FAB =1 353 ExitISR:MOV DPTR, #USBIRQ
129A F0 =1 354 MOVX @DPTR, A
129B 32 =1 355 RETI
=1 356
129C =1 357 SUDAV_ISR: ; A Setup packet has been received
129C 754600 =1 358 MOV SaveLength, #0 ; Clear any pending transactions (if any)
129F 907FE8 =1 359 MOV DPTR, #SETUPDAT ; Copy packet to direct access memory
12A2 7847 =1 360 MOV R0, #SetupData
12A4 7F08 =1 361 MOV R7, #8
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -