bugZ80 assembler - Bugs: bug #47653, Incorrect handling of (IX), (IY)

 
 

bug #47653: Incorrect handling of (IX), (IY)

Submitter:  None
Submitted:  Sat 09 Apr 2016 03:02:22 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  hisdeedsaredust
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 15 Mar 2021 02:35:24 PM UTC, comment #8: 

*.correct-bin shows that all (ix+disp) instructions are generated correctly.

Paul Flo Williams <hisdeedsaredust>
Group Member
Sat 13 Mar 2021 03:23:35 PM UTC, comment #7: 

Hi all, I have integrated the changes into the master branch. Please double check if the *.correct-bin binaries are really correct.

I have noted that there is some problem with the label resolution, which has to be solved separately. Therefore, the file #50970:  test-ix-disp-wrong.asm is not added to the build tests now.

It probably wold be a good idea to add a development branch after this issue is fixed.

Peter Kollner <asgalon>
Group Member
Sat 13 Mar 2021 11:09:25 AM UTC, comment #6: 

Hi Bas,

thanks for the reply. The change I provided back in 2016 seems to have stopped working with -O2 compiler optimization in the current gcc versions, so there is a bit of work to be done before I can make a clean compile with the patch for this bug before committing the change. When this is all finished, it probably would be good to build another release with all corrections applied. So I'd probably need the rights for that later on...

Cheers
  Peter

Peter Kollner <asgalon>
Group Member
Thu 11 Mar 2021 10:05:18 AM UTC, comment #5: 

comment #4:

> Tried to contact Bas Wijnen  on how to proceed with the project.


Thanks for doing that. I should check my notification settings; I didn't see anything from the activity.

As to your question of whether I'm still active on this project: no. I haven't touched it for a long time and don't think I will any time soon (except when requested; I'm always happy to answer questions).

Because of this, I have for some time responded to anyone who shows willingness to work on it by offering commit rights, so they can effectively take over the project. I like to hear about what's happening, but I don't need to give a green light or anything like that; that would just hold things up.

So by all means, feel free to handle this (and other) issues in any way you feel is best. If you need more rights, just ask.

Thanks for working on this; it's nice to know that my project is useful to people other than myself.

Bas Wijnen <shevek>
Group administrator
Sat 06 Mar 2021 11:11:52 PM UTC, comment #4: 

Tried to contact Bas Wijnen  on how to proceed with the project.

Peter Kollner <asgalon>
Group Member
Tue 02 Mar 2021 11:18:32 AM UTC, comment #3: 

Sorry for the delay, I am going to handle incoming items shortly.

Peter Kollner <asgalon>
Group Member
Tue 02 Mar 2021 11:06:18 AM UTC, comment #2: 

I've just attached ix-iy-displacement.patch, which will now produce an error for missing displacements for all instructions which use rd_r() and rd_r_(), i.e.:

adc, and, bit, cp, dec, inc, or, res, rl, rlc, rr, rrc, sbc, set, sla, sra, srl, sub and xor.

This works for the cases where the displacement is entirely missing, e.g.:


cp (ix)


If the displacement is present but nonsense, that will be picked up slightly later during opcode generation when the reference is resolved.

This is also not a complete fix for this bug, as


ld (ix),0


can still dump core, depending on whether or not a valid displacement is present in a previous instruction. (Something uninitialised here, and on my list to deal with.)

Paul Flo Williams <hisdeedsaredust>
Group Member
Thu 05 May 2016 01:58:03 PM UTC, comment #1: 

confirmed. The code produced is 0xdd 0x35 for dec(ix), without warning

Peter Kollner <asgalon>
Group Member
Sat 09 Apr 2016 03:02:22 AM UTC, original submission:  

Instructions involving IX, IY, where an offset is required but omitted, are not flagged as wrong, nor assembled as if the offset were zero.

For example, the instruction dec (IX) is assembled as just two bytes, when three are required.



Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #50972:  test-ix-disp-correct.asm added by hisdeedsaredust (228B - application/octet-stream - Source to show that indexes with displacement produce correct code)
file #50971:  ix-iy-displacement2.patch added by hisdeedsaredust (2KiB - text/x-patch - This replaces first patch, as it didn't include fix for inc (ix) and dec (ix))
file #50970:  test-ix-disp-wrong.asm added by hisdeedsaredust (188B - application/octet-stream - Source to show that indexes without displacements are currently accepted, incorrectly)
file #50967:  ix-iy-displacement.patch added by hisdeedsaredust (596B - text/x-patch - This patch produces errors for index register references without displacements.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by shevek (Posted a comment)
  • -email is unavailable- added by hisdeedsaredust (Updated the item)
  • -email is unavailable- added by asgalon (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-15 hisdeedsaredust StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-03-13 asgalon StatusConfirmed Ready For Test
        Assigned toasgalon hisdeedsaredust
    2021-03-02 hisdeedsaredust Attached File- Added test-ix-disp-correct.asm, #50972
    2021-03-02 hisdeedsaredust Attached File- Added ix-iy-displacement2.patch, #50971
    2021-03-02 hisdeedsaredust Attached File- Added test-ix-disp-wrong.asm, #50970
    2021-03-02 asgalon Assigned toNone asgalon
    2021-03-02 hisdeedsaredust Attached File- Added ix-iy-displacement.patch, #50967
    2016-05-05 asgalon StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code