📄 de1_bios.asm
字号:
;****************************************************;* DE3 Standard handler for the Get_Report request.;****************************************************.nolist.list; Definitions.equ USB1_SOF_ISR_INT, 21.equ USB2_SOF_ISR_INT, 29.equ HW_SWAP_REG, 77.equ HW_REST_REG, 78.equ USB1_SOF_ISR_LOC, (USB1_SOF_ISR_INT*2).equ USB2_SOF_ISR_LOC, (USB2_SOF_ISR_INT*2).equ DEV1_STAT_REG, 0xc090.equ DEV2_STAT_REG, 0xc0b0.equ bmISR_SOF, 0x200.equ SUSB_SOF_MSG, 0x200.equ SUSB_SUS_MSG, 0x800; The two following lines are XROM specific ; locations, they are different for IROM..equ mbx_msg1, 0x404.equ mbx_msg2, 0x454.text; Dummy header for alignment.short 0xc3b6.short 4.byte 0.short 0xe000.short 0; Code header with entry.short 0xc3b6.short (code_end - code_start + 2).byte 0.short code_start ; Entry/storage.global code_startcode_start: jmp start; Local variables; Installerstart: cli mov [USB1_SOF_ISR_LOC], USB1_SOF_Isr mov [USB2_SOF_ISR_LOC], USB2_SOF_Isr sti ret; Our handlerUSB2_SOF_Isr: int HW_SWAP_REG mov r9, DEV2_STAT_REG ; SIE2 registers mov r10, mbx_msg2 jmp msfcUSB1_SOF_Isr: int HW_SWAP_REG mov r9, DEV1_STAT_REG ; SIE1 registers mov r10, mbx_msg1msfc: mov [r9++], bmISR_SOF ; clr int mov r0, [r9] subi r9, 6 ; 0xc08c or 0xc0ac and r0, 0xf000 test r0, 0x8000 ; check SOF time-out je sofse0: subi r9, 2 ; 0xc08a or 0xc0aa mov r1, [r9++] ; 0xc08c or 0xc0ac mov r2, r1 ; check for SE1 shr r2, 1 xor r1, r2 test r1, 0x1000 jne 0f and [r9], ~0x800 ; !SE1, reset timeout or [r9], 0x800 jmp exit0: cmp r0, 0xf000 jne exit and [r9], ~0x800 ; disable time-out mov [r10], SUSB_SUS_MSG ; send message to co-proc jmp exitsof: test [r9], 0x800 ; check time-out enable jnz exit mov [r10], SUSB_SOF_MSG ; set active flag or [r9], 0x800 ; enable time-outexit: int HW_REST_REG ; restore regs+sti+ret; End of handler codecode_end:.short 0xc3b6.short 2.byte 4.short code_start.byte 0 ; alignment.short 0 ; end scan
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -