Dotneteer / spectnetide

ZX Spectrum IDE with Visual Studio 2017 and 2019 integration
MIT License
205 stars 27 forks source link

[bug] multiple labels in the Disassembly window not quite working... #105

Closed nww02 closed 5 years ago

nww02 commented 5 years ago

I placed four labels in my program "sub1", "sub2", "sub3" and the last (fourth) was at 8000 called zStart with "L 8000 zStart" (I would have used "Start", but that's already taken at 0000).

I then placed a label at 8080 (the end of my code) called "zEnd" with "L 8080 zEnd".

I could then G(oto) zStart by typing "G zStart" . However, attempting to "G zEnd" results in "Cannot find symbol 'zEnd'.

I then removed both start and end labels with "L 8000" and "L 8080". I then did "G zStart", and the Disassembly window STILL zapped me to 8000, despite having removed the zStart label.

I then placed zStart at the end of the program with "L 8080 zStart". The label appears fine, however when I try to G(oto) zStart, rather than taking me to its new position (8080), it STILL returns to its old location of 8000.

In fact, no labels after the initial placement of the fourth one work properly. Even deleting some of the first four labels still results in the labels not being "jumpable"...

Dotneteer commented 5 years ago

Well, this behavior is not just a bug, I'd rather say, perfunctory design... The source of this issue is that the IDE has three levels of identifiers/symbols:

I need to think it over and establish a design that works with the scenario you have described.

Dotneteer commented 5 years ago

@nww02, just to be clear: while you carried out the scenario above, did you use a Z80 program previously compiled/injected with Z80 IDE? If yes, did that code has symbols "zStart" or "zEnd"?

nww02 commented 5 years ago

Hi There, I didn't import any labels from the program in the code window, I only added labels using the disassebly window. The code was written directly in SpectNet's lovely code window :)

The process I used:

  1. Write an assembly program using SpectNet, compile it.
  2. Open the Disassembly Window
  3. Place the labels using the "L" commands in the assembly window where the three subroutines I wanted to monitor were.
  4. Place a label at the beginning of the code called zStart
  5. Place a label at the end of the code called zEnd

As soon as I placed the label called "zEnd", I noticed that the "G" instruction wasn't working properly. I then tried to modify the zStart label, moving it elsewhere, and found that the "G" instruction didn't seem to realise that the label had moved.

Dotneteer commented 5 years ago

@nww02 , thanks for the info! What I have found so far is that the L and G commands did not work with labels that addressed the RAM area (address >= $4000). I refactor all Disassembly and Memory tool window commands now to understand symbols and handle them as alternatives for hexadecimal addresses. This would be a solution for #106, too I also decided to allow decimal numbers.

Dotneteer commented 5 years ago

Fixed, will be released soon.

Dotneteer commented 5 years ago

Fixed in v1.16.0

nww02 commented 5 years ago

Great! Will give it a try! Thanks!