?? peripheral_test_memory_asm.s
字號:
; file: peripheral_test_memory_asm.s
.include "excalibur.s"
.global DoRapidPeripheralWrites
.global Do1000STs
DoRapidPeripheralWrites:
SAVE %sp,-23
nm_println "This test executes a very series of instructions"
nm_println "consisting many many tiny UART transmit loops. It"
nm_println "polls the UART about as fast as possible."
nm_println "About to print 60 x 10 block of dots."
MOVIA %l0,na_uart1
MOVIP %l1,'.'
MOVIP %l2,13
.macro emitChar regWithChar
emitCharLoop\@:
PFXIO 0
LDP %l3,[%l0,np_uartstatus]
IF0 %l3,6
BR emitCharLoop\@
NOP
STP [%l0,np_uarttxdata],\regWithChar
.endm
.macro emit10Dots
emitChar %l1
emitChar %l1
emitChar %l1
emitChar %l1
emitChar %l1
emitChar %l1
emitChar %l1
emitChar %l1
emitChar %l1
emitChar %l1
.endm
.macro emit60DotsAndCR
emit10Dots
emit10Dots
emit10Dots
emit10Dots
emit10Dots
emit10Dots
emitChar %l2
.endm
emit60DotsAndCR
emit60DotsAndCR
emit60DotsAndCR
emit60DotsAndCR
emit60DotsAndCR
emit60DotsAndCR
emit60DotsAndCR
emit60DotsAndCR
emit60DotsAndCR
emit60DotsAndCR
nm_println "How does that look?"
RESTRET
Do1000STs:
;
; Use macros to include 1000 ST's.
;
.macro ST10 r1,r2
ST [%r1],%r2
ST [%r1],%r2
ST [%r1],%r2
ST [%r1],%r2
ST [%r1],%r2
ST [%r1],%r2
ST [%r1],%r2
ST [%r1],%r2
ST [%r1],%r2
ST [%r1],%r2
.endm
.macro ST100 r1,r2
ST10 \r1,\r2
ST10 \r1,\r2
ST10 \r1,\r2
ST10 \r1,\r2
ST10 \r1,\r2
ST10 \r1,\r2
ST10 \r1,\r2
ST10 \r1,\r2
ST10 \r1,\r2
ST10 \r1,\r2
.endm
.macro ST1000 r1,r2
ST100 \r1,\r2
ST100 \r1,\r2
ST100 \r1,\r2
ST100 \r1,\r2
ST100 \r1,\r2
ST100 \r1,\r2
ST100 \r1,\r2
ST100 \r1,\r2
ST100 \r1,\r2
ST100 \r1,\r2
.endm
PFX %hi(0x60000)
MOVI %g4,%lo(0x60000)
PFX %xhi(0x60000)
MOVI %g4,%xlo(0x60000)
LD %g5,[%g4] ; ensure we're not actually changing memory
ST1000 %g4,%g5
;ST10 %g4,%g5
JMP %o7
NOP
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -