6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Nov 11, 2024 11:00 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: xa wide mode error?
PostPosted: Tue Dec 08, 2020 9:14 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1042
Location: near Heidelberg, Germany
Hi there, I'm trying to assemble a small test program and I'm getting an overflow error on loading X with a 16 bit value in xa, or comparing it with a 16bit value.
I'm using the "-w" option to enable 65816 mode, and the ".xl" pseudo opcode to tell the assembler to run in wide index register mode.

Code:
       
        *=$f000
vreset
        ; init the CPU
        sei
        cld
        ldx #$ff
        txs

        ; switch to native mode
        clc
        xce

        ; set ac to single byte ...
        sep #%00100000
        ; ... and tell the assembler about it
        .as

        ; set X/Y registers to 16 bit ...
        rep #%00010000
        ; ... and tell the assembler about it
        .xl

        ; -----------------------
        ; copy over charrom to RAM

        lda #0
        ldx #4095
copy
        lda $00e000,x   ; location in test ROM bank
        sta $07c000,x   ; location in RAM - uppermost RAM bank
        dex
        bpl copy

        ...


However, when I try to build it, I get

Code:
xa -w -o romtest02 romtest02.a65
 ldx #4095
romtest02.a65:line 37: f00f:Overflow error
 cpx #$c000
romtest02.a65:line 51: f022:Overflow error
 cpx #2000
romtest02.a65:line 59: f02d:Overflow error
Break after 3 errors


Anyone knows what's going on here?

That's on xa-2.3.11

Thanks!

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
 Post subject: Re: xa wide mode error?
PostPosted: Tue Dec 08, 2020 10:02 pm 
Offline

Joined: Mon Sep 14, 2015 8:50 pm
Posts: 111
Location: Virginia USA
Floodgap.com seems to be down currently.
Isn't XA one of your projects?

Cheers,
Andy


Top
 Profile  
Reply with quote  
 Post subject: Re: xa wide mode error?
PostPosted: Wed Dec 09, 2020 10:58 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1042
Location: near Heidelberg, Germany
handyandy wrote:
Floodgap.com seems to be down currently.
Isn't XA one of your projects?

Cheers,
Andy


Floodgap is up again, but I haven't heard from Cameron so far.

Yes, it used to be my project, but Cameron has since long taken over the maintenance.
And 65816 support always was an outside contribution (i.e. not from me ;-))

André

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
 Post subject: Re: xa wide mode error?
PostPosted: Thu Dec 10, 2020 12:06 am 
Offline

Joined: Mon Sep 14, 2015 8:50 pm
Posts: 111
Location: Virginia USA
Maybe try sep #$20
rep #$10?

Cheers,
Andy


Top
 Profile  
Reply with quote  
 Post subject: Re: xa wide mode error?
PostPosted: Tue Dec 22, 2020 12:43 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1042
Location: near Heidelberg, Germany
Actually, it was a bug in xa. Cameron confirmed it. Probably gives a new minor version.

@handyandy using SEP/REP only sets the processor state - but we need to tell the assembler that e.g. LDA #0 is a 3-byte instruction, as it would do two bytes only - therefore .al is used.

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: