?? led.asm
字號:
//input - value to write to LED's is passed in via R4
//output - none - writes lower 8 bits of R4 out to LED latch
#include <def21262.h>
#include <asm_sprt.h>
.section/pm seg_pmco;
.extern _LED_value;
.global _latchLEDs;
.extern _PP_avail;
_latchLEDs:
r0=dm(PPCTL);
r1=PPBS; //wait for external bus to complete the transfer.
r0=r0 AND r1;
if ne jump(pc,-3); //if not zero, bus transaction is incomplete, wait.
//ready PP to TX one word to _LED latch via DMA
ustat3=PPTRAN|PPBHC|PPDUR20; //disable PP to change parameters
dm(PPCTL)=ustat3;
nop;
dm(_LED_value)=r4;
ustat3=_LED_value; dm(IIPP)=ustat3; nop;
ustat3=0; dm(IMPP)=ustat3; nop;
ustat3=1; dm(ICPP)=ustat3; nop;
ustat3=0; dm(EMPP)=ustat3; nop;
//address that maps to _LED latch = 0x1400000
ustat3=0x01400000; dm(EIPP)=ustat3; nop;
ustat3=1; dm(ECPP)=ustat3; nop;
//initiate DMA
ustat3=PPTRAN|PPBHC|PPDUR20|PPEN|PPDEN;; //disable PP to change parameters
dm(PPCTL)=ustat3;
nop;
r0=dm(PPCTL);
r1=PPBS; //wait for external bus to complete the transfer.
r0=r0 AND r1;
if ne jump(pc,-3); //if not zero, bus transaction is incomplete, wait.
lcntr=20, do (pc,_loop_end) until lce;
_loop_end: nop;
dm(PPCTL)=r0; //when zero, disable parallel port
nop;
nop;
leaf_exit;
_latchLEDs.end:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -