mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-17 17:19:35 +08:00
NASM 0.98.15
This commit is contained in:
parent
ce61607e11
commit
9eb185bfdb
82
README09b.txt
Normal file
82
README09b.txt
Normal file
@ -0,0 +1,82 @@
|
||||
|
||||
README
|
||||
NASM, the Netwide Assembler
|
||||
|
||||
|
||||
Changes from 0.98.07 release to 98.09b as of 28-Oct-2001
|
||||
========================================================
|
||||
|
||||
1. More closely compatible with 0.98 when -O0 is implied
|
||||
or specified. Not strictly identical, since backward
|
||||
branches in range of short offsets are recognized, and signed
|
||||
byte values with no explicit size specification will be
|
||||
assembled as a single byte.
|
||||
|
||||
2. More forgiving with the PUSH instruction. 0.98 requires
|
||||
a size to be specified always. 0.98.09b will imply the size
|
||||
from the current BITS setting (16 or 32).
|
||||
|
||||
3. Changed definition of the optimization flag:
|
||||
|
||||
-O0 strict two-pass assembly, JMP and Jcc are
|
||||
handled more like 0.98, except that back-
|
||||
ward JMPs are short, if possible.
|
||||
|
||||
-O1 strict two-pass assembly, but forward
|
||||
branches are assembled with code guaranteed
|
||||
to reach; may produce larger code than
|
||||
-O0, but will produce successful assembly
|
||||
more often if branch offset sizes are not
|
||||
specified.
|
||||
|
||||
-O2 multi-pass optimization, minimize branch
|
||||
offsets; also will minimize signed immed-
|
||||
iate bytes, overriding size specification.
|
||||
|
||||
-O3 like -O2, but more passes taken, if needed
|
||||
|
||||
|
||||
Changes from 0.98 release to 98.03 as of 27-Jul-2000
|
||||
====================================================
|
||||
|
||||
1. Added signed byte optimizations for the 0x81/0x83 class
|
||||
of instructions: ADC, ADD, AND, CMP, OR, SBB, SUB, XOR:
|
||||
when used as 'ADD reg16,imm' or 'ADD reg32,imm.' Also
|
||||
optimization of signed byte form of 'PUSH imm' and 'IMUL
|
||||
reg,imm'/'IMUL reg,reg,imm.' No size specification is needed.
|
||||
|
||||
2. Added multi-pass JMP and Jcc offset optimization. Offsets
|
||||
on forward references will preferentially use the short form,
|
||||
without the need to code a specific size (short or near) for
|
||||
the branch. Added instructions for 'Jcc label' to use the
|
||||
form 'Jnotcc $+3/JMP label', in cases where a short offset
|
||||
is out of bounds. If compiling for a 386 or higher CPU, then
|
||||
the 386 form of Jcc will be used instead.
|
||||
|
||||
This feature is controlled by a new command-line switch: "O",
|
||||
(upper case letter O). "-O0" reverts the assembler to no
|
||||
extra optimization passes, "-O1" allows up to 5 extra passes,
|
||||
and "-O2"(default), allows up to 10 extra optimization passes.
|
||||
|
||||
3. Added a new directive: 'cpu XXX', where XXX is any of:
|
||||
8086, 186, 286, 386, 486, 586, pentium, 686, PPro, P2, P3 or
|
||||
Katmai. All are case insensitive. All instructions will
|
||||
be selected only if they apply to the selected cpu or lower.
|
||||
Corrected a couple of bugs in cpu-dependence in 'insns.dat'.
|
||||
|
||||
4. Added to 'standard.mac', the "use16" and "use32" forms of
|
||||
the "bits 16/32" directive. This is nothing new, just conforms
|
||||
to a lot of other assemblers. (minor)
|
||||
|
||||
5. Changed label allocation from 320/32 (10000 labels @ 200K+)
|
||||
to 32/37 (1000 labels); makes running under DOS much easier.
|
||||
Since additional label space is allocated dynamically, this
|
||||
should have no effect on large programs with lots of labels.
|
||||
The 37 is a prime, believed to be better for hashing. (minor)
|
||||
|
||||
6. Integrated patchfile 0.98-0.98.01. I call this version
|
||||
0.98.03, for historical reasons: 0.98.02 was trashed.
|
||||
|
||||
--John Coffman <johninsd@san.rr.com> 27-Jul-2000
|
||||
|
||||
(end)
|
@ -102,8 +102,8 @@ static int chsize (operand *, int);
|
||||
static void out (long offset, long segto, void *data, unsigned long type,
|
||||
long segment, long wrt)
|
||||
{
|
||||
static long lineno;
|
||||
static char *lnfname;
|
||||
long lineno;
|
||||
char *lnfname = NULL;
|
||||
|
||||
if ((type & OUT_TYPMASK) == OUT_ADDRESS) {
|
||||
if (segment != NO_SEG || wrt != NO_SEG) {
|
||||
@ -143,7 +143,7 @@ static void out (long offset, long segto, void *data, unsigned long type,
|
||||
if (src_get(&lineno,&lnfname))
|
||||
{
|
||||
outfmt->current_dfmt->linenum(lnfname,lineno,segto);
|
||||
if (lnfname) nasm_free(lnfname);
|
||||
if (lnfname) nasm_free(lnfname);
|
||||
}
|
||||
|
||||
outfmt->output (segto, data, type, segment, wrt);
|
||||
|
16
macros.c
16
macros.c
@ -1,6 +1,12 @@
|
||||
/* This file auto-generated from standard.mac by macros.pl - don't edit it */
|
||||
|
||||
static char *stdmac[] = {
|
||||
"%idefine IDEAL",
|
||||
"%idefine JUMPS",
|
||||
"%idefine P386",
|
||||
"%idefine P486",
|
||||
"%idefine P586",
|
||||
"%idefine END",
|
||||
"%define __NASM_MAJOR__ 0",
|
||||
"%define __NASM_MINOR__ 98",
|
||||
"%define __FILE__",
|
||||
@ -57,6 +63,12 @@ static char *stdmac[] = {
|
||||
"%imacro bits 1+.nolist",
|
||||
"[bits %1]",
|
||||
"%endmacro",
|
||||
"%imacro use16 0.nolist",
|
||||
"[bits 16]",
|
||||
"%endmacro",
|
||||
"%imacro use32 0.nolist",
|
||||
"[bits 32]",
|
||||
"%endmacro",
|
||||
"%imacro global 1-*.nolist",
|
||||
"%rep %0",
|
||||
"[global %1]",
|
||||
@ -69,5 +81,9 @@ static char *stdmac[] = {
|
||||
"%rotate 1",
|
||||
"%endrep",
|
||||
"%endmacro",
|
||||
"%imacro cpu 1+.nolist",
|
||||
"[cpu %1]",
|
||||
"%endmacro",
|
||||
NULL
|
||||
};
|
||||
#define TASM_MACRO_COUNT 6
|
||||
|
BIN
misc/exasm.zip
BIN
misc/exasm.zip
Binary file not shown.
2
nasm.h
2
nasm.h
@ -13,7 +13,7 @@
|
||||
|
||||
#define NASM_MAJOR_VER 0
|
||||
#define NASM_MINOR_VER 98
|
||||
#define NASM_VER "0.98.14"
|
||||
#define NASM_VER "0.98.15"
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
|
@ -924,7 +924,7 @@ delete_Blocks(void)
|
||||
nasm_free(b->chunk);
|
||||
a = b;
|
||||
b = b->next;
|
||||
if (a != &blocks)
|
||||
if (a != &blocks)
|
||||
nasm_free(a);
|
||||
}
|
||||
}
|
||||
|
1378
rdoff/ldrdf.c
1378
rdoff/ldrdf.c
File diff suppressed because it is too large
Load Diff
42
test/multisection.asm
Normal file
42
test/multisection.asm
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
section .stringdata
|
||||
mystr1: db "Hello, this is string 1", 13, 10, '$'
|
||||
|
||||
section .extra_code
|
||||
org 0x200
|
||||
bits 16
|
||||
more:
|
||||
mov si, asciz1
|
||||
mov ah, 0x0E
|
||||
xor bx, bx
|
||||
.print:
|
||||
lodsb
|
||||
test al, al
|
||||
jz .end
|
||||
int 0x10
|
||||
jmp short .print
|
||||
.end:
|
||||
|
||||
xor ax, ax
|
||||
int 0x16
|
||||
|
||||
mov ax, 0x4c00
|
||||
int 0x21
|
||||
|
||||
section .appspecific
|
||||
asciz1: db "This is string 2", 0
|
||||
|
||||
section .code
|
||||
org 0x100
|
||||
bits 16
|
||||
|
||||
start:
|
||||
mov dx, mystr1
|
||||
mov ah, 9
|
||||
int 0x21
|
||||
|
||||
xor ax, ax
|
||||
int 0x16
|
||||
|
||||
jmp more
|
||||
|
Loading…
Reference in New Issue
Block a user