This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
for this definition in my assembly file:
.word $round(MAX_SINE_AMP * $sin(2 * 3.141592 / 360))
"SineTable.asm", ERROR! at line 16: [E0201] Illegal floating-point expression
If I change $round() to $cvi() as below, it assembles. no problem. it works. why?
.word $round(MAX_SINE_AMP * $sin(2 * 3.141592 / 360))
Please submit a test case which can be built on its own. Details are in the last part of the forum welcome message.
Thanks and regards,
-George
The built-in function $round returns a floating-point value, not an integer. You need to use .float, not .word, or if you really want an integer, $cvi. The error message is unclear; I've entered defect report SDSCM00039510 to make the error message more clear.
.float $round(MAX_SINE_AMP * $sin(2 * 3.141592 / 360))
.word $cvi($round(MAX_SINE_AMP * $sin(2 * 3.141592 / 360)))
Thanks for the suggestion. It works. It is all natural to expect $round() to return a integer than a float.
sayee