亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? macros.s

?? 非常實在的Nios—μCOS_II源代碼
?? S
字號:
;********************************************************************************************************
;                                               NIOS Macros
;
;                                     GNU ASSEMBLER nios-elf-as.exe
;
; File         : macros.s
; By           : Farid LEZIAR    (fleziar@yahoo.fr)
; Version      : 2.0
;
;    This port is free. you can use it, redistribute it
;    and/or modify it under the following terms:
;
;    1. You are not allowed to remove or modify this copyright notice
;       and License paragraphs, even if parts of the software is used.
;    2. The improvements and/or extentions you make must be available
;       for the community under THIS license, source code included.
;    4. You may NOT distribute this software under another license without
;       explicit permission from farid LEZIAR (fleziar@yahoo.fr).
;    5. This software is free, and distributed in the hope that it will be
;       useful, but WITHOUT ANY WARRANTY.
;    6. Tou have you inform me whenever you use this software.
;
;********************************************************************************************************

; Direct Load 32bits value
.macro	MOVI32	reg,val
	PFX	%hi(\val)
	MOVI	\reg,%lo(\val)
	PFX	%xhi(\val)
	MOVHI	\reg,%xlo(\val)
.endm

; Direct Load 16bits value
.macro	MOVI16	reg,val
	 PFX	%hi(\val)
	 MOVI	\reg,%lo(\val)
.endm

; ADDI16 %reg,16-bit-value
.macro	ADDI16 reg,val
   PFX   %hi(\val)
   ADDI  \reg, %lo(\val)
.endm

; SUBI16 %reg,16-bit-value
.macro	SUBI16 reg,val
   PFX   %hi(\val)
   SUBI  \reg, %lo(\val)
.endm

; =========================================================================================
; ==  MACROS
; =========================================================================================

; Disable Interrupt
.macro   disable_interrupt
   PFX      8
   WRCTL    %g0
.endm

; Enable Interrupt
.macro   enable_interrupt
   PFX      9
   WRCTL    %g0
.endm


; decrement 32bits word aligned variable (alters %g0 and %g1 )
.macro   dec32 variable
   PFX	    %hi(\variable)
   MOVI	    %g0,%lo(\variable)
	 PFX	    %xhi(\variable)
	 MOVHI	  %g0,%xlo(\variable)
   LD       %g1, [%g0]
   SUBI     %g1, 1
   ST       [%g0], %g1
.endm

; decrement 16bits word aligned variable (alters %g0 and %g1 )
.macro   dec16 variable
   PFX	    %hi(\variable)
   MOVI	    %g0,%lo(\variable)
   LD       %g1, [%g0]
   SUBI     %g1, 1
   ST       [%g0], %g1
.endm

; increment 32bits word aligned variable (alters %g0 and %g1 )
.macro   inc32 variable
   PFX	    %hi(\variable)
   MOVI	    %g0,%lo(\variable)
   PFX	    %xhi(\variable)
   MOVHI    %g0,%xlo(\variable)
   LD       %g1, [%g0]
   ADDI     %g1, 1
   ST       [%g0], %g1
.endm

; increment 16bits word aligned variable (alters %g0 and %g1 )
.macro  inc16 variable
   PFX	    %hi(\variable)
   MOVI	    %g0,%lo(\variable)
   LD       %g1, [%g0]
   ADDI     %g1, 1
   ST       [%g0], %g1
.endm

; increment 8bit variable (alters %g0, %g1, %g2)
.macro  inc8 variable
  MOVI32    %g2, \variable              ; %g2 = &variable
  LD        %g1, [%g2]                  ; %g1 = variable
  EXT8D     %g1, %g2                    ; extract byte
  ADDI      %g1, 1                      ; %g1 ++
  FILL8     %r0, %g1                    ; %g0 = %g1 %g1 %g1 %g1
  ST8D      [%g2], %r0                  ; store %g1
.endm

; clear 32bits word aligned variable (alters %g0 and %g1 )
.macro   clr32 variable
   MOVI32   %g0, \variable
   MOVI32   %g1, 0
   ST       [%g0], %g0
.endm

; clear 16bits word aligned variable (alters %g0 and %g1 )
.macro   clr16 variable
   MOVI16   %g0, \variable
   MOVI16   %g1, 0
   ST       [%g0], %g0
.endm


; =========================================================================================
; ==  SAVING-LOADING REGISTERS MACROS
; =========================================================================================

; load GLOBAL registers from the stack
.macro  LDS_GR  index
  LDS       %g0, [%sp, \index+0]
  LDS       %g1, [%sp, \index+1]
  LDS       %g2, [%sp, \index+2]
  LDS       %g3, [%sp, \index+3]
  LDS       %g4, [%sp, \index+4]
  LDS       %g5, [%sp, \index+5]
  LDS       %g6, [%sp, \index+6]
  LDS       %g7, [%sp, \index+7]
.endm

; save GLOBAL registers on the stack
.macro  STS_GR  index
  STS       [%sp, \index+0], %g0
  STS       [%sp, \index+1], %g1
  STS       [%sp, \index+2], %g2
  STS       [%sp, \index+3], %g3
  STS       [%sp, \index+4], %g4
  STS       [%sp, \index+5], %g5
  STS       [%sp, \index+6], %g6
  STS       [%sp, \index+7], %g7
.endm


; save ISTATUS on the stack
.macro  STS_IS  index
  PFX       1
  RDCTL     %g0
  STS       [%sp, \index], %g0
.endm

; save IN registers on the stack
.macro  STS_IR  index
  STS       [%sp, \index+0], %i0
  STS       [%sp, \index+1], %i1
  STS       [%sp, \index+2], %i2
  STS       [%sp, \index+3], %i3
  STS       [%sp, \index+4], %i4
  STS       [%sp, \index+5], %i5
  STS       [%sp, \index+6], %i6
  STS       [%sp, \index+7], %i7
.endm

; load IN registers from the stack
.macro  LDS_IR  index
  LDS       %i0, [%sp, \index+0]
  LDS       %i1, [%sp, \index+1]
  LDS       %i2, [%sp, \index+2]
  LDS       %i3, [%sp, \index+3]
  LDS       %i4, [%sp, \index+4]
  LDS       %i5, [%sp, \index+5]
  LDS       %i6, [%sp, \index+6]
  LDS       %i7, [%sp, \index+7]
.endm


; save LOCAL registers on the stack
.macro  STS_LR  index
  STS       [%sp, \index+0], %L0
  STS       [%sp, \index+1], %L1
  STS       [%sp, \index+2], %L2
  STS       [%sp, \index+3], %L3
  STS       [%sp, \index+4], %L4
  STS       [%sp, \index+5], %L5
  STS       [%sp, \index+6], %L6
  STS       [%sp, \index+7], %L7
.endm

; load LOCAL registers from the stack
.macro  LDS_LR  index
  LDS       %L0, [%sp, \index+0]
  LDS       %L1, [%sp, \index+1]
  LDS       %L2, [%sp, \index+2]
  LDS       %L3, [%sp, \index+3]
  LDS       %L4, [%sp, \index+4]
  LDS       %L5, [%sp, \index+5]
  LDS       %L6, [%sp, \index+6]
  LDS       %L7, [%sp, \index+7]
.endm


; Increment CWP (virtual RESTORE instruction)
; in = %g0 = current STATUS
.macro INCCWP
   PFX   %hi(0x0010)
   ADDI  %g0, %lo(0x0010)     ; CWP++
   WRCTL %g0
   NOP
.endm

; Decrement CWP (virtual SAVE instruction)
; in = %g0 = current STATUS
.macro DECCWP
   PFX   %hi(0x0010)
   SUBI  %g0, %lo(0x0010)     ; CWP--
   WRCTL %g0
   NOP
.endm


; LOAD ISTATUS from the stack
.macro  LDS_IS  index
  LDS       %g0, [%sp, \index]
  PFX       1
  WRCTL     %g0
.endm



