Home > Software engineering >  How can i solve error when drawing image in emu8086
How can i solve error when drawing image in emu8086

Time:06-11

I have 8086 code for drawing img file. I can use it in dosbox but when it comes to run in emu8086, I got this error

    unknown opcode skipped:0F
    not 8086 instruction - not supported yet.

This error occurs in readdata function after running ret command. I tried to understand what caused to this error but I couldn't. I just want to know how can i solve it.

Error's screenshotenter image description here

This is the image i tried to draw : drivelink

CodePudding user response:

...understand what caused to this error...

The code segment gets overwritten by data, followed by a ret instruction returning to a place that no longer contains a valid instruction that emu8086 can recognize.

The DS segment register contains 0714h and, holding 0715h, the CS segment register follows just 16 bytes after that. The .Data section is not setup correctly. I suspect that the question mark in roseFilehandle DW ? is the culpritt!

Based on the address that emu8086 assigned to the roseData buffer (8), I suggest you rewrite the .Data section like:

.Data

roseWidth EQU 200
roseHeight EQU 195

roseFilename   DB 'rose.img', 0
roseData       DB roseWidth*roseHeight dup(0)
roseFilehandle DW 0

You might also want to enlarge the stack to a more realistic size: .Stack 256.

For maximum compatibility with existing BIOSes, you should not use BX to loop over the image data, use SI instead and set BH=0 to select display page 0.

  mov  bh, 0
  mov  si, OFFSET roseData
drawLoop:
  • Related