Peter Johnson
46c26f12a7
Fix incorrect invalidation of [eax+ebx+ecx-eax] and others like it.
...
svn path=/trunk/yasm/; revision=725
22 years ago
Peter Johnson
b3e9ae6254
Don't fully simplify effective addresses before trying to determine their
...
registers.
svn path=/trunk/yasm/; revision=724
22 years ago
Peter Johnson
6591a155d0
Check for circular equ references (Bug#8).
...
svn path=/trunk/yasm/; revision=723
22 years ago
Peter Johnson
3420509d65
x86_bc_resolve_jmprel(): Delete unused variable 'target'.
...
svn path=/trunk/yasm/; revision=721
22 years ago
Peter Johnson
a3a9fd2aa0
Completely revamp how label resolution is done (part of Bug#6). Now calculates
...
/distances/ between bytecodes in a section using bc_calc_dist() functions (a
"typical" one is provided for most occasions). expr_expand_labelequ() is gone,
as its functionality is integrated into expr_simplify(). Currently these
changes break most bin objfmt output, as it doesn't know how to resolve
absolute labels yet. Also, very preliminary expr support for :, SEG, and WRT
operators has been added (part of Bug#2). Several other minor bug fixes.
svn path=/trunk/yasm/; revision=718
22 years ago
Peter Johnson
f5f92a9d52
PSHUFW has 3 operands, not 2 (typo in num_operands value).
...
svn path=/trunk/yasm/; revision=716
22 years ago
Peter Johnson
99818a7010
RET and RETN are exactly equivalent (the previous commit was wrong, but not
...
for the reason stated; it just had the wrong base opcode).
svn path=/trunk/yasm/; revision=715
22 years ago
Peter Johnson
e1107f96a2
Revert previous commit until we can do this the right way (C2 iw is an
...
invalid opcode, it needs to be C2 or C3 iw).
svn path=/trunk/yasm/; revision=714
22 years ago
Peter Johnson
302c7215b5
RET is a form of RETNF.
...
svn path=/trunk/yasm/; revision=713
22 years ago
Peter Johnson
c1b04966ef
Fix lexing bug for XMM[0-7] (wrong character used to get register index).
...
svn path=/trunk/yasm/; revision=712
22 years ago
Peter Johnson
ddb25b6aa7
Declare shifted constants unsigned longs (with UL) before shifting, to
...
increase portability.
svn path=/trunk/yasm/; revision=711
22 years ago
Peter Johnson
090a25b8d4
Rename intnum_new_int to intnum_new_uint, and add new signed version of
...
intnum_new_int. Currently only just calls intnum_new_uint with a cast, but
eventually there may be a better way of handling signed numbers.
svn path=/trunk/yasm/; revision=708
22 years ago
Peter Johnson
c5ef1bf2dc
Eliminate duplicate code for callbacks from expr_expand_labelequ() by moving
...
code and adding a resolve_precall function parameter (which caused cascading
changes in bytecode-related sources).
svn path=/trunk/yasm/; revision=701
22 years ago
Peter Johnson
97ad3394e2
The short forms (0x50+reg) of push/pop reg should be selected before the long
...
(0xFF, ModRM) forms.
svn path=/trunk/yasm/; revision=697
22 years ago
Peter Johnson
320a83294e
Finish remaining instructions (SSE, SSE2, Cyrix MMX). Changed CPU flags for
...
MMX/SSE2 to reflect that it's the MMX or SSE2 cpu feature, not the cpu family.
svn path=/trunk/yasm/; revision=694
22 years ago
Peter Johnson
9390dd2bbb
Add MMX/SSE2 instructions.
...
svn path=/trunk/yasm/; revision=693
22 years ago
Peter Johnson
a2a986add9
Add segreg moves.
...
svn path=/trunk/yasm/; revision=692
22 years ago
Peter Johnson
efafc7c6fb
Fix some bugs.
...
- Typos in imul reg, imm (# of operands)
- Fixes to push/pop. word/dword override opersize now.
svn path=/trunk/yasm/; revision=691
22 years ago
Peter Johnson
ca721cf125
Implement relative jumps and calls.
...
svn path=/trunk/yasm/; revision=689
22 years ago
Peter Johnson
8495e174cc
x86_parse_targetmod enum should start with value 1, not 0.
...
svn path=/trunk/yasm/; revision=687
22 years ago
Peter Johnson
c2e982f901
Take opersize as an input for x86_bc_new_jmprel().
...
svn path=/trunk/yasm/; revision=686
22 years ago
Peter Johnson
2c090517fc
Flatten x86_targetval into x86_new_jmprel_data, as the former is no longer used
...
in the parser.
svn path=/trunk/yasm/; revision=685
22 years ago
Peter Johnson
cd573321b3
Finish all instructions except for relative jumps, mov segreg, MMX, SSE, and
...
SSE2.
svn path=/trunk/yasm/; revision=684
22 years ago
Peter Johnson
eb067621cf
Added rest of floating point instructions. Needed to add new action to
...
add to opcode byte 1.
svn path=/trunk/yasm/; revision=683
22 years ago
Peter Johnson
b630a6768b
Add checking of target modifier.
...
Change operand typing mask constants to be more uniform.
Increase operand type size to long from int, as it now can go over 16 bits.
svn path=/trunk/yasm/; revision=682
22 years ago
Peter Johnson
70442d8b7f
Make "TO" a x86 targetmod.
...
svn path=/trunk/yasm/; revision=681
22 years ago
Peter Johnson
d6cee4db08
Add a few control transfer instructions, plus set byte on flag, bit manip,
...
int, bound, and 286 protection control.
svn path=/trunk/yasm/; revision=678
22 years ago
Peter Johnson
ef8f221f24
Added shift instructions, as well as new "postponed" actions for things such
...
as shift ,1 operands and imm operands that have sign-extended imm8 forms that
can't be decided at parse-time. The x86 bc format already had support for
these. Also fixed a bug in the lfs family (incorrect inst len).
svn path=/trunk/yasm/; revision=677
22 years ago
Peter Johnson
0af7326e75
Add lea, l?s, and arithmetic instructions. Arithmetic instructions needed
...
two additional actions: signed immediate and spare+ea.
svn path=/trunk/yasm/; revision=676
22 years ago
Peter Johnson
e1eae9bae5
Add xchg, in, out. in and out required operand type Dreg (DL/DX/EDX) to be
...
added.
svn path=/trunk/yasm/; revision=675
22 years ago
Peter Johnson
ce0d675524
Add push and pop. This required adding some new specific operand types, which
...
required adding to the number of bits allocated for the operand type.
svn path=/trunk/yasm/; revision=674
22 years ago
Peter Johnson
035fea119a
Add explicit $(top_builddir) when running re2c.
...
svn path=/trunk/yasm/; revision=672
22 years ago
Peter Johnson
3320945f95
Massive restructuring of lexing and parsing (NASM-compatible parser).
...
Bugzilla Bug#3. Not all instructions are parsed yet, so this is actually a
minor feature regression from the user side, but this commit lays the framework
for much easier additions of new assembler syntaxes and architectures. The
re2c tool is now used to generate the lexers, as it's much more flexibly
function-oriented than lex.
- nasm-bison.y is a repocopy+modify of nasm/bison.y.in.
- x86arch.h now includes all of x86-int.h
svn path=/trunk/yasm/; revision=670
22 years ago
Peter Johnson
6727a189ab
fucom* are FPU instructions.
...
svn path=/trunk/yasm/; revision=660
22 years ago
Peter Johnson
3af9a80722
This file is going away soon, but it's still good to fix errors: CLTS was
...
passing too many values to the twobyte group.
svn path=/trunk/yasm/; revision=657
22 years ago
Peter Johnson
ac2743de63
Prevent spurious "Circular reference detected" errors by refining the return
...
value for bc_resolve() to enum-defined flags.
svn path=/trunk/yasm/; revision=623
23 years ago
Peter Johnson
a76d8561f7
Fix a couple bugs found by Splint (and do some other Splint cleanups).
...
svn path=/trunk/yasm/; revision=600
23 years ago
Peter Johnson
fe8c2a009f
Restructure bc_calc_len() family into bc_resolve() family. Many many many
...
bugfixes to the bc_tobytes() family and other functions. Binary object output
is now close to complete: just a few more bugs to kill!
svn path=/trunk/yasm/; revision=528
23 years ago
Peter Johnson
53002496e4
Fix a number of bugs in x86_checkea_calc_displen().
...
svn path=/trunk/yasm/; revision=527
23 years ago
Peter Johnson
d85e7014a8
Binary object format output! Lots of structural changes needed, particularly
...
with regards to resolve_label().
MAJOR FIXME: The tobytes() pass acts like a final optimization pass. This
causes internal errors because of length mismatches (optimized to shorter len).
svn path=/trunk/yasm/; revision=521
23 years ago
Peter Johnson
e56de0d158
Make call instruction work correctly. The old code generated a legal short
...
form for it (opcode length 1, opcode 0, rather than opcode length 0).
svn path=/trunk/yasm/; revision=520
23 years ago
Peter Johnson
4dd0912998
Fix bug in 32-bit displacement with no registers.
...
svn path=/trunk/yasm/; revision=517
23 years ago
Peter Johnson
f61b5746f1
Don't compact into a short form if one's not available.
...
svn path=/trunk/yasm/; revision=461
23 years ago
Peter Johnson
044cc90233
Make jcc's default to JR_SHORT in NASM syntax, and test for this possibility
...
in calc_len().
svn path=/trunk/yasm/; revision=460
23 years ago
Peter Johnson
056b3fc52c
Finish bc_calc_len(), with fixes to x86_bc_calc_len_insn()'s EA sizing calcs,
...
and implementation of x86_bc_calc_len_jmprel().
svn path=/trunk/yasm/; revision=459
23 years ago
Peter Johnson
5b2166d50a
Don't store "determined" immediate len and neg. Both will be determined from
...
the expr when that's actually possible.
svn path=/trunk/yasm/; revision=456
23 years ago
Peter Johnson
4949569151
Fix memory leak.
...
Add assert call to silence LCLint.
svn path=/trunk/yasm/; revision=454
23 years ago
Peter Johnson
ee74365f05
Add new bc_resolve() family, and rewrite calc_len to /just/ calculate the
...
length, not modify anything else (particularly expressions w/temp. resolved
labels).
svn path=/trunk/yasm/; revision=452
23 years ago
Peter Johnson
cc635cc237
Change return type of calc_len() family back to int from unsigned long.
...
svn path=/trunk/yasm/; revision=448
23 years ago
Peter Johnson
985d4e9b59
LCLint cleanups.
...
svn path=/trunk/yasm/; revision=443
23 years ago