ED FE

Door Eugeny_Brychkov

Paragon (1232)

afbeelding van Eugeny_Brychkov

21-09-2011, 18:26

What is it?

Aangemeld of registreer om reacties te plaatsen

Van PingPong

Prophet (4093)

afbeelding van PingPong

21-09-2011, 20:33

What is it?
did you mean the z80 opcode?
fe is cp immediate
ed i assume is ignored

Van wouter_

Champion (508)

afbeelding van wouter_

21-09-2011, 21:58

What is it?
On a real Z80/R800 this instruction acts like a NOP instruction (not a CP instruction).

Some emulators use this opcode as an artificial 'patch' instruction. For example, blueMSX (and in the past openMSX) use this to instead of actually emulating the low level disk or tape behavior, emulate this behavior at a higher level.

For example: in the diskrom, the opcode at address 0x4010 (phydio) is replaced (patched) with ED FE CD (the 'special NOP', followed by RET). Now if the emulator sees this special opcode, it looks at the value of the PC (0x4010 in this case) and at the other register values, and based on this info it knows the MSX application tried to read/write a sector from disk. Now instead of actually emulating the low level disk operations, the emulator will simply execute the effect of this call and return to the MSX application. This works great if the MSX application always nicely uses the (disk)BIOS for disk or tape IO, but of course if the application tries to access the disk/tape directly it will fail. It also has to wrong timing (depending on how you look at it this may be a good or bad thing, sometimes a _much_ faster disk or tape is useful).

I'm not 100% sure, but I believe blueMSX can use either this patch approach or low level emulation of the disk stuff. But for tape it always needs a patched BIOS (dvik, can you confirm?). Very early versions of openMSX also required patched BIOS/diskroms, but currently both are emulated at a lower level.

Van Eugeny_Brychkov

Paragon (1232)

afbeelding van Eugeny_Brychkov

21-09-2011, 22:42

Thank you so much. The problem was that I was looking at the emulator and everything running within emulator. Looking at raw code I see valid JP instructions.

Van sd_snatcher

Prophet (3642)

afbeelding van sd_snatcher

21-09-2011, 23:07

@Eugeny_Brychkov

openMSX is an unrivaled emulator when it comes to developing MSX software. I personally recommend you to use it.