fanyz 发表于 2008-9-5 09:25:17

有介绍问号部分内容的汇编资料吗?

有介绍问号部分内容的汇编资料吗?

;===============================================================================
;
;        Vector table
;
;===============================================================================
XVCT        CSEG        AT        0000H                                     ??????????????????????????????????????????
        DW        RESET_START                ;(00)        RESET
        DW        RESET_START                ;(02)        --
        DW        RESET_START                ;(04)        --
        DW        RESET_START                ;(06)        INTLVI
        DW        RESET_START                ;(08)        INTP0
        DW        RESET_START                ;(0A)        INTP1
        DW        RESET_START                ;(0C)        INTTMH1
        DW        RESET_START                ;(0E)        INTTM000
        DW        RESET_START                ;(10)        INTTM010
        DW        RESET_START                ;(12)        INTAD
        DW        RESET_START                ;(14)        --
        DW        RESET_START                ;(16)        INTP2
        DW        RESET_START                ;(18)        INTP3
        DW        RESET_START                ;(1A)        INTTM80
        DW        RESET_START                ;(1C)        INTSRE6
        DW        RESET_START                ;(1E)        INTSR6
        DW        RESET_START                ;(20)        INTST6

;===============================================================================
;
;        Define the ROM data table
;
;===============================================================================
XTBL1        CSEG        AT        0100H                                       ???????????????????????????????????????????????
LEDDATA:
        DB        00000011B                ;00: SW1=ON, SW2=ON-> LED3=ON
        DB        00000101B                ;01: SW1=OFF,SW2=ON-> LED2=ON
        DB        00000111B                ;02: Dummy
        DB        00000111B                ;03: Dummy
        DB        00000111B                ;04: Dummy
        DB        00000111B                ;05: Dummy
        DB        00000111B                ;06: Dummy
        DB        00000111B                ;07: Dummy
        DB        00000110B                ;08: SW1=ON, SW2=OFF -> LED1=ON
        DB        00000111B                ;09: SW1=OFF,SW2=OFF -> LED1,2,3=OFF

;===============================================================================
;
;        Define the memory stack area
;
;===============================================================================
XSTK        DSEG        AT        0FEE0H                                     ???????????????????????????????
STACKEND:
        DS        20H                        ; Memory stack area = 32byte
STACKTOP:                                ; Start address of the memory stack area = FF00H


;*******************************************************************************
;
;        Initialization after RESET
;
;*******************************************************************************
XMAIN        CSEG        UNIT
RESET_START:

;-------------------------------------------------------------------------------
;        Initialize the stack pointer
;-------------------------------------------------------------------------------
        MOVW        AX,        #STACKTOP                                          ?????????????????????????????????????????
        MOVW        SP,        AX                ; Set the stack pointer at FF00H

;-------------------------------------------------------------------------------
;        Initialize the watchdog timer
;-------------------------------------------------------------------------------
        MOV        WDTM,        #01110111B        ; Stop the watchdog timer operation

;-------------------------------------------------------------------------------
;        Initialize the clock generators
;-------------------------------------------------------------------------------
        MOV        PPCC,        #00000010B        ; The clock supplied to the peripheral hardware (fxp) = fx/4 (= 2MHz)
        MOV        PCC,        #00000000B        ; The clock supplied to the CPU (fcpu) = fxp (= 2MHz)
        MOV        LSRCM,        #00000001B        ; Stop the low-speed internal oscillator

;-------------------------------------------------------------------------------


自己写程序如何写???????????????

jiangjx 发表于 2008-9-5 11:06:35

看数据手册,都有提到汇编指令

个人认为,只要看懂即可

RENESAS-etouch 发表于 2008-9-5 13:13:33

XVCT      CSEG      AT      0000H      
这是定义程序写的地址

   MOVW      AX,      #STACKTOP   
设置堆栈,可能在其他文件定义了STACKTOP 的值

所以单片机的汇编格式都差不多的

newbie_sz 发表于 2008-9-7 11:58:03

STACKTOP 不就是上面定义了的栈地址吗? 栈深度 20H,向下减少

RENESAS-etouch 发表于 2008-9-7 20:25:12

是的,
根据他的函数 STACKTOP的值是FE20H
页: [1]
查看完整版本: 有介绍问号部分内容的汇编资料吗?