微處理器 - Lattice GAL22V10 - Assembly - Timer2



參考資訊:
https://www.stcmicro.com/datasheet/STC15F204EA-cn.pdf
https://www.stcmicro.com/datasheet/STC15F2K60S2-en.pdf

AUXR


Interrupt


IE2


main.s

    led set p1.2
    t2l data 0d7h
    t2h data 0d6h
    ie2 data 0afh
 
    .org 0x00
    jmp start
 
    .org 0x63
    jmp t2_handle
 
    .org 0x100
start:
    orl auxr, #04h
    mov t2l, #00h
    mov t2h, #00h
    orl auxr, #10h
    orl ie2, #04h
    setb ea
    jmp $
 
t2_handle:
    djnz acc, finish
    cpl led
finish:
    reti
    .end

完成