Re: [cc65] range errors

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-06-11 18:52:20


On Wed, Jun 11, 2003 at 06:43:44PM +0200, MagerValp wrote:
> How do I get rid of the range errors in the following code? Adding a
> .org $0801 before basicstub helps, but that doesn't seem right.

Without an .org statement, the assembler doesn't know the value of init, so it
assumes that the expression is word sized (while it is easy for a human to see
that the result is always in the range $30..$39, this is not as easy for a
dumb computer program). If you want a byte sized expression, just tell the
assembler:

       	.byte 	<(((init / 1000) .mod 10) + $30)
	.byte 	<(((init / 100 ) .mod 10) + $30)
	.byte 	<(((init / 10  ) .mod 10) + $30)
	.byte 	<(((init       ) .mod 10) + $30)

Regards


	Uz

-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-06-11 18:52:29 CEST