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

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

?? nios2_germs_monitor.s

?? 一款基于FPGA的對于VGA實現全彩控制的程序
?? S
?? 第 1 頁 / 共 3 頁
字號:
# Contents: Nios II monitor, (modified from nios_germs_monitor.s)
#           this one with S-Record, I-Hex
#           records, and Flash Programming
#           for the Nios development board.
# 
# ex:tabstop=4:
# ex:shiftwidth=4:
# ex:expandtab:
#
# +-------------------------------------------
# | A Note About Caching
# |
# | To eliminate issues with caching, this Germs
# | monitor uses the following strategy:
# |
# |   1. Init the i- and d-caches at startup.
# |      So the caches are EMPTY when we begin.
# |   2. Use only IO reads and writes.
# |      So the d-cache stays empty, and the
# |      i-cache contains only parts of
# |      Germs itself.
# |
# | therefore
# |
# |   3. When you execute a G (go) command,
# |      or the s-record equivalent, there
# |      CANNOT be any stale i-cache data
# |      associated with that address. Only
# |      parts of Germs itself will be found
# |      in the i-cache.
# |
# | dvb2004.04.02
# +--------------------------------------------
#
# GermsMon is build-time configurable to
# support various Nios configurations.
# The following variables control
# how it's built:
#
#   GM_UARTBase -- base of the uart for output, presumed
#                  to be Nios compatible registers
# 
#   GM_FlashBase,
#   GM_FlashTop --
#           The flash to support, unless FlashTop is zero,
#           which means "no flash". The flash is presumed
#           to be AMD 29LV800, as on the Nios reference design.
#           Other AMD flashes might be compatible.
# 
#   GM_Flash --
#           The address in flash to check for the Nios 2
#           signature "N2". The boot loader generated by
#           nios2-srec2flash contains the signature at
#           offset 4.
#           If the signature is found, execution
#           is transferred to GM_Flash. If
#           GM_Flash is zero, the feature is disabled.
#   GM_PIO --
#           The pio to check bit zero of before executing
#           from flash.
#
#   GM_VectorTable --
#           Interrupt vector table base
#   
# To set a variable, include the directive 
#
#   --defsym GM_whatever=value
#
# on the assembler's command line. With nios-build, include
# the directive
#
#   -as "--defsym GM_whatever=value"
#
#

    .include "excalibur.s"

    .ifndef GM_UARTBase
     .ifdef nasys_printf_uart
      .equ GM_UARTBase,nasys_printf_uart
     .else
      #
      # If there's no UART defined, we'll compile
      # as IF the uart address is 0x0000.
      # This, of course, won't be a functioning
      # monitor, but, hey, there's no UART. What
      # were you expecting?
      # At least it puts some bytes in your
      # ROM, and you can see what code looks like.
      #
      #.equ GM_UARTBase,0
      # !!!
      # The above comment is obsolete, but is preserved here
      # for future generations to look upon, and marvel.
      # See the bottom of this file for the code that's generated
      # when no UART exists.
      # !!!
     .endif
    .endif

    .ifndef GM_FlashBase
     .ifdef nasys_main_flash
      .equ GM_FlashBase,nasys_main_flash
     .endif
    .endif

    .ifdef GM_FlashBase

     .ifndef GM_FlashTop
      .ifdef nasys_main_flash_end
       .equ GM_FlashTop,nasys_main_flash_end
      .else
       .equ GM_FlashTop,GM_FlashBase+0x100000
      .endif
     .endif

     .ifndef GM_Flash
      .equ GM_Flash,GM_FlashBase+0x40000
     .endif

    .endif

    .ifndef GM_StackTop
     .equ GM_StackTop,nasys_stack_top
    .endif

    .ifndef GM_VectorTable
     .equ GM_VectorTable,nasys_vector_table
    .endif

    .ifndef GM_PIO
     .ifdef na_button_pio
      .equ GM_PIO,na_button_pio
     .endif
    .endif

    .ifndef GM_WIDTHS
     .equ GM_WIDTHS,1
    .endif

# Constants used by nj germs monitor

    .equ CR,13              # carriage return
    .equ WORD, 4            # default word size, for 32-bit NJ, 4 bytes in a word
    .equ LOW_NIBBLE_MASK, 0x00000000f   # to mask out low nibble of a word
    #.equ ADDR_MASK, 0xFFFFFFFC         # for masking out low two bits of addresses
    .equ ADDR_LOBITS,2          # how many low bits to zap for rounding

# Useful Macros!
#
# A simple macro to branch if register bit is 0
#
    .macro BR0  rB, rA, bit, dest
        ANDI    \rB, \rA, (1<<\bit)
        BEQ     r0, \rB, \dest
    .endm

# +----------------------------
# | _CLRLOBITS reg,bits

    .macro  _CLRLOBITS _dst,_src,_bits
    SRLI    \_dst,\_src,\_bits
    SLLI    \_dst,\_dst,\_bits
    .endm

#--------------------------------------------------
#
# A simple macro to branch if register bit is 1
    .macro BR1  rB, rA, bit, dest
        ANDI    \rB, \rA, (1<<\bit)
        BNE     r0, \rB, \dest
    .endm

# Mostly, this is one big goto-tangle.
#
# No RAM used
#
# LOW_NIBBLE_MASK   : the value 0x0000000F
#
# Global Register Usage:
#
# r3                : number of bytes read by getHex routine
# r8                : UART Base Address
# r9                : return address temp for flash routines
# r11               : residual byte for writing to Flash in words
# rl2               : Upper bytes (or segment) for I-Hex records
# r13               : Force-to address for S-Records/I-Hex records
# r14               : Address to read next from <CR>
#                     This gets set by an R command
# r15,r16           : Any routine's scratch
# r17,r18           : Any routine's scratch
# r19               : record type for S-record
# r20               : record length in bytes for S-record
# r21               : address we're reading bytes into for S-record
#
# r22               : How many words to display on CR
# r23               : stashed return address
#
# r24               : stashed value-end during doMWrite
#
#
#
#
# --------------
#
#
# -------------------------------
# Commands:
# G<address>               Go at address
# E<address>               Erase flash at address
# R<address>-<address>     Relocate S-Records from-to
# M<address>               Display at address
# M<address>-<address>     Display range
# M<address>:val val...    Write at address
# M<address>-<address>:val Fill range with val
# S...                     S-record, no error checking
# :...                     Intel-Hex record, no error checking



.text

GFUNC _start

# +------------------------------------------------------
# | Cache flushing code
# |
# | Initialize caches if present.
# | All contents will be cleared without writing back dirty data to memory.
# | This is required since the caches start from an unknown state on reset.

.if nasys_has_icache
_start_icache_init:
    mov     r4, r0
    MOVIK32 r5, nasys_icache_size
_start_icache_loop:
    # This looped is unrolled by a factor of 2 to speed it up.
    # Further unrolling is not done because the end of the loop won't
    # fit in one icache line.
    initi   r4
    addi    r4, r4, nasys_icache_line_size
    initi   r4
    addi    r4, r4, nasys_icache_line_size
    bltu    r4, r5, _start_icache_loop
    flushp
.endif

.if nasys_has_dcache
_start_dcache_init:
    mov     r4, r0
    MOVIK32 r5, nasys_dcache_size
_start_dcache_loop:
    # This looped is unrolled by a factor of 8 to speed it up.
    # Further unrolling could be done as desired.
    initd   0*nasys_dcache_line_size(r4)
    initd   1*nasys_dcache_line_size(r4)
    initd   2*nasys_dcache_line_size(r4)
    initd   3*nasys_dcache_line_size(r4)
    initd   4*nasys_dcache_line_size(r4)
    initd   5*nasys_dcache_line_size(r4)
    initd   6*nasys_dcache_line_size(r4)
    initd   7*nasys_dcache_line_size(r4)
    addi    r4, r4, nasys_dcache_line_size * 8
    bltu    r4, r5, _start_dcache_loop
.endif
    

# | the caches are now flushed
# |
# +--------------------------------------------------


_start_post_cache_flush:

    WRCTL   status, r0       # Disabling interrupts

.ifdef GM_UARTBase

    # (previous germs monitors cleared the vector table
    # here, but it's more useful to be able to still
    # see it after you finish. Also, every byte is
    # precious, to keep it under 1k bytes! so its gone.)

    #
    # Reset UART, SwitchPIO, and Timers
    #
    MOVIK32 r8, GM_UARTBase
    STWIO   r0, WORD*np_uartcontrol(r8)           # control all 0's: no irq's

    .ifdef GM_PIO
    MOVIK32 r16, GM_PIO
    STWIO   r0, WORD*np_piointerruptmask(r16)
    .endif

    #
    # set the stack pointer
    #
    .ifdef GM_StackTop
    MOVIK32  sp, GM_StackTop
    .endif

    #
    # Look for Signature in flash, & jump there.
    #   
    .ifdef GM_PIO
    LDWIO   r15, WORD*np_piodata(r16)       # Unless the button is pressed
    BR0     r16, r15, 0, postFlash_start
    .endif

    .ifdef GM_FlashTop
    MOVIK32 r16, GM_Flash
    LDHIO   r15, 4(r16)
    CMPNEI  r15, r15, 'N'+(256*'2')
    BNE     r0, r15, postFlash_start

    CALLR   r16        # (if it wants to return, no problem!)
    .endif

GFUNC postFlash_start

        ##  We end up here upon exit of a user-program run with the 'G'
        ##  command.  User-programs can do -anything-, including exitng
        ##  with interrupts left running.  This is inconvenient when
        ##  using the monitor.  Disable CPU interrupts as a defensive measure.
        
    WRCTL   status, r0
    
    #
    # Registers which need certain
    # values for the rest of the monitor
    # to work.
    # (Other registers are used as
    # needed, although their reservations
    # for certain uses must be respected
    # while running.)

    MOVIK32  r8, GM_UARTBase

    CALL    PutHash
    
    MOV     r12, r0
    MOV     r13, r0
    MOV     r14, r0                         # address to show on <CR>
    MOVUI   r22, 16                         # words to show on <CR>

    .ifndef __timeStamp__
        .equ __timeStamp__,0
    .endif

    MOVIK32  r5, __timeStamp__
    CALL    PutHex

    # RDCTL   r5, cpuid     # uncomment once cpu id control register is defined
    MOVIK32  r5, 0x12171981  # for now put this, guess who's b-day?
    CALL    PutHex
    MOVUI    r4, CR
    CALL    PutChar
    
    # 
    # Print the system name GM_SystemName, if defined
    #

    MOVI32   r21, systemNameString

printSystemNameLoop:
    LDBIO   r4, 0(r21)
    BEQ     r0, r4, donePrintSystemNameLoop
    CALL    PutChar
    ADDI    r21, r21, 1
    BR      printSystemNameLoop

donePrintSystemNameLoop:

    # |
    # | print address of monitor
    # |
    MOVUI   r4, ' '
    CALL    PutChar
    MOVUI   r4, '@'
    CALL    PutChar
    MOVUI   r4, ' '
    CALL    PutChar
    MOVI32  r5,_start
    CALL    PutHex

    MOVUI   r4, CR
    CALL    PutChar

ReceiveCommand:
    MOVUI   r4, '+'
    CALL    PutChar

    CALL    GetChar

    CMPGEUI r15, r4, 0x0060                 # character from [60,7f]
    BEQ     r0, r15, RespondToInput

LowercaseChar:
    ANDI    r4, r4, 0xffdf
    #BR     RespondToInput

RespondToInput:
    ADDI    r4, r4, -CR
    BEQ     r0, r4, doCR

    ADDI    r4, r4, CR-'#'                  # '#' (hash) is for comments: ignore to EOL
    BEQ     r0, r4, happyWaitForEOL

    ADDI    r4, r4, '#'-':' 
    BEQ     r0, r4, doColon

    ADDI    r4, r4, ':'-'E'
    BEQ     r0, r4, doE

    ADDI    r4, r4, 'E'-'G'
    BEQ     r0, r4, doG

    ADDI    r4, r4, 'G'-'M'
    BEQ     r0, r4, doM
    
    ADDI    r4, r4, 'M'-'R'
    BEQ     r0, r4, doR

    ADDI    r4, r4, 'R'-'S'
    BEQ     r0, r4, doS

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
eeuss鲁片一区二区三区在线看| 日本欧美一区二区三区| 国产精品99精品久久免费| 精品三级在线观看| 狠狠色丁香久久婷婷综| 亚洲精品在线免费播放| 国产成人精品影视| 国产精品热久久久久夜色精品三区| 国产精品一区二区在线播放| 欧美激情中文不卡| 99久久精品免费看国产| 一区二区激情小说| 日韩欧美成人午夜| 国产91露脸合集magnet| 亚洲欧美激情在线| 欧美一区国产二区| 国产91高潮流白浆在线麻豆 | 制服丝袜亚洲网站| 韩国精品在线观看| 一区二区三区欧美视频| 91精品国产色综合久久不卡电影 | 国产高清成人在线| 亚洲天堂av一区| 91网上在线视频| 日本最新不卡在线| 国产精品久久久久久户外露出| 在线观看国产一区二区| 蜜桃av噜噜一区| 国产精品美女视频| 51久久夜色精品国产麻豆| 国产精品亚洲专一区二区三区| 国产精品国产三级国产aⅴ入口| 精品污污网站免费看| 国产精品77777竹菊影视小说| 亚洲美女屁股眼交| 精品福利一区二区三区 | 韩国av一区二区三区四区| 国产精品电影院| 欧美一区二区网站| 99久久婷婷国产综合精品| 婷婷综合久久一区二区三区| 国产精品久久久久久一区二区三区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 日韩成人一区二区三区在线观看| 1区2区3区欧美| 欧美mv日韩mv| 欧美日韩国产免费一区二区| 成人免费的视频| 久久99热99| 亚洲第一成人在线| 18涩涩午夜精品.www| 久久精品一级爱片| 91麻豆精品国产91久久久使用方法| 波多野结衣中文一区| 国产一二三精品| 日韩—二三区免费观看av| 伊人婷婷欧美激情| 国产精品三级av在线播放| 日韩免费福利电影在线观看| 欧美色中文字幕| 色偷偷一区二区三区| 从欧美一区二区三区| 九九国产精品视频| 麻豆精品一二三| 天堂va蜜桃一区二区三区| 又紧又大又爽精品一区二区| 中文字幕一区二区三区四区不卡| 久久久综合精品| 久久女同互慰一区二区三区| 欧美一级黄色片| 欧美一二三区在线观看| 欧美一区二视频| 欧美一区二区免费视频| 欧美精品v国产精品v日韩精品 | 99精品久久只有精品| 国产成人午夜视频| 国产剧情一区二区| 亚洲精品一线二线三线| 亚洲天天做日日做天天谢日日欢| 久久综合视频网| 精品久久久久久久久久久久久久久久久 | 国产馆精品极品| 国产成人福利片| 成人免费看黄yyy456| 99re热这里只有精品视频| 91色视频在线| 色哟哟日韩精品| 欧美视频中文字幕| 91精品国产福利| 欧美一区二区日韩一区二区| 欧美一级国产精品| 中文字幕在线不卡视频| 亚洲天堂av老司机| 性做久久久久久免费观看| 青青草视频一区| 国产乱色国产精品免费视频| 成人黄页毛片网站| 欧美亚洲丝袜传媒另类| 欧美一级片在线观看| 欧美tickling挠脚心丨vk| www国产亚洲精品久久麻豆| 久久精品男人的天堂| 日韩一区中文字幕| 日韩在线一区二区三区| 国产一区二区看久久| 99久久99久久久精品齐齐| 欧美日韩在线播放三区| 精品国内二区三区| 中文字幕一区二区不卡| 五月激情综合网| 国产成人小视频| 在线视频一区二区三区| 欧美精品一区二区在线观看| 综合久久久久久| 日韩高清在线电影| 成人app网站| 欧美一级在线免费| 国产精品高潮呻吟| 日本中文字幕不卡| 不卡的av中国片| 日韩一级欧美一级| 国产精品美女久久久久久久久久久| 亚洲一区影音先锋| 国产成人无遮挡在线视频| 欧美日韩一区二区在线观看 | 蜜桃视频第一区免费观看| 成人晚上爱看视频| 欧美日韩国产一区二区三区地区| www成人在线观看| 亚洲一区二区三区视频在线播放| 国精产品一区一区三区mba桃花| 日本乱码高清不卡字幕| 精品国产乱码久久久久久久久 | 天天综合色天天综合色h| 国产精品一级二级三级| 欧美一区二区三区视频在线观看| 亚洲欧美自拍偷拍| 狠狠色综合色综合网络| 欧美日韩激情一区二区| 综合电影一区二区三区| 韩国精品主播一区二区在线观看| 在线精品视频一区二区三四| 国产性色一区二区| 久久精品国内一区二区三区| 欧美午夜精品免费| 亚洲欧洲中文日韩久久av乱码| 国产精品亚洲一区二区三区妖精| 91麻豆精品久久久久蜜臀| 一区二区三区成人在线视频| 顶级嫩模精品视频在线看| 欧美一区二视频| 婷婷综合在线观看| 欧美艳星brazzers| 亚洲视频小说图片| 99综合电影在线视频| 欧美国产精品劲爆| 国产激情视频一区二区在线观看| 日韩免费看的电影| 久久不见久久见中文字幕免费| 91精品国产全国免费观看| 成人av网址在线| 久久综合狠狠综合久久综合88| 日日欢夜夜爽一区| 欧美一区二区三区在线观看| 亚洲成人免费av| 欧美日韩成人综合| 亚洲国产aⅴ成人精品无吗| 91福利视频网站| 亚洲专区一二三| 色哟哟在线观看一区二区三区| 亚洲色图一区二区三区| 成年人国产精品| 亚洲视频1区2区| 色婷婷av久久久久久久| 国产精品久久久久久久浪潮网站 | 精品日韩一区二区| 国产一区二区三区不卡在线观看| 久久亚洲综合av| 国产成人精品亚洲午夜麻豆| 国产精品视频观看| 色综合天天综合狠狠| 亚洲一区二区欧美日韩| 91精品在线免费观看| 久久91精品国产91久久小草| 久久精品综合网| 91在线播放网址| 亚洲伊人色欲综合网| 日韩一区二区影院| 国产精品456露脸| 国产精品白丝在线| 欧美亚洲综合另类| 激情丁香综合五月| 国产精品久久久久9999吃药| 欧美亚洲国产怡红院影院| 免费观看成人av| 国产精品欧美经典| 欧美日韩国产另类不卡| 国内精品久久久久影院色| 亚洲人吸女人奶水| 欧美一区二区三区人|