1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Added first version of a clean-room wcc support library implementation.

This commit is contained in:
Markus F.X.J. Oberhumer 2007-02-11 01:06:37 +01:00
parent 6456de7188
commit 50c8860a50
4 changed files with 948 additions and 775 deletions

File diff suppressed because it is too large Load Diff

View File

@ -127,6 +127,76 @@
#define jnes jnzs
/*
; =============
; ============= WATCOM C/C++ HUGE POINTER SUPPORT
; =============
*/
/* DOS real mode */
#define _AHSHIFT 12
#define _AHINCR (1 << _AHSHIFT) /* 4096 */
// huge pointer add: dx:ax = dx:ax + cx:bx
.macro M_WCC_PIA_086
add ax, bx
adc cx, 0
xchg cx, bx
mov cl, _AHSHIFT
shl bx, cl
add dx, bx
.endm
.macro M_WCC_PIA_286
add ax, bx
adc cx, 0
shl cx, _AHSHIFT
add dx, cx
.endm
// huge pointer sub: dx:ax = dx:ax - cx:bx
.macro M_WCC_PIS_086
sub ax, bx
adc cx, 0
xchg cx, bx
mov cl, _AHSHIFT
shl bx, cl
sub dx, bx
.endm
.macro M_WCC_PIS_286
sub ax, bx
adc cx, 0
shl cx, _AHSHIFT
sub dx, cx
.endm
// huge pointer diff: dx:ax = dx:ax - cx:bx
.macro M_WCC_PTS
// FIXME
.endm
// huge pointer compare: set zero and carry flags: dx:ax cmp cx:bx
.macro M_WCC_PTC
local L1
cmp dx, cx
jnes L1
cmp ax, bx
L1:
.endm
// umul32: dx:ax = dx:ax * cx:bx
.macro M_WCC_U4M
push si
// compute high-word
// add low-word
pop si
.endm
/*
; =============
; ============= 16-BIT CALLTRICK & JUMPTRICK

View File

@ -117,6 +117,7 @@ section EXECUTPO
#include "arch/i086/nrv2b_d8.S"
#include "arch/i086/nrv2d_d8.S"
#include "arch/i086/nrv2e_d8.S"
//#include "arch/i086/lzma_d.S"
section EXEMAIN5
pop bp
@ -217,6 +218,34 @@ section EXERETIP
push ax
lret
section wcc_pia_086
M_WCC_PIA_086
ret
section wcc_pia_286
CPU 286
M_WCC_PIA_286
CPU 8086
ret
section wcc_pis_086
M_WCC_PIS_086
ret
section wcc_pis_286
CPU 286
M_WCC_PIS_286
CPU 8086
ret
section wcc_pts
M_WCC_PTS
ret
section wcc_ptc
M_WCC_PTC
ret
section wcc_u4m
M_WCC_U4M
ret
/*
vi:ts=8:et:nowrap
*/

View File

@ -59,6 +59,13 @@ Idx Name Size VMA LMA File off Algn Flags
54 EXEJUMPF 00000005 00000000 00000000 00000300 2**0 CONTENTS, RELOC, READONLY
55 EXERCSPO 00000004 00000000 00000000 00000305 2**0 CONTENTS, RELOC, READONLY
56 EXERETIP 00000006 00000000 00000000 00000309 2**0 CONTENTS, RELOC, READONLY
57 wcc_pia_086 0000000e 00000000 00000000 0000030f 2**0 CONTENTS, READONLY
58 wcc_pia_286 0000000b 00000000 00000000 0000031d 2**0 CONTENTS, READONLY
59 wcc_pis_086 0000000e 00000000 00000000 00000328 2**0 CONTENTS, READONLY
60 wcc_pis_286 0000000b 00000000 00000000 00000336 2**0 CONTENTS, READONLY
61 wcc_pts 00000001 00000000 00000000 00000341 2**0 CONTENTS, READONLY
62 wcc_ptc 00000007 00000000 00000000 00000342 2**0 CONTENTS, READONLY
63 wcc_u4m 00000003 00000000 00000000 00000349 2**0 CONTENTS, READONLY
SYMBOL TABLE:
00000000 l d DEVICEENTRY 00000000 DEVICEENTRY
00000000 l d EXEENTRY 00000000 EXEENTRY
@ -117,6 +124,13 @@ SYMBOL TABLE:
00000000 l d EXEJUMPF 00000000 EXEJUMPF
00000000 l d EXERCSPO 00000000 EXERCSPO
00000000 l d EXERETIP 00000000 EXERETIP
00000000 l d wcc_pia_086 00000000 wcc_pia_086
00000000 l d wcc_pia_286 00000000 wcc_pia_286
00000000 l d wcc_pis_086 00000000 wcc_pis_086
00000000 l d wcc_pis_286 00000000 wcc_pis_286
00000000 l d wcc_pts 00000000 wcc_pts
00000000 l d wcc_ptc 00000000 wcc_ptc
00000000 l d wcc_u4m 00000000 wcc_u4m
00000000 *UND* 00000000 attribute
00000000 *UND* 00000000 interrupt
00000000 *UND* 00000000 orig_strategy