为什么使用 staa 的 M68HC12 上的内存区域 $1020 不可写入?

发布于 2024-07-15 02:21:42 字数 963 浏览 8 评论 0原文

我有以下 asm 代码:

    org $1000             ;Table Origin is at $1000
fcb $02,$04,$06,$08   ; values of table from $1001 - $1004
fcb $0a,$0c,$0e,$10   ; values of table from $1005 - $1009


        org $400          ; Program Start
        lds #$4000        ; Set Stack Pointer at value (#) $4000
        ldy #$1000        ; Set Index Y at $1000
        ldaa #$04         ; Load Accumulator a with value $04
loop    staa $20,y        ; Store value of Accumulator a at y = $1000 {DOESNT WORK} 
        staa $21,y        ; Store value of Accumulator a at y = $1021 {DOESNT WORK}
        iny               ; increment y (at this point $1020 and $1021 are still ff)
        iny               ; increment y (at this point $1020 and $1021 are still ff)
        deca              ; decrement a
        bne loop          ; loop until a = 0
hold    bra hold          ; end of program
        end

​​ 表已正确设置,但 staa 在 1020 上未写入任何内容。 为什么?

I have the following asm code:

    org $1000             ;Table Origin is at $1000
fcb $02,$04,$06,$08   ; values of table from $1001 - $1004
fcb $0a,$0c,$0e,$10   ; values of table from $1005 - $1009


        org $400          ; Program Start
        lds #$4000        ; Set Stack Pointer at value (#) $4000
        ldy #$1000        ; Set Index Y at $1000
        ldaa #$04         ; Load Accumulator a with value $04
loop    staa $20,y        ; Store value of Accumulator a at y = $1000 {DOESNT WORK} 
        staa $21,y        ; Store value of Accumulator a at y = $1021 {DOESNT WORK}
        iny               ; increment y (at this point $1020 and $1021 are still ff)
        iny               ; increment y (at this point $1020 and $1021 are still ff)
        deca              ; decrement a
        bne loop          ; loop until a = 0
hold    bra hold          ; end of program
        end

The table is set properly but the staa writes nothing at 1020 on. Why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人疚 2024-07-22 02:21:42

我相信那里有ROM

10.3 ROM阵列

ROM 由从 $1000 映射到 $7FFF 的 28K 字节数组组成,
复位时从 $8000 映射到 $FFFF 的 32 K 字节数组。 这
MISC 寄存器中的 MAPROM 位允许交换两个阵列。
ROMON28和ROMON32启用或禁用ROM模块

从 M68HC12 数据表

I believe there is ROM there

10.3 ROM Array

The ROM is made of a 28K byte array mapped from $1000 to $7FFF and
of a 32 K byte array mapped from $8000 to $FFFF at reset. The
MAPROM bit in the MISC register allows the swapping of the two arrays.
ROMON28 and ROMON32 enable or disable the ROM module

From the M68HC12 datasheet

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文