;
; tsr fix for some cirrus bioses... hopefully allows running
; "we go" and "rebel? (as perceived)" with picture shown :-)
;
; problem:
;       our code has sequence like this:
;               mov edx, 0a0000h
;               mov eax, 13h
;               int 10h
;               mov [vga_address], edx
;       this code is generated by watcom with all optimizations on,
;       assuming that edx stays the same during int 10h call
;       (according to ibm standard, it does!)  some lamma bioses
;       don't do this...
; fix:
;       simple, just save edx during the int 10h, func 0 :-)
;
; jmag@complex.jyu.fi, october 1996
;

        ideal
segment kak byte use16
        assume cs:kak, ds:kak, es:kak
        org 100h
        p386
start:
        push    0
        pop     ds
        push    [dword ds:4*10h]
        pop     [cs:oldint]

        push    cs
        push    offset newint
        pop     [dword ds:4*10h]

        mov     dh, 2
        int     27h

newint:
        test    ah, ah
        jnz     we_go
        push    edx
        pushf
        push    cs
        push    offset intret
we_go:
        db      0eah    ; jmp far xxxx:xxxx
oldint  dd ?
intret:
        pop     edx
        iret
ends
        end     start
