wok diff linld/stuff/jump.u @ rev 19518
Up get-palemoon (27.0.0)
author | Xander Ziiryanoff <psychomaniak@xakep.ru> |
---|---|
date | Wed Nov 23 11:04:21 2016 +0100 (2016-11-23) |
parents | df186455938f |
children |
line diff
1.1 --- a/linld/stuff/jump.u Sat Jun 11 20:26:42 2016 +0200 1.2 +++ b/linld/stuff/jump.u Wed Nov 23 11:04:21 2016 +0100 1.3 @@ -1,9 +1,32 @@ 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 +@@ -7,9 +7,16 @@ 1.10 + %nomacs 1.11 + p386 1.12 1.13 +- group DGROUP _TEXT 1.14 ++ group DGROUP _TEXT,_DATA 1.15 + assume cs:DGROUP,ds:DGROUP 1.16 + 1.17 ++ segment _DATA byte public use16 'DATA' 1.18 ++ 1.19 ++ global _saved15:dword 1.20 ++ global _first1k:word 1.21 ++ 1.22 ++ ends _DATA 1.23 ++ 1.24 + segment _TEXT byte public use16 'CODE' 1.25 + 1.26 + ;*************************************************************** 1.27 +@@ -19,38 +26,102 @@ 1.28 + global _set_sregs_jump_seg_ofs:near 1.29 + proc _set_sregs_jump_seg_ofs near 1.30 + 1.31 +- arg sreg :word, \ 1.32 +- stk :word, \ 1.33 +- jmpseg :word, \ 1.34 +- jmpofs :word = PARAM_SIZE 1.35 +- 1.36 - push bp ;TODO: kinda useless, isn't it? 1.37 - mov bp,sp 1.38 - 1.39 @@ -21,27 +44,108 @@ 1.40 - mov ss,ax 1.41 - mov fs,ax 1.42 - mov gs,ax 1.43 -+ pop bx ;caller return address 1.44 -+ pop bx ; sreg 1.45 ++ mov bx, 202h 1.46 ++ add bx,[_first1k] 1.47 ++ cmp [dword bx],'SrdH' ; head version >= 2 ? 1.48 ++ jne oldzimage 1.49 ++ test [byte bx+0Fh],1 ; load high ? (clear C) 1.50 ++ jne isbzimage 1.51 ++oldzimage: 1.52 ++ ; finish loading 1.53 ++ extrn @last_ditch$qv 1.54 ++ push cs 1.55 ++ call near @last_ditch$qv 1.56 ++ ; self move 1.57 ++ cld 1.58 ++ push 9820h ; 512 bytes for cmdline 1.59 ++ pop es 1.60 ++ xor di,di 1.61 ++ mov si,di 1.62 ++ extrn _bss_end 1.63 ++ mov cx,offset _bss_end 1.64 ++ rep 1.65 ++ movsb 1.66 ++ push es 1.67 ++ call near doretf 1.68 ++ stc 1.69 ++isbzimage: 1.70 ++ pop ax ;caller return address 1.71 ++ pop dx ; jmpseg 1.72 ++ pop bx ; jmpofs 1.73 + pop ax ; stk 1.74 -+ pop dx ; jmpseg 1.75 -+ pop cx ; jmpofs 1.76 -+ mov ds,bx 1.77 -+ mov es,bx 1.78 -+ mov fs,bx 1.79 -+ mov gs,bx 1.80 -+ mov ss,bx 1.81 ++ pop ss ; sseg 1.82 + xchg sp,ax 1.83 ++ push dx bx 1.84 ++ jnc nomove 1.85 ++ ; DOS shutdown 1.86 ++ xor si,si 1.87 ++ mov ds,si 1.88 ++ push [dword si+4] 1.89 ++ mov [word cs:loadsp19+1],sp 1.90 ++ ;cmp [byte si+7],0F0h 1.91 ++ ;jnc notdos 1.92 ++ mov [word si+4],offset step19 1.93 ++ mov [si+6],cs 1.94 ++ pushf 1.95 ++ pop ax 1.96 ++ inc ah 1.97 ++ push ax 1.98 ++ popf 1.99 ++ jmp small [dword si+4*19h] 1.100 ++doiret: 1.101 ++ iret 1.102 ++step19: 1.103 ++ push si 1.104 ++ push ds 1.105 ++ mov si,sp 1.106 ++ lds si,[dword ss:si+4] 1.107 ++ cmp [word si],19CDh 1.108 ++ pop ds 1.109 ++ pop si 1.110 ++ jne doiret 1.111 ++ xor si,si 1.112 ++ mov ds,si 1.113 ++notdos: 1.114 ++loadsp19: 1.115 ++ mov sp,0 1.116 ++ pop [dword si+4] 1.117 ++ ; move zImage system 1.118 ++ ; memcpy32(dstseg=0, dstofs=10000h, srcseg=0, srcofs=100000h, size=80000h) 1.119 ++ push cs 1.120 ++ pop ds 1.121 ++ push 8 1.122 ++ push si ; size 1.123 ++ push 10h ; src 1.124 ++ push si ; ofs 1.125 ++ push si ; srcseg 1.126 ++ push 1 ; dst 1.127 ++ push si ; ofs 1.128 ++ push si ; dstseg 1.129 ++ extrn _memcpy32 1.130 ++ call near _memcpy32 1.131 ++ add sp,16 1.132 ++nomove: 1.133 ++ push ss 1.134 ++ pop ds 1.135 ++ push ss 1.136 ++ pop es 1.137 ++ push ss 1.138 ++ pop fs 1.139 ++ push ss 1.140 ++ pop gs 1.141 assume nothing 1.142 assume cs:DGROUP 1.143 1.144 - ;;jmp [dword ofs2] 1.145 - 1.146 - push dx cx 1.147 +- push dx cx 1.148 ++doretf: 1.149 retf 1.150 -; Data 1.151 -;;ofs2 dw ? 1.152 -;;seg2 dw ? 1.153 ++ 1.154 ++movedend: 1.155 endp _set_sregs_jump_seg_ofs 1.156 1.157 ends _TEXT