flashjazzcat #1 Posted April 16, 2016 (edited) Just stumbled into a bug with MADS' built-in ADW macro when used with (ZP),Y: LDY #$04 ADW (OBSPEC),Y PTR2 PTR4 A334: A0 04 LDY #$04 A336: 18 CLC A337: B1 C1 LIMITCLIP.OFFSCREEN LDA (OBSPEC),Y A339: 65 E2 [email protected] ADC PTR2 A33B: 85 E6 STA PTR4 A33D: C8 INY A33E: B1 C1 LDA (OBSPEC),Y A340: 65 E3 ADC $E3 A342: 85 E6 STA PTR4 ; <<<<<<< should be $E7, not $E6 LDY #$04 MWA (OBSPEC),Y PTR4 A334: A0 04 LDY #$04 A336: B1 C1 LDA (OBSPEC),Y A338: 85 E6 STA PTR4 A33A: C8 INY A33B: B1 C1 LDA (OBSPEC),Y A33D: 85 E7 STA $E7 ; <<<<<<<<<<<<< $E7 = correct Using the latest build here, and I'm sure ADW used to store the MSB correctly in older versions. Haven't looked to see if the bug exists in SBW as well. Edited April 16, 2016 by flashjazzcat Quote Share this post Link to post Share on other sites
tebe #3 Posted May 1, 2016 adw (zp),y bug fix mads204b11.zip 2 Quote Share this post Link to post Share on other sites
flashjazzcat #4 Posted May 1, 2016 (edited) adw (zp),y bug fix Great - many thanks. This fixes the issue described but (ZP),Y support is still very inconsistent in the ADW and SBW macros: ptr1 equ $80 ptr2 equ $82 ptr3 equ $84 org $2000 Start ldy #0 adw Num1 #2 ldy #0 adw (ptr1),y #2 ; error - extra characters on line ldy #0 adw (ptr1),y #2 Num1 ldy #0 adw (ptr1),y Num1 Num2 ldy #0 adw (ptr1),y #2 (ptr2),y ; error - extra characters on line ldy #0 adw Num1 Num2 Num3 ldy #0 adw (ptr1),y (ptr2),y (ptr3),y ; error - extra characters on line rts Num1 .word 0 Num2 .word 0 Num3 .word 0 end start The exact same errors appear for SBW. These seem like potentially common scenarios and they work with absolute references. Edited May 1, 2016 by flashjazzcat Quote Share this post Link to post Share on other sites
tebe #5 Posted May 1, 2016 correct version (',y' -> ',Y') mads204b12.zip 2 Quote Share this post Link to post Share on other sites
flashjazzcat #6 Posted May 1, 2016 correct version (',y' -> ',Y') Wow - that was fast. Thanks. I'll test this thoroughly over the coming days. The example appears to compile perfectly. Quote Share this post Link to post Share on other sites
+Stephen #7 Posted May 1, 2016 Wow - talk about customer service! Quote Share this post Link to post Share on other sites