; =========================================================================================
; ==  CONTEXT MANAGEMENT MACRO
; =========================================================================================
; This macro saves to stack :
;   global registers, ISTATUS, return address and
;   all window registers above the current window.
; affects (%sp, CWP, %g0, %g1, %g2, %g6 and %g7)

.macro  SAVE_CONTEXT
  SUBI16    %fp, (24+10)*regwidth             ; space for savind %g, STATUS(Task) and interrupt %o7
  MOV       %sp, %fp
  ADDI16    %fp, (24+10)*regwidth

  STS_GR    24+0                              ; save global registers
  STS_IS    24+8                              ; save STATUS(Task) = ISTATUS
  STS       [%sp, 24+9], %o7                  ; save interrupt return address

; read current window
  RDCTL     %g1                               ; %g1 = STATUS(Interrupt) = XXXXXXX-CWP-XXXX
  RDCTL     %g0                               ; %g0 = STATUS(Interrupt)
  RDCTL     %g7                               ; %g7 = STATUS(Interrupt)
  LSRI      %g1, 4                            ; %g1 = XXXXXXXXXXX-CWP-
  PFX       %hi(0x001F)
  AND       %g1, %lo(0x001F)                  ; %g1 = 00000000000-CWP-
                                              ; %g1 = cwp(interrupt)
  ;ADDI      %g1, 1                            ; %g1 = cwp(Task)

; read HI_LIMIT from %ctl2
  PFX       2
  RDCTL     %g2                               ; %g2 = XXXXXXHHHHHLLLLL
  LSRI      %g2, 5                            ; %g2 = XXXXXXXXXXXHHHHH
  PFX       %hi(0x001F)
  AND       %g2, %lo(0x001F)                  ; %g2 = 00000000000HHHHH

; save all window registers
nextSW\@:
  SUBI16    %sp, 16*regwidth                  ; space for saving next %o and %L
  STS_IR    24+8                              ; save IN registers
  MOV       %g6, %sp
  INCCWP                                      ; CWP++
  ADDI      %g1, 1                            ; current cwp++
  MOV       %sp, %g6
  STS_LR    24+0                              ; save LOCAL registers

  CMP       %g1, %g2                          ; current cwp == HI_LIMIT ?
  SKPS      cc_z
  BR        nextSW\@                          ; no
  NOP

  SUBI16    %sp, 9*regwidth                   ; space for saving INreg(HILIMIT) and STATUS
  STS_IR    24+1                              ; save INreg(HILIMIT)
  STS       [%sp, 24+0], %g7                  ; save STATUS(Interrupt)
  
  ; now we are in cwp = HILIMIT
.endm






; This macro loads from stack :
;   global registers, ISTATUS, return address and
;   all window registers above the current window.
; and place cwp to interrupt window in order to execute
; a TRAP %o7 instruction.
; affects (%sp, CWP, %g0, %g1, %g2, %g6 and %g7)
.macro  LOAD_CONTEXT
; read last interrupt window from stack
  LDS       %g1, [%sp, 24+0]                  ; %g1 = STATUS = XXXXXXX-CWP-XXXX
  ;MOV       %g0, %g1                          ; %g0 = STATUS(interrupt)
  MOV       %g7, %g1                          ; %g7 = STATUS(interrupt)
  LSRI      %g1, 4                            ; %g1 = XXXXXXXXXXX-CWP-
  PFX       %hi(0x001F)
  AND       %g1, %lo(0x001F)                  ; %g1 = 00000000000-CWP-
                                              ; %g1 = cwp(interrupt)
  ;ADDI      %g1, 1                            ; %g1 = cwp(Task)

; read HI_LIMIT from %ctl2
  PFX       2
  RDCTL     %g2                               ; %g2 = XXXXXXHHHHHLLLLL
  LSRI      %g2, 5                            ; %g2 = XXXXXXXXXXXHHHHH
  PFX       %hi(0x001F)
  AND       %g2, %lo(0x001F)                  ; %g2 = 00000000000HHHHH

