Search code examples
assemblywaitinterruptdosdosbox

DosBox is buggy with int 15h ah = 86h


I am currently working on an assembly program, but I need to make the program wait every once in a while.

So, I have been using int 15h/ah = 86h, but for some reason DosBox is giving me a hard time, and the program either gets confused with pixels (wierd colors) or in the worse case; crash.

Can someone please help me?


Solution

  • I had this issue as well. Based on the answer at Problems with BIOS delay function (INT 15h / AH = 86h), I was able to get it working by making sure to set AL to zero before calling the interrupt:

        mov     counter, 10
    L1:
    
        mov     cx, 0007H
        mov     dx, 8480H
        mov     ah, 86h
        mov     al, 0
        int     15h
    
        mov     dl, '*'
        mov     ah, 02h
        int     21h
    
        dec     counter
        jnz     L1
    

    (the program prints 10 *'s, pausing for 1 second between each.) With out the 'mov al, 0', the program would hang or give other undefined behavior while DOSBox spews illegal read/write messages. By setting al to zero, the program works correctly but, strangely, error messages still appear on the DOSBox log.