【问题标题】:PIC18F97J60 Increment FSR not affecting INDFPIC18F97J60 增加 FSR 不影响 INDF
【发布时间】:2020-01-29 04:57:59
【问题描述】:
    ; point FSR0 to address 0x0 and set INDF to 'A'
    movlw   0x0
    movwf   FSR0
    movlw   A'A'
    movwf   INDF0

    ; increment FSR0, then set new INDF to 'B'
    incf    FSR0
    movlw   A'B'
    movwf   INDF0

    ; decrement FSR0, then show the new INDF to LCD, it should show the letter 'A', but 'B' is shown.
    decf    FSR0
    movf    INDF0, 0
    call    LCD8SendData

为什么显示的是“B”而不是“A”?我已经递减了 FSR0 指针。

【问题讨论】:

  • 你有一个模拟器来单步执行你的代码吗?
  • 也许你的LCD8SendData 函数有错误。使用调试器来验证每条指令的结果。

标签: assembly microcontroller pic18


【解决方案1】:

我已经解决了问题,我没有设置FSR0的地址,因为我以为系统会设置它。我将FSR0的addr设置为0x9EF后,现在开始工作了,谢谢大家的帮助:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-02
    • 2018-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-17
    相关资源
    最近更新 更多