首页 > 解决方案 > proteus 错误:PC=0x0118 处的操作码 0x000D 无效

问题描述

我写了这段代码,Bascom但是当我运行并单击键盘时,Proteus我看到了这个错误:

Invalid opcode 0x000D at PC=0x0118

这是我的代码Bascom

$regfile = "m16def.dat"
$crystal = 1000000
Config Kbd = Portd , Debounce = 30
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , Rs = Portb.3 , E = Portb.2
Dim Adad As Byte
Dim Andis As Byte
Dim Lable As Byte

Scan1:
Waitms 200
Adad = 0
Andis = Getkbd()
If Andis > 15 Then Goto Scan1

Lable = Lookup(andis , Dta)
If Lable < 10 Then
Adad = Adad * 10
Adad = Adad + Lable
Lcd Adad
End If

Dta:
Data 7 , 8 , 9 , 10 , 4 , 5 , 6 , 11 , 1 , 2 , 3 , 12 , 13 , 0 , 14 , 15

这是我的proteus模拟simple calculation在此处输入图像描述

当我点击键盘时,我看到了这个: 在此处输入图像描述

我不知道那里发生了什么。任何帮助,将不胜感激。

标签: microcontrolleravrcodevisionavr

解决方案


可能是 .include 一开始我在使用 atmega328p 在同一程序(proteus)上进行汇编 avr 编程时遇到了这个问题。我忘了把 inculde 放在第一个,我有一个 proteus 的演示版本(每次你再次启动应用程序时都需要以管理员身份运行)。试试这个,让我知道它有效。


推荐阅读