startupwithbios.s

来自「USB Host 资料」· S 代码 · 共 44 行

S
44
字号
; File: startup.s 

; Declare the main function. 

.global main

.section .text

.global _start

_start:
    ; Jump the main function. 
    ; jmp    main

;   Replace TMR0 ISR with tmr0_isr
    mov     [0], tmr0_isr
    
;   Enable TMR0 INT    
    or      [0xC00e], 0x0001

;   Replace IDLER ISR with main.  Now BIOS IDLE chain is only called in our TMR0 ISR.    
    mov     [(71*2)],main
    ret

;   int 70 enables the IDLE_INT.  This allows bios to execute periodically
;   since main never returns.  Now we can use debug USB port and UART.

tmr0_isr:                       ; TMR0 ISR, now calls BIOS IDLE
    push    [0xc000]            ; Push Flags Register
    int     73                  ; PUSHALL_INT
    int     70                  ; IDLE_INT (will check UART and USB for Scan signitures)
    int     74                  ; POPALL_INT
    
    mov     [0xc010], 10000     ; Load TMR0 so that it will expire every 10ms
    pop     [0xc000]            ; Pop Flags Register
    sti
    ret
    
; End of file: startup.s 




⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?