微處理器 - Lattice GAL22V10 - Assembly - Timer0



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

AUXR


TMOD


TCON


Interrupt


main.s

    led set p1.2
 
    .org 0x00
    jmp start
 
    .org 0x0b
    jmp t0_handle
 
    .org 0x100
start:
    orl auxr, #80h
    mov tmod, #00h
    mov tl0, #00h
    mov th0, #00h
    setb tr0
    setb et0
    setb ea
    jmp $
 
t0_handle:
    djnz acc, finish
    cpl led
finish:
    reti
    .end

完成