[cc65] weird range error

From: MagerValp <MagerValp1cling.gu.se>
Date: 2005-04-14 17:00:13
Why does stax give me a range error, while sta + stx does not? I'm
using the April 1st snapshot (uh-oh :).

	.macro ldax arg
	.if (.match (.left (1, arg), #))	; immediate mode
	lda #<(.right (.tcount (arg)-1, arg))
	ldx #>(.right (.tcount (arg)-1, arg))
	.else					; assume absolute or zero page
	lda arg
	ldx 1+(arg)
	.endif
	.endmacro

	.macro stax arg
	sta arg
	stx 1+(arg)
	.endmacro	


drivecode_main		= $1000
cmdbytes		= 32

	.code

; ----------------------------------------------------------------------
	ldax #drivecode_main
	stax cmd_mw_addr	; this gives me a range error

	sta cmd_mw_addr		; these work
	stx cmd_mw_addr + 1
; ----------------------------------------------------------------------


	.data

cmd_mw:
	.byte "M-W"
cmd_mw_addr:
	.byte <drivecode_main, >drivecode_main
	.byte cmdbytes
cmd_mw_len = * - cmd_mw

-- 
    ___          .     .  .         .       . +  .         .      o   
  _|___|_   +   .  +     .     +         .  Per Olofsson, arkadspelare
    o-o    .      .     .   o         +          MagerValp@cling.gu.se
     -       +            +    .     http://www.cling.gu.se/~cl3polof/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Apr 14 18:40:50 2005

This archive was generated by hypermail 2.1.8 : 2005-04-14 18:40:52 CEST