wok diff linld/stuff/jump.u @ rev 19203

linld/tobzimage: add realmode_switch support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jun 11 15:57:21 2016 +0200 (2016-06-11)
parents
children df186455938f
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linld/stuff/jump.u	Sat Jun 11 15:57:21 2016 +0200
     1.3 @@ -0,0 +1,47 @@
     1.4 +--- LINLD097/JUMP.ASM
     1.5 ++++ LINLD097/JUMP.ASM
     1.6 +@@ -24,33 +24,22 @@
     1.7 +                         jmpseg  :word,  \
     1.8 +                         jmpofs  :word   = PARAM_SIZE
     1.9 + 
    1.10 +-                push    bp      ;TODO: kinda useless, isn't it?
    1.11 +-		mov	bp,sp
    1.12 +-
    1.13 +-              ;;mov     ax,[jmpseg]     ;Move data to CS segment var
    1.14 +-              ;;mov     [seg2],ax       ;  we cannot use any other seg!
    1.15 +-              ;;mov     ax,[jmpofs]     ;
    1.16 +-              ;;mov     [ofs2],ax       ;
    1.17 +-                mov     cx,[jmpofs]     ;Do NOT load in r32:
    1.18 +-                mov     dx,[jmpseg]     ;  wrong order!
    1.19 +-
    1.20 +-                mov     ax,[sreg]
    1.21 +-                mov     sp,[stk]        ;Do not use [bp+n] after this...
    1.22 +-                mov     ds,ax
    1.23 +-                mov     es,ax
    1.24 +-                mov     ss,ax
    1.25 +-                mov     fs,ax
    1.26 +-                mov     gs,ax
    1.27 ++		pop	bx		;caller return address
    1.28 ++		pop	bx		; sreg
    1.29 ++		pop	ax		; stk
    1.30 ++		pop	dx		; jmpseg
    1.31 ++		pop	cx		; jmpofs
    1.32 ++                mov     ds,bx
    1.33 ++                mov     es,bx
    1.34 ++                mov     fs,bx
    1.35 ++                mov     gs,bx
    1.36 ++                mov     ss,bx
    1.37 ++                xchg	sp,ax
    1.38 + 		assume	nothing
    1.39 + 		assume	cs:DGROUP
    1.40 + 
    1.41 +-              ;;jmp     [dword ofs2]
    1.42 +-
    1.43 +                 push    dx cx
    1.44 +                 retf
    1.45 +-; Data
    1.46 +-;;ofs2            dw      ?
    1.47 +-;;seg2            dw      ?
    1.48 +         endp    _set_sregs_jump_seg_ofs
    1.49 + 
    1.50 +         ends    _TEXT