emustudio / edigen

Emulator Disassembler Generator
GNU General Public License v3.0
4 stars 0 forks source link

Detection of unreachable disassembler formats #54

Closed vbmacher closed 2 years ago

vbmacher commented 2 years ago

For example:

root instruction;

instruction =
  "nop": 0000 0000 |
  "arg %X": 10000 0000 arg ;

arg = arg: arg(8);
%%

"%s" = instruction arg;
"%X" = arg;  // unreachable

Plain arg rule is unreachable, because all instruction variants return, so instruction is always present too.

vbmacher commented 2 years ago

Disassembler format selection is based on all parameters of the instruction, it is not based on order. Thus, unreachable disassembler rules are never used and are not really a problem, even not a performance problem. If they should be detected, it should be done just for warn the programmer.