Page 1 of 1
Page boundary crossed, CBM Studio
Posted: Sat Feb 04, 2023 3:55 pm
by mythic66
Hi,
I'm getting this error in CBM Studio, it pop me this at line 183, and 188. There's not much info about it in the help. Google gave
me a few hints, but as I can see, the jump address is quite close, so I can't figured out why this error keep coming.
Code: Select all
00179 10EF A2 00 LDX #$0
00180 10F1 A0 00 LDY #$0
00181 10F3 BD 5F 12 LOOPR0 LDA TOPBOX1,X ; TOP BOX
00182 10F6 C9 00 CMP #0 ; END ?
00183 10F8 F0 0C BEQ LOOPR1
00184 10FA 9D 00 1E STA $1E00,X
00185 10FD AD 67 15 LDA YELLOW
00186 1100 9D 00 96 STA $9600,X
00187 1103 E8 INX
00188 1104 D0 ED BNE LOOPR0
00189 1106
00190 1106 A2 00 LOOPR1 LDX #0
Re: Page boundary crossed, CBM Studio
Posted: Sat Feb 04, 2023 4:12 pm
by tlr
There is a page crossing, yes. This will make the branches take one additional cycle when taken, but this is normally not an error. Perhaps you have some flag set to the assembler to make this error out?
Re: Page boundary crossed, CBM (Prg?) Studio
Posted: Sat Feb 04, 2023 5:08 pm
by Mike
mythic66 wrote:There's not much info about it in the help.
A note to the maintainer should be in order in such a case, and normally questions regarding the use of cross-developing tools have their
own section here in Denial, but regardless ...
tlr wrote:[...] this is normally not an error. [...]
If anything, the assembler may issue a warning, but unless explicitly being told so, that condition should not terminate the assembly. There's simply no good reason to, the 65xx handles page-crossing branches, even if those take one cycle longer, 4 instead of 3 cycles when taken.
The only reason to flag this as error (on programmer's demand!) is for code that needs to be
cycle exact and would break, i.e. lose its intended timing, if that extra cycle got inserted.
...
On another two notes: that
CMP #0 instruction in $10F6 is redundant. The Z flag you test with BEQ LOOPR1 is already set as intended by the LDA instruction before. Also, is there a specific reason
LDA YELLOW loads a (presumably) constant value from memory with absolute address mode? YELLOW could quite as well be defined as constant symbol for the value 7 and then be referred as immediate constant with
LDA #YELLOW, which is both shorter and faster.
Re: Page boundary crossed, CBM Studio
Posted: Sat Feb 04, 2023 6:08 pm
by thegg
Report Page Boundary Crossing is an Assembler option found in Tools/Options/Assembler. Uncheck the option and the warnings will no longer appear. The warnings are just information, not errors. In the absence of any true errors, the assembly will complete.
Re: Page boundary crossed, CBM Studio
Posted: Sun Feb 05, 2023 7:40 am
by bjonte
That setting will give a lot of false positives in a large program. This needs to be applied only in the places where it is useful. Maybe there’s a way to turn it on and off during assembly? I wrote a macro to give me that warning if a block of code crosses a boundary instead.
Re: Page boundary crossed, CBM Studio
Posted: Sun Feb 05, 2023 8:39 am
by mythic66
Sorry to misplaced this post, now I will visit this section more often !
I disabled the alarm, but before I just wanted to make sure everything was alright. and yes, indeed, the program
is working correctly despite this warning.
about the extra command ( cmp #0 ), I usually declutter the code once it's working and purged any extra bits.
@bjonte, this is where you can shut off the warning.
Re: Page boundary crossed, CBM Studio
Posted: Sun Feb 05, 2023 8:59 am
by thegg
If you should need to know about page boundary crossings, you can enable the options setting and then use the 'warning on|off' directive to enable the messages in the critical code. However, please note that all warnings are enabled/disabled by the directive.