source1.uc

来自「Intel IXP1200开发指南. 包含IXP1200网络处理器PPT演示与」· UC 代码 · 共 21 行

UC
21
字号
;Reference Instructions
;TA
;sram (push-pop operation)
;Microengine 0  run this code.
immed[base,1]
immed[head_offset,0]
sram [push,--,head_offset,base,4];the pointer's linked-stack[4] elements[0] is 0x1
immed[head_offset,1]
sram [push,--,head_offset,base,4];the pointer's linked-stack[4] elements[1] is 0x2
immed[head_offset,2]
sram [push,--,head_offset,base,4];the pointer's linked-stack[4] elements[2] is 0x3
;
sram[pop,$xfer0,dummy,0,4];$xfer0:=0x3
;SHOULD BE sram[pop,$xfer0,--,--,4],the compiler maybe has BUG !!!sram[pop,$xfer1,dummy,0,4];$xfer1:=0x2
sram[pop,$xfer2,dummy,0,4];$xfer2:=0x1
sram[pop,$xfer3,dummy,0,4];NOTE:in case of the problem of stack exhaustion , the pointer of stack end should point to itself. 

self#:
br[self#]
//demo - Data Watch (Add Watch ,sram_push_pop)

⌨️ 快捷键说明

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