68HC11计算sin(x)的汇编代码
68HC11 使用泰勒级数或查找表计算正弦值的汇编代码是什么?
显示值只能是整数。查找表如何工作 在这种情况下?如何使用泰勒级数来实现?
What would be the assembly code for 68HC11 to calculate value of sine using either Taylor series or a lookup table?
Display value will be only in integer. How would a lookup table work
in this case? How can it be implemented using Taylor series?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您正在寻找浮点解决方案,则需要首先实现浮点运算。这部分在 68HC11 上并不重要,因为它甚至不支持 32 位操作。之后,计算 sin 很容易,但速度很慢。 ;-)
使用查找表。
If you are looking for a floating point solution, you'll need to implement floating point operations first. That part will be non-trivial on a 68HC11 which has no support for even 32 bit operations. After that, calculating sin is easy but very slow. ;-)
Use a lookup table.
不要使用泰勒级数。
Google 发现了此。
Don't use Taylor series.
Google found this.
我已经很长时间没有做过任何 68HC11 编程了,所以我无法为您提供准确的说明,但您或多或少希望执行以下操作:
具体细节当然取决于输入和输出范围,但一般来说,您将使用索引寻址模式,索引寄存器指向表,或者使用扩展寻址,通过修改操作码设置偏移量。
I haven't done any 68HC11 programming in a long time, so I won't be able to give you exact instructions, but you want to do more-or-less the following:
Specifics would of course depend on input and output ranges, but generally speaking, you'll use indexed addressing mode, with the index register pointing into the table, or alternatively, extended addressing, with the offset set by modifying the opcode.