; set current window to HI_LIMIT
; and preserves %sp
  MOV       %g6, %sp                          ; save %sp
  MOV       %g0, %g2                          ; %g0 = 00000000000HHHHH
  LSLI      %g0, 4                            ; %g0 = 0000000HHHHH0000
  WRCTL     %g0                               ; change to HILIMIT (IPRI=0, IE=0, FLAG=0)
  NOP
  MOV       %sp, %g6                          ; restore %sp (delay slot)

  ADDI      %sp, 1*regwidth


; resore all window registers
nextLW\@:                                     ; next Load Window
  LDS_IR    24+0                              ; load IN registers
  LDS_LR    24+8                              ; Load LOCAL registers
  ADDI16    %sp, 16*regwidth
  MOV       %g6, %sp
  DECCWP                                      ; CWP-- (%g0 = current status)
  SUBI      %g2, 1                            ; current cwp--
  MOV       %sp, %g6
  LDS_IR    24+8                              ; Load IN registers

  CMP       %g1, %g2                          ; current cwp == cwp(interrupt) ?
  SKPS      cc_z
  BR        nextLW\@                          ; no
  NOP

  LDS_IR    24+0                              ; load IN registers (= OUT's Task)
  LDS_IS    24+16                              ; load STATUS(Task) = ISTATUS
  LDS       %o7, [%sp, 24+17]                  ; load interrupt return address
  LDS_GR    24+8                              ; load global registers

  ; restore valid %sp to the task
  MOV       %fp, %sp
  ADDI16    %fp, (24+18)*regwidth
.endm
  



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区视频导航| 亚洲色图.com| 久久精品欧美日韩| 一区二区三区在线免费播放 | 成人高清视频在线| 欧美久久一区二区| 中文字幕一区二区三区在线播放| 亚洲最色的网站| 大胆亚洲人体视频| 欧美一区二区啪啪| 亚洲福利一区二区三区| 成人免费毛片片v| 欧美va亚洲va| 午夜精品福利一区二区三区av| 成人一道本在线| 久久亚洲私人国产精品va媚药| 亚洲国产精品视频| 91丨九色丨尤物| 欧美经典一区二区| 久久99日本精品| 欧美精品丝袜中出| 亚洲在线中文字幕| 不卡一卡二卡三乱码免费网站| 精品动漫一区二区三区在线观看| 高清国产一区二区三区| 91精品国产免费久久综合| 亚洲一区二区三区在线| 91碰在线视频| 国产精品高潮呻吟久久| 国产精品香蕉一区二区三区| 精品福利一二区| 精品一区免费av| 欧美大片在线观看| 免费日韩伦理电影| 欧美一级淫片007| 天堂蜜桃一区二区三区| 欧美伊人精品成人久久综合97| 亚洲视频小说图片| 日本道精品一区二区三区| 中文字幕一区二区三区精华液 | 一区二区三区精品久久久| 成人福利视频在线| 最近日韩中文字幕| 色婷婷一区二区三区四区| 亚洲伦在线观看| 欧美性猛交xxxx黑人交| 午夜精品久久久久久不卡8050| 欧美日韩一区二区三区四区五区| 亚洲一区免费视频| 欧美一区二区三区精品| 极品美女销魂一区二区三区| 精品国产一区二区三区久久久蜜月 | 成人精品一区二区三区中文字幕| 蓝色福利精品导航| 久久综合久久久久88| 国产成人精品免费| 亚洲人xxxx| 欧美精品三级日韩久久| 久久99精品久久久久久国产越南| 久久久久久久久久久久电影| 成人一二三区视频| 亚洲精品ww久久久久久p站| 在线不卡中文字幕播放| 国产在线精品不卡| 自拍偷在线精品自拍偷无码专区| 欧美日韩黄色一区二区| 国产在线一区观看| 亚洲精品v日韩精品| 日韩一区二区高清| 成人毛片在线观看| 天天操天天色综合| 中文字幕精品一区二区精品绿巨人 | 在线观看国产精品网站| 免费观看91视频大全| 国产精品女同一区二区三区| 欧美色图天堂网| 国产成人高清在线| 在线观看国产一区二区| 久久成人免费网站| 亚洲一线二线三线久久久| www国产亚洲精品久久麻豆| 91九色02白丝porn| 国产一区二区三区电影在线观看| 亚洲精品免费在线| 久久网站最新地址| 欧美日韩精品免费| 91一区一区三区| 国产精品综合视频| 爽好久久久欧美精品| 中文字幕中文在线不卡住| 91精品国产色综合久久不卡蜜臀| 不卡一区二区三区四区| 久久成人免费电影| 奇米综合一区二区三区精品视频| 久久久久久影视| 日韩一区二区三区免费看| caoporm超碰国产精品| 日本不卡一区二区| 亚洲午夜久久久久久久久电影网 | 国产欧美一区二区三区在线看蜜臀 | 欧美一区二区三区成人| 91在线观看高清| 国产精品综合一区二区三区| 美日韩黄色大片| 香港成人在线视频| 亚洲一区精品在线| 一区二区三区影院| 亚洲欧美偷拍三级| 国产精品理伦片| 国产亚洲欧美在线| 亚洲精品一区二区在线观看| 制服丝袜中文字幕亚洲| 欧美日韩精品专区| 精品视频全国免费看| 欧美中文字幕亚洲一区二区va在线| 不卡一区在线观看| 99久久99久久精品免费观看| 成人精品高清在线| 久久这里只有精品6| 精品欧美乱码久久久久久| 日韩欧美黄色影院| 日韩精品自拍偷拍| 欧美成人女星排名| 亚洲精品在线观看视频| 国产亚洲综合在线| 国产精品毛片高清在线完整版 | 日韩视频免费观看高清完整版在线观看| 91国产福利在线| 欧美精品精品一区| 日韩一区二区不卡| 久久久久久久电影| 国产精品灌醉下药二区| 亚洲免费av高清| 亚洲高清在线精品| 久久精品国产免费| 成人99免费视频| 欧美系列亚洲系列| 日韩午夜小视频| 国产日韩精品久久久| 亚洲色图欧美在线| 日韩和欧美一区二区三区| 麻豆中文一区二区| 国产69精品久久99不卡| 日本高清不卡aⅴ免费网站| 91麻豆精品久久久久蜜臀| 久久品道一品道久久精品| 国产精品久久久久久久久久免费看| 一区二区三区四区不卡在线| 日本成人在线视频网站| 国产福利不卡视频| 欧美亚洲国产bt| 久久综合九色综合97婷婷| 亚洲人成影院在线观看| 久久精品国产99| 91丨九色丨尤物| 精品嫩草影院久久| 一区二区三区在线观看国产| 久久国产成人午夜av影院| 92国产精品观看| 日韩欧美第一区| 亚洲猫色日本管| 国产一区二区0| 欧美三级在线看| 中文在线资源观看网站视频免费不卡 | 国产欧美精品一区二区三区四区| 亚洲欧美日韩国产综合| 国产原创一区二区| 欧美日韩亚洲国产综合| 国产亚洲一本大道中文在线| 丝袜亚洲精品中文字幕一区| 成人午夜精品一区二区三区| 欧美电影一区二区三区| 综合网在线视频| 国产乱子伦视频一区二区三区| 欧美性色黄大片| 成人欧美一区二区三区白人| 看国产成人h片视频| 欧美日韩免费在线视频| 国产精品传媒视频| 国产一区二区在线电影| 91精品国产一区二区| 亚洲伊人伊色伊影伊综合网| 成人精品视频网站| 久久久久久夜精品精品免费| 视频一区二区三区中文字幕| 一本色道久久综合亚洲91| 国产亚洲欧美色| 久久不见久久见免费视频7| 欧美日韩国产高清一区二区三区 | 亚洲裸体xxx| 成人激情校园春色| 久久精品在这里| 精品一区二区三区日韩| 欧美一区二区三区免费观看视频| 亚洲高清免费一级二级三级| 91久久人澡人人添人人爽欧美| 最近日韩中文字幕| 色香蕉久久蜜桃| 亚洲精选免费视频| 色综合久久久久网|