Change log for NASM
===================
+This is the Changelog for the official releases; this is a modified
+version. For the changes from the official release, see the MODIFIED file.
+
0.90 released October 1996
--------------------------
Anvin <hpa@zytor.com>; it is not the original form released by the
NASM authors.
-The changes include:
-1. Merged nasm098p3.zip with nasm-0.97.tar.gz to create a fully
- buildable version for Unix systems (Makefile.in updates, etc.)
+For release 0.98.3.2:
-2. Changed insns.pl to create the instruction tables in nasm.h and
- names.c, so that a new instruction can be added by adding it *only*
- to insns.dat.
+* Merged in John S. Fine's changes from his 0.98-J4 prerelease; see
+ http://www.csoft.net/cz/johnfine/
-3. Added the following new instructions: SYSENTER, SYSEXIT, FXSAVE,
- FXRSTOR, UD1, UD2 (the latter two are two opcodes that Intel
- guarantee will never be used; one of them is documented as UD2 in
- Intel documentation, the other one just as "Undefined Opcode" --
- calling it UD1 seemed to make sense.)
+* Changed previous "spotless" Makefile target (appropriate for distribution)
+ to "distclean", and added "cleaner" target which is same as "clean"
+ except deletes files generated by Perl scripts; "spotless" is union.
+
+* Removed BASIC programs from distribution. Get a Perl interpreter
+ instead (see below.)
+
+* Calling this "pre-release 3.2" rather than "p3-hpa2" because of
+ John's contributions.
+
+* Actually link in the IEEE output format (zoutieee.c); fix a bunch of
+ compiler warnings in that file. Note I don't know what IEEE output
+ is supposed to look like, so these changes were made "blind".
+
+
+For release 0.98p3-hpa:
+
+* Merged nasm098p3.zip with nasm-0.97.tar.gz to create a fully
+ buildable version for Unix systems (Makefile.in updates, etc.)
+
+* Changed insns.pl to create the instruction tables in nasm.h and
+ names.c, so that a new instruction can be added by adding it *only*
+ to insns.dat.
+
+* Added the following new instructions: SYSENTER, SYSEXIT, FXSAVE,
+ FXRSTOR, UD1, UD2 (the latter two are two opcodes that Intel
+ guarantee will never be used; one of them is documented as UD2 in
+ Intel documentation, the other one just as "Undefined Opcode" --
+ calling it UD1 seemed to make sense.)
+
+* A note on the BASIC programs included: forget them. insns.bas is
+ already out of date. Get yourself a Perl interpreter for your
+ platform of choice at:
+
+ http://www.cpan.org/ports/index.html
rm -f *.o nasm ndisasm
cd rdoff; $(MAKE) clean
-spotless: clean
+distclean: clean
rm -f config.* Makefile *~
- cd rdoff; $(MAKE) spotless
+ cd rdoff; $(MAKE) distclean
+
+cleaner: clean
+ rm -f insnsa.c insnsd.c insnsi.h insnsn.c macros.c
+
+spotless: distclean cleaner
rdf:
cd rdoff; $(MAKE)
--- /dev/null
+; NASM macro set to make interfacing to 16-bit programs easier -*- nasm -*-\r
+\r
+%imacro proc 1 ; begin a procedure definition\r
+%push proc\r
+ global %1\r
+%1: push bp\r
+ mov bp,sp\r
+%ifdef FARCODE PASCAL ; arguments may start at bp+4 or bp+6\r
+%assign %$arg 6\r
+%define %$firstarg 6\r
+%else\r
+%assign %$arg 4\r
+%define %$firstarg 4\r
+%endif\r
+%define %$procname %1\r
+%endmacro\r
+\r
+%imacro arg 0-1 2 ; used with the argument name as a label\r
+%00 equ %$arg\r
+ ; we could possibly be adding some\r
+ ; debug information at this point...?\r
+%assign %$arg %1+%$arg\r
+%endmacro\r
+\r
+%imacro endproc 0\r
+%ifnctx proc\r
+%error Mismatched `endproc'/`proc'\r
+%else\r
+ mov sp,bp\r
+ pop bp\r
+%ifdef PASCAL\r
+ retf %$arg - %$firstarg\r
+%elifdef FARCODE\r
+ retf\r
+%else\r
+ retn\r
+%endif\r
+__end_%$procname: ; useful for calculating function size\r
+%pop\r
+%endif\r
+%endmacro\r
--- /dev/null
+; NASM macro set to make interfacing to 32-bit programs easier -*- nasm -*-\r
+\r
+%imacro proc 1 ; begin a procedure definition\r
+%push proc\r
+ global %1\r
+%1: push ebp\r
+ mov ebp,esp\r
+%assign %$arg 8\r
+%define %$procname %1\r
+%endmacro\r
+\r
+%imacro arg 0-1 4 ; used with the argument name as a label\r
+%00 equ %$arg\r
+%assign %$arg %1+%$arg\r
+%endmacro\r
+\r
+%imacro endproc 0\r
+%ifnctx proc\r
+%error Mismatched `endproc'/`proc'\r
+%else\r
+ leave\r
+ ret\r
+__end_%$procname: ; useful for calculating function size\r
+%pop\r
+%endif\r
+%endmacro\r
--- /dev/null
+;This file demonstrates many of the differences between NASM version X and NASM\r
+;version 0.97\r
+;\r
+; changes.asm is copyright (C) 1998 John S. Fine\r
+;\r
+; It may be redistributed under the same conditions as NASM as described in\r
+; Licence file in the NASM archive\r
+;_________________________________\r
+;\r
+; nasm changes.asm -l changes.lst\r
+;\r
+; When assembled without any -d switches, it includes examples which:\r
+; Work correctly in version X\r
+; and Work incorrectly and/or display warnings in version 0.97\r
+; and Do not prevent the generation of output in version 0.97\r
+;\r
+; Not all the differences can be seen in the .lst file. I suggest that you use\r
+; "ndisasm changes" to examine the code actually generated.\r
+;_________________________________\r
+;\r
+; nasm changes.asm -l changes.lst -doldmsg\r
+;\r
+; When assembled with -doldmsg, it adds examples which:\r
+; Work correctly in version X\r
+; and Generate error messages in version 0.97 and do not generate output\r
+;_________________________________\r
+;\r
+; nasm changes.asm -l changes.lst -doldcrash\r
+;\r
+; When assembled with -doldcrash, it adds examples which:\r
+; Work correctly in version X\r
+; and Cause NASM to crash in version 0.97\r
+;_________________________________\r
+;\r
+; nasm changes.asm -l changes.lst -dnewmsg\r
+;\r
+; When assembled with -dnewmsg, it adds examples which:\r
+; Generate error messages in version X\r
+; and Generate wrong output without warning or error message in version 0.97\r
+;-----------------------------------------------------------------------------\r
+\r
+; Please note that I have reported the name of the person who made the\r
+; correction based on very limited information. In several cases, I am sure I\r
+; will identify the wrong author. Please send me any corrections; I don't\r
+; intend to insult or exclude anyone.\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by Simon in assemble()\r
+;\r
+; The following generated "call next" / "call next-1" instead of\r
+; two copies of "call next"\r
+;\r
+ times 2 a16 call next\r
+next:\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by John in parse_line() (and other routines)\r
+;\r
+; This used to jmp to prior.1, when it should be here.1\r
+;\r
+prior:\r
+.1:\r
+here: jmp .1\r
+.1:\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by John in assemble()\r
+;\r
+; Strings used in dq and dt were not zero filled correctly\r
+;\r
+ dq 'b'\r
+\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by Simon in isn_names[]\r
+;\r
+; Was not recognised as an instruction\r
+;\r
+ int01\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by Jim Hague in ???\r
+;\r
+; Forward references were instruction level rather than per operand\r
+;\r
+ shr word [forwardref],1\r
+forwardref:\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by John in preproc.c\r
+;\r
+; It used to silently discard id characters appended to a multi-line\r
+; macro parameter (such as the x in %1x below).\r
+;\r
+%macro xxx 1\r
+%1: nop\r
+%{1}x: jmp %1x\r
+%endmacro\r
+xxx yyy\r
+\r
+%ifdef oldmsg\r
+;***************************************************************\r
+;\r
+; The following examples will generate error messages in 0.97 and will generate\r
+; correct output in the new version.\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by Simon in isns.dat\r
+;\r
+; The optional "near" was not permitted on JMP and CALL\r
+;\r
+ jmp near here\r
+\r
+;-----------------------------------------------------------------------------\r
+; Feature added by Simon in stdscan()\r
+;\r
+; You can now use the numeric value of strings in %assign\r
+;\r
+%assign xxx 'ABCD'\r
+ dd xxx\r
+\r
+;-----------------------------------------------------------------------------\r
+; Feature added by John in add_vectors()\r
+;\r
+; Stranger address expressions are now supported as long as they resolve to\r
+; something valid.\r
+;\r
+ mov ax, [eax + ebx + ecx - eax]\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by Simon in ???\r
+;\r
+; The EQU directive affected local labels in a way that was inconsistent\r
+; between passes\r
+;\r
+.local:\r
+neither equ $\r
+ jmp .local\r
+\r
+;-----------------------------------------------------------------------------\r
+; Feature added by Jules in parse_line\r
+;\r
+; You can override a size specifier\r
+;\r
+%define arg1 dword [bp+4]\r
+ cmp word arg1, 2\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by John in preproc.c\r
+;\r
+; You could not use a label on the same line with a macro invocation, if the\r
+; macro definition began with a preprocessor directive.\r
+;\r
+ struc mytype\r
+.long resd 1\r
+ endstruc\r
+\r
+lbl istruc mytype\r
+ at mytype.long, dd 'ABCD'\r
+ iend\r
+\r
+;-----------------------------------------------------------------------------\r
+; Warning removed by John in preproc.c\r
+;\r
+; In order to allow macros that extend the definition of instructions, I\r
+; disabled the warning on a multi-line macro referencing itself.\r
+;\r
+%endif ;NASM 0.97 doesn't handle %0 etc. inside false %if\r
+%macro push 1-* ;\r
+%rep %0 ;\r
+push %1 ;\r
+%rotate 1 ;\r
+%endrep ;\r
+%endmacro ;\r
+%ifdef oldmsg ;\r
+\r
+ push ax,bx\r
+\r
+;-----------------------------------------------------------------------------\r
+; Warning removed by John in preproc.c\r
+;\r
+; To support other types of macros that extend the definition of instructions,\r
+; I disabled the warning on a multi-line macro called with the wrong number of\r
+; parameters. PUSH and POP can be extended equally well by either method, but\r
+; other intruction extensions may need one method or the other, so I made both\r
+; work.\r
+;\r
+; Note that neither of these warnings was really needed, because a later stage\r
+; of NASM would almost always give an adequate error message if the macro use\r
+; really was wrong.\r
+;\r
+%endif\r
+%macro pop 2-*\r
+%rep %0\r
+pop %1\r
+%rotate 1\r
+%endrep\r
+%endmacro\r
+%ifdef oldmsg\r
+\r
+ pop ax,bx\r
+%endif\r
+\r
+\r
+%ifdef newmsg ;***************************************************************\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by John in parse_line() (and other routines)\r
+;\r
+; This invalid code used to assemble without errors\r
+;\r
+myself equ myself+1\r
+ jmp myself\r
+\r
+;-----------------------------------------------------------------------------\r
+; Change made by John in preproc.c\r
+;\r
+; In 0.97, an id that appears as a label on a macro invocation was always\r
+; prepended to the first line of the macro expansion. That caused several\r
+; bugs, but also could be used in tricks like the arg macro in c16.mac and\r
+; c32.mac.\r
+;\r
+; In version X, an id that appears as a label on a macro invocation will\r
+; normally be defined as a label for the address at which the macro is\r
+; invoked, regardless of whether the first line of the macro expansion is\r
+; something that can take a label. The new token %00 may be used for any\r
+; of the situations in which the old prepend behavior was doing something\r
+; tricky but useful. %00 can also be used more than once and in places\r
+; other than the start of the expansion.\r
+;\r
+%endif\r
+%assign arg_off 0\r
+\r
+%imacro arg 0-1 2 ;arg defined the old way\r
+ equ arg_off\r
+%assign arg_off %1+arg_off\r
+%endmacro\r
+\r
+%ifdef newmsg\r
+arg_example arg\r
+%endif\r
+\r
+%imacro arg2 0-1 2 ;arg defined the new way\r
+%00 equ arg_off\r
+%assign arg_off %1+arg_off\r
+%endmacro\r
+\r
+%ifdef oldmsg\r
+arg_example2 arg2\r
+\r
+;-----------------------------------------------------------------------------\r
+; Change made by Jules and John in INSNS.DAT\r
+;\r
+; Various instruction in which the size of an immediate is built-in to the\r
+; instruction set, now allow you to redundantly specify that size as long\r
+; as you specify it correctly\r
+;\r
+ AAD byte 5\r
+ AAM byte 5\r
+ BT bx, byte 3\r
+ BTC cx, byte 4\r
+ BTR dx, byte 5\r
+ BTS si, byte 6\r
+ IN eax, byte 0x40\r
+ INT byte 21h\r
+ OUT byte 70h, ax\r
+ RET word 2\r
+ RETN word 2\r
+ RETF word 4\r
+\r
+; note "ENTER" has not been changed yet.\r
+ \r
+%endif\r
+\r
+%ifdef oldcrash ;*************************************************************\r
+\r
+This_label_is_256_characters_long__There_used_to_be_a_bug_in_stdscan_which_made_it_crash_when_it_did_a_keyword_search_on_any_label_longer_than_255_characters__Now_anything_longer_than_MAX_KEYWORD_is_always_a_symbol__It_will_not_even_try_a_keyword_search___\r
+\r
+;-----------------------------------------------------------------------------\r
+; Bug fixed by John in preproc.c\r
+;\r
+; Builds of NASM that prohibit dereferencing a NULL pointer used to crash if a\r
+; macro that started with a blank line was invoked with a label\r
+;\r
+%macro empty_macro 0\r
+\r
+%endm\r
+\r
+emlabel empty_macro\r
+ jmp emlabel\r
+\r
+%endif\r
break;
}
- /*
- * Since the whole line is parsed before the label it
- * defines is given to the label manager, we have
- * problems with lines such as
- *
- * end: TIMES 512-(end-start) DB 0
- *
- * where `end' is not known on pass one, despite not
- * really being a forward reference, and due to
- * criticality it is _needed_. Hence we check our label
- * against the currently defined one, and do our own
- * resolution of it if we have to.
- */
type = EXPR_SIMPLE; /* might get overridden by UNKNOWN */
- if (i == TOKEN_BASE) {
+ if (i == TOKEN_BASE)
+ {
label_seg = location->segment;
label_ofs = 0;
} else if (i == TOKEN_HERE) {
label_seg = location->segment;
label_ofs = location->offset;
- } else if (!labelfunc(tokval->t_charptr,&label_seg,&label_ofs)) {
+ } else {
+ if (!labelfunc(tokval->t_charptr,&label_seg,&label_ofs))
+ {
if (critical == 2) {
error (ERR_NONFATAL, "symbol `%s' undefined",
tokval->t_charptr);
return NULL;
} else if (critical == 1) {
- error (ERR_NONFATAL, "symbol `%s' not defined before use",
+ error (ERR_NONFATAL,
+ "symbol `%s' not defined before use",
tokval->t_charptr);
return NULL;
} else {
label_ofs = 1;
}
}
- addtotemp(type, label_ofs);
- if (label_seg!=NO_SEG) {
- addtotemp(EXPR_SEGBASE + label_seg, 1L);
if (opflags && is_extern (tokval->t_charptr))
*opflags |= OPFLAG_EXTERN;
}
+ addtotemp(type, label_ofs);
+ if (label_seg!=NO_SEG)
+ addtotemp(EXPR_SEGBASE + label_seg, 1L);
break;
}
i = scan(scpriv, tokval);
--- /dev/null
+; -*- nasm -*-\r
+; NASM macro file to allow the `bin' output format to generate\r
+; simple .EXE files by constructing the EXE header by hand.\r
+; Adapted from a contribution by Yann Guidon <whygee_corp@hol.fr>\r
+\r
+%define EXE_stack_size EXE_realstacksize\r
+\r
+%macro EXE_begin 0\r
+ ORG 0E0h\r
+ section .text\r
+\r
+header_start:\r
+ db 4Dh,5Ah ; EXE file signature\r
+ dw EXE_allocsize % 512\r
+ dw (EXE_allocsize + 511) / 512\r
+ dw 0 ; relocation information: none\r
+ dw (header_end-header_start)/16 ; header size in paragraphs\r
+ dw (EXE_absssize + EXE_realstacksize) / 16 ; min extra mem\r
+ dw (EXE_absssize + EXE_realstacksize) / 16 ; max extra mem\r
+ dw -10h ; Initial SS (before fixup)\r
+ dw EXE_endbss + EXE_realstacksize ; Initial SP (1K DPMI+1K STACK)\r
+ dw 0 ; (no) Checksum\r
+ dw 100h ; Initial IP - start just after the header\r
+ dw -10h ; Initial CS (before fixup)\r
+ dw 0 ; file offset to relocation table: none\r
+ dw 0 ; (no overlay)\r
+ align 16,db 0\r
+header_end:\r
+\r
+EXE_startcode:\r
+ section .data\r
+EXE_startdata:\r
+ section .bss\r
+EXE_startbss:\r
+%endmacro\r
+\r
+%macro EXE_stack 1\r
+EXE_realstacksize equ %1\r
+%define EXE_stack_size EXE_bogusstacksize ; defeat EQU in EXE_end\r
+%endmacro\r
+\r
+%macro EXE_end 0\r
+ section .text\r
+EXE_endcode:\r
+ section .data\r
+EXE_enddata:\r
+ section .bss\r
+ alignb 4\r
+EXE_endbss:\r
+\r
+EXE_acodesize equ (EXE_endcode-EXE_startcode+3) & (~3)\r
+EXE_datasize equ EXE_enddata-EXE_startdata\r
+EXE_absssize equ (EXE_endbss-EXE_startbss+3) & (~3)\r
+EXE_allocsize equ EXE_acodesize + EXE_datasize\r
+\r
+EXE_stack_size equ 0x800 ; default if nothing else was used\r
+%endmacro\r
+++ /dev/null
-' INFO_1: Converter for INSNS.DAT to INSNSA.C and INSNSD.C
-'
-' INFO_2: Written by Mark Junker in 1997
-' InterNet: mjs@prg.hannover.sgh-net.de
-' FIDO: Mark Junker@2:2437/47.21
-'
-' COMMENT: While I wrote this program I often asked me, if it isn't easier
-' to write an interpreter for Perl-scripts :]
-'
-' COMMENT: To start the program press SHIFT+F5 within the QBasic IDE
-' or start it from the command-line with QBASIC /RUN MACROS
-'
-'
-' THIS PROGRAM NEEDS TO BE UPDATED -- it doesn't create insnsi.h
-' and insnsn.c. However, Perl interpreters are now available for both
-' DOS and Windows, so it seems pointless to spend the effort.
-'
-
-DEFINT A-Z
-
-DECLARE FUNCTION ReplaceOp$ (a$)
-DECLARE FUNCTION StrTrimLeft$ (a$, b$)
-DECLARE FUNCTION StrTrimRight$ (a$, b$)
-DECLARE FUNCTION StrTrim$ (a$, b$)
-DECLARE SUB StrSplitString (SplitString$, SplitChars$, SplitField$(), SplitCount%)
-DECLARE FUNCTION Min% (a%, b%)
-DECLARE FUNCTION StrInstrLeft% (SearchStart%, SearchIn$, SearchFor$)
-DECLARE FUNCTION StrAscii% (a$)
-
-
-CONST MaxOpCodeBase = 3
-CONST MaxOpCodeType = 8
-
-CLS
-DIM LineData$(1 TO 2)
-DIM StrucData$(1 TO 5)
-DIM OpCodeList$(0 TO 255)
-DIM OpCodeByte(1 TO MaxOpCodeType, 1 TO MaxOpCodeBase)
-DIM OpCodeStat(1 TO 10) ' don't need mode :)
-
-Instructs$ = ""
-LineOfs$ = ""
-
-OPEN "I", 1, "insns.dat"
-OPEN "B", 3, "insns.tmp"
-
-qt$ = CHR$(34)
-crlf$ = CHR$(13) + CHR$(10)
-
-
-'
-' preprocessing the current file
-'
-
-HexChar$ = "0123456789ABCDEF"
-
-PRINT "Preprocessing INSNS.DAT"
-OpCodes = 0
-OpCodeDebug = 0
-NowLineOfs& = 1
-lineNr = 0
-WHILE NOT EOF(1)
- lineNr = lineNr + 1
- IF (lineNr AND 15) = 0 THEN
- LOCATE , 1
- PRINT lineNr, OpCodes, OpCodeDebug;
- END IF
-
- LINE INPUT #1, l$
- CALL StrSplitString(l$, ";", LineData$(), SplitCount)
- IF SplitCount THEN
- LineData$(1) = StrTrim$(LineData$(1), CHR$(9) + " ")
- IF LEN(LineData$(1)) THEN
- CALL StrSplitString(LineData$(1), " ", StrucData$(), cntSplit)
- IF cntSplit <> 4 THEN
- PRINT "line"; lineNr; " does not contain four fields"
- END
- END IF
-
- tst$ = UCASE$(StrucData$(2))
- res$ = ""
- cnt% = 1
- isfirst = 1
- op = 1
- p = StrInstrLeft(1, tst$ + ",", "|:,")
- WHILE p
- h$ = ReplaceOp$(MID$(tst$, op, p - op))
- IF LEN(h$) THEN
- SELECT CASE MID$(tst$, p, 1)
- CASE ""
- IF isfirst THEN
- res$ = res$ + h$
- ELSE
- res$ = res$ + "|" + h$
- END IF
- isfirst = 0
- CASE ","
- IF isfirst THEN
- res$ = res$ + h$ + ","
- ELSE
- res$ = res$ + "|" + h$ + ","
- END IF
- cnt% = cnt% + 1
- isfirst = 1
- CASE "|"
- IF isfirst THEN
- res$ = res$ + h$
- ELSE
- res$ = res$ + "|" + h$
- END IF
- isfirst = 0
- CASE ":"
- res$ = res$ + h$ + "|COLON,"
- cnt% = cnt% + 1
- END SELECT
- END IF
- op = p + 1
- p = StrInstrLeft(op, tst$ + ",", "|:,")
- WEND
- FOR a = cnt% + 1 TO 3
- res$ = res$ + ",0"
- NEXT
- StrucData$(2) = res$
- IF LEFT$(res$, 2) = "0," THEN cnt% = cnt% - 1
- StrucData$(5) = LTRIM$(STR$(cnt%))
-
- NoDebug = 0
- res$ = ""
- tst$ = UCASE$(StrucData$(4))
- op = 1
- p = INSTR(tst$ + ",", ",")
- isfirst = 1
- WHILE p
- h$ = MID$(tst$, op, p - op)
- IF h$ = "ND" THEN
- NoDebug = 1
- ELSE
- IF isfirst THEN
- res$ = res$ + "IF_" + h$
- ELSE
- res$ = res$ + "|IF_" + h$
- END IF
- isfirst = 0
- END IF
- op = p + 1
- p = INSTR(op, tst$ + ",", ",")
- WEND
- StrucData$(4) = res$
-
- tst$ = UCASE$(StrucData$(3))
- SELECT CASE tst$
- CASE "IGNORE"
- GOTO skipOpCode
- CASE "\0", "\340"
- OpCodeDebug = OpCodeDebug + 1 ' don't forget to increment
- GOTO skipOpCode
- END SELECT
-
- AddRegs = 0
- AddCCode = 0
- NextIsOpCode = 0
- opCodeVal$ = ""
- op = 1
- p = INSTR(tst$ + "\", "\")
- DO WHILE p
- h$ = MID$(tst$, op, p - op)
- IF LEFT$(h$, 1) = "X" THEN
- opCodeVal$ = CHR$(VAL("&H" + MID$(h$, 2)))
- EXIT DO
- ELSE
- SELECT CASE h$
- CASE "1", "2", "3"
- NextIsOpCode = 1
- CASE "4"
- opCodeVal$ = CHR$(&H7) + CHR$(&H17) + CHR$(&H1F)
- EXIT DO
- CASE "5"
- opCodeVal$ = CHR$(&HA1) + CHR$(&HA9)
- EXIT DO
- CASE "6"
- opCodeVal$ = CHR$(&H6) + CHR$(&HE) + CHR$(&H16) + CHR$(&H1E)
- EXIT DO
- CASE "7"
- opCodeVal$ = CHR$(&HA0) + CHR$(&HA8)
- EXIT DO
- CASE "10", "11", "12"
- NextIsOpCode = 1
- AddRegs = VAL(h$) - 9
- CASE "330"
- NextIsOpCode = 1
- AddCCode = VAL(h$) - 329
- CASE "17"
- opCodeVal$ = CHR$(0)
- EXIT DO
- CASE ELSE
- IF NextIsOpCode THEN
- PRINT "Line:"; lineNr
- PRINT "Unknown value: " + h$
- END
- END IF
- END SELECT
- END IF
- op = p + 1
- p = INSTR(op, tst$ + "\", "\")
- LOOP
- IF (p = 0) THEN
- PRINT "No opcode found in line"; lineNr
- PRINT "Line:"
- PRINT l$
- END
- END IF
-
- IF NoDebug = 0 THEN
- FOR a = 1 TO LEN(opCodeVal$)
- h = ASC(MID$(opCodeVal$, a, 1))
- OpCodeStr$ = MKI$(OpCodeDebug)
- IF AddRegs THEN
- EndNr = 7
- ELSEIF AddCCode THEN
- EndNr = 15
- ELSE
- EndNr = 0
- END IF
- FOR b = 0 TO EndNr
- OpCodeList$(h + b) = OpCodeList$(h + b) + OpCodeStr$
- NEXT
- NEXT
- OpCodeDebug = OpCodeDebug + 1
- END IF
-
-skipOpCode:
- OpCodes = OpCodes + 1
- LineOfs$ = LineOfs$ + MKL$(NowLineOfs&)
- LineLg = 1
- h$ = CHR$(NoDebug)
- PUT #3, NowLineOfs&, h$
- NowLineOfs& = NowLineOfs& + 1
- FOR a = 1 TO 5
- lg = LEN(StrucData$(a))
- h$ = CHR$(lg) + StrucData$(a)
- PUT #3, NowLineOfs&, h$
- NowLineOfs& = NowLineOfs& + lg + 1
- LineLg = LineLg + lg + 1
- NEXT
- LineOfs$ = LineOfs$ + MKI$(LineLg)
- END IF
- END IF
-WEND
-LOCATE , 1
-PRINT lineNr, OpCodes, OpCodeDebug
-
-
-'
-' creating insnsa.c
-'
-
-
-PRINT "Creating INSNSA.C"
-
-OPEN "O", 2, "insnsa.c"
-strBegStart$ = "static struct itemplate instrux_"
-strBegEnd$ = "[] = {"
-strEnd$ = " {-1}" + crlf$ + "};" + crlf$
-
-PRINT #2, "/* This file auto-generated from insns.dat by insns.bas - don't edit it */"
-PRINT #2, ""
-PRINT #2, "#include <stdio.h>"
-PRINT #2, "#include " + qt$ + "nasm.h" + qt$
-PRINT #2, "#include " + qt$ + "insns.h" + qt$
-PRINT #2, ""
-
-oldOpCode$ = ""
-pOfs = 1
-FOR a = 1 TO OpCodes
- LineOfs& = CVL(MID$(LineOfs$, pOfs, 4))
- l$ = SPACE$(CVI(MID$(LineOfs$, pOfs + 4, 2)))
- pOfs = pOfs + 6
- GET #3, LineOfs&, l$
-
- ' split data into fields
- NoDebug = ASC(LEFT$(l$, 1))
- pLn = 2
- FOR b = 1 TO 5
- lgLn = ASC(MID$(l$, pLn, 1))
- StrucData$(b) = MID$(l$, pLn + 1, lgLn)
- pLn = pLn + lgLn + 1
- NEXT
-
- IF oldOpCode$ <> StrucData$(1) THEN
- Instructs$ = Instructs$ + StrucData$(1) + CHR$(0)
- IF LEN(oldOpCode$) THEN PRINT #2, strEnd$
- PRINT #2, strBegStart$ + StrucData$(1) + strBegEnd$
- oldOpCode$ = StrucData$(1)
- END IF
- SELECT CASE UCASE$(StrucData$(3))
- CASE "IGNORE"
- CASE ELSE
- PRINT #2, " {I_" + oldOpCode$ + ", " + StrucData$(5) + ", {" + StrucData$(2) + "}, " + qt$ + StrucData$(3) + qt$ + ", " + StrucData$(4) + "},"
- END SELECT
-NEXT
-IF LEN(oldOpCode$) THEN PRINT #2, strEnd$
-
-PRINT #2, "struct itemplate *nasm_instructions[] = {"
-op = 1
-p = INSTR(Instructs$, CHR$(0))
-WHILE p
- h$ = MID$(Instructs$, op, p - op)
- PRINT #2, " instrux_" + h$ + ","
- op = p + 1
- p = INSTR(op, Instructs$, CHR$(0))
-WEND
-PRINT #2, "};"
-
-CLOSE 2
-
-
-
-'
-' creating insnsd.c
-'
-
-
-PRINT "Creating INSNSD.C"
-
-OPEN "O", 2, "insnsd.c"
-
-PRINT #2, "/* This file auto-generated from insns.dat by insns.bas - don't edit it */"
-PRINT #2, ""
-PRINT #2, "#include <stdio.h>"
-PRINT #2, "#include " + qt$ + "nasm.h" + qt$
-PRINT #2, "#include " + qt$ + "insns.h" + qt$
-PRINT #2, ""
-
-
-PRINT #2, "static struct itemplate instrux[] = {"
-pOfs = 1
-FOR a = 1 TO OpCodes
- LineOfs& = CVL(MID$(LineOfs$, pOfs, 4))
- l$ = SPACE$(CVI(MID$(LineOfs$, pOfs + 4, 2)))
- pOfs = pOfs + 6
- GET #3, LineOfs&, l$
-
- ' split data into fields
- NoDebug = ASC(LEFT$(l$, 1))
- pLn = 2
- FOR b = 1 TO 5
- lgLn = ASC(MID$(l$, pLn, 1))
- StrucData$(b) = MID$(l$, pLn + 1, lgLn)
- pLn = pLn + lgLn + 1
- NEXT
-
- IF NoDebug OR (UCASE$(StrucData$(3)) = "IGNORE") THEN
- ' ignorieren
- ELSE
- PRINT #2, " {I_" + StrucData$(1) + ", " + StrucData$(5) + ", {" + StrucData$(2) + "}, " + qt$ + StrucData$(3) + qt$ + ", " + StrucData$(4) + "},"
- END IF
-NEXT
-PRINT #2, " {-1}" + crlf$ + "};" + crlf$
-
-
-OpCodeBegS$ = "static struct itemplate *itable_"
-OpCodeBegE$ = "[] = {"
-OpCodeEnd$ = " NULL" + crlf$ + "};" + crlf$
-
-FOR a = 0 TO 255
- PRINT #2, OpCodeBegS$ + RIGHT$("00" + HEX$(a), 2) + OpCodeBegE$
- h$ = OpCodeList$(a)
- FOR b = 1 TO LEN(h$) STEP 2
- OpCodePos = CVI(MID$(h$, b, 2))
- PRINT #2, " instrux +" + STR$(OpCodePos) + ","
- NEXT
- PRINT #2, OpCodeEnd$
-NEXT
-
-PRINT #2, "struct itemplate **itable[] = {"
-FOR a = 0 TO 255
- PRINT #2, " itable_" + RIGHT$("00" + HEX$(a), 2) + ","
-NEXT
-PRINT #2, "};"
-
-CLOSE 2
-
-
-
-CLOSE 3
-KILL "insns.tmp"
-CLOSE 1
-SYSTEM
-
-FUNCTION ReplaceOp$ (a$)
- tst$ = UCASE$(a$)
- SELECT CASE tst$
-' CASE "ND"
-' ReplaceOp$ = ""
- CASE "VOID", ""
- ReplaceOp$ = "0"
- CASE "IMM"
- ReplaceOp$ = "IMMEDIATE"
- CASE "MEM"
- ReplaceOp$ = "MEMORY"
- CASE "MEM8", "MEM16", "MEM32", "MEM64", "MEM80"
- ReplaceOp$ = "MEMORY|BITS" + MID$(tst$, 4)
- CASE "REG8", "REG16", "REG32"
- ReplaceOp$ = tst$
- CASE "RM8", "RM16", "RM32"
- ReplaceOp$ = "REGMEM|BITS" + MID$(tst$, 3)
- CASE "IMM8", "IMM16", "IMM32"
- ReplaceOp$ = "IMMEDIATE|BITS" + MID$(tst$, 4)
- CASE ELSE
- ReplaceOp$ = tst$
- END SELECT
-END FUNCTION
-
-FUNCTION Min% (a%, b%)
- IF a% < b% THEN Min% = a% ELSE Min% = b%
-END FUNCTION
-
-FUNCTION StrAscii (a$)
- IF LEN(a$) = 0 THEN
- StrAscii = -1
- ELSE
- StrAscii = ASC(a$)
- END IF
-END FUNCTION
-
-' same as =INSTR(SearchStart, SearchIn, ANY SearchFor$) in PowerBASIC(tm)
-'
-FUNCTION StrInstrLeft (SearchStart, SearchIn$, SearchFor$)
- ValuesCount = LEN(SearchFor$)
- MaxValue = LEN(SearchIn$) + 1
- MinValue = MaxValue
- FOR Counter1 = 1 TO ValuesCount
- SearchChar$ = MID$(SearchFor$, Counter1, 1)
- hVal2 = INSTR(SearchStart, SearchIn$, SearchChar$)
- IF hVal2 > 0 THEN MinValue = Min%(hVal2, MinValue)
- NEXT
- IF MinValue = MaxValue THEN MinValue = 0
- StrInstrLeft = MinValue
-END FUNCTION
-
-'
-' This is a very damn fuckin' shit version of this splitting routine.
-' At this time, it's not very useful :]
-'
-SUB StrSplitString (SplitString$, SplitChars$, SplitField$(), SplitCount)
- StartIndex = LBOUND(SplitField$)
- LastIndex = UBOUND(SplitField$)
- ActualIndex& = StartIndex
- SplitCount = 0
-
- LastPos = 1
- FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$ + CHR$(34))
- GetDirect = 0
- EndLoop = 0
- TempString$ = ""
- DO WHILE FoundPos > 0
- FoundCharVal = StrAscii(MID$(SplitString$, FoundPos, 1))
- PosDiff = (FoundPos - LastPos) + 1
- SELECT CASE FoundCharVal
- CASE 34
- TempString$ = TempString$ + MID$(SplitString$, LastPos, PosDiff - 1)
- SELECT CASE EndLoop
- CASE 0
- EndLoop = 2
- CASE 3
- EndLoop = 0
- END SELECT
- CASE ELSE
- TempString$ = TempString$ + MID$(SplitString$, LastPos, PosDiff - 1)
- SplitField$(ActualIndex&) = TempString$
- TempString$ = ""
- ActualIndex& = ActualIndex& + 1
- IF ActualIndex& > LastIndex THEN
- ActualIndex& = LastIndex
- EndLoop = 1
- END IF
- END SELECT
- SELECT CASE EndLoop
- CASE 0
- DO
- LastPos = FoundPos + 1
- FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$)
- LOOP WHILE LastPos = FoundPos
- FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$ + CHR$(34))
- CASE 1
- FoundPos = 0
- LastPos = LEN(SplitString$) + 1
- CASE 2
- EndLoop = 3
- LastPos = FoundPos + 1
- FoundPos = StrInstrLeft(LastPos, SplitString$, CHR$(34))
- IF FoundPos = 0 THEN
- SplitString$ = SplitString$ + CHR$(34)
- FoundPos = LEN(SplitString$)
- END IF
- END SELECT
- LOOP
- IF EndLoop = 0 THEN
- IF LEN(TempString$) > 0 THEN
- SplitField$(ActualIndex&) = TempString$
- ELSEIF LastPos <= LEN(SplitString$) THEN
- SplitField$(ActualIndex&) = MID$(SplitString$, LastPos)
- ELSE
- ActualIndex& = ActualIndex& - 1
- END IF
- END IF
- FOR a = ActualIndex& + 1 TO LastIndex
- SplitField$(a) = ""
- NEXT
- SplitCount = (ActualIndex& - StartIndex) + 1
-END SUB
-
-FUNCTION StrTrim$ (a$, b$)
- StrTrim$ = StrTrimRight$(StrTrimLeft$(a$, b$), b$)
-END FUNCTION
-
-FUNCTION StrTrimLeft$ (a$, b$) 'public
- p = 0
- l = LEN(a$)
- DO
- p = p + 1
- t$ = MID$(a$, p, 1)
- LOOP WHILE (p < l) AND (INSTR(b$, t$) > 0)
- StrTrimLeft$ = MID$(a$, p)
-END FUNCTION
-
-FUNCTION StrTrimRight$ (a$, b$) 'public
- l = LEN(a$)
- p = l + 1
- DO
- p = p - 1
- IF p > 0 THEN
- t$ = MID$(a$, p, 1)
- ELSE
- t$ = ""
- END IF
- LOOP WHILE (p > 0) AND (INSTR(b$, t$) > 0)
- StrTrimRight$ = LEFT$(a$, p)
-END FUNCTION
-
-\1a
\ No newline at end of file
AAA void \1\x37 8086
AAD void \2\xD5\x0A 8086
-AAD imm \1\xD5\24 8086
+AAD imm \1\xD5\24 8086,SB\r
AAM void \2\xD4\x0A 8086
-AAM imm \1\xD4\24 8086
+AAM imm \1\xD4\24 8086,SB\r
AAS void \1\x3F 8086
ADC mem,reg8 \300\1\x10\101 8086,SM
ADC reg8,reg8 \300\1\x10\101 8086
BT reg16,reg16 \320\300\2\x0F\xA3\101 386
BT mem,reg32 \321\300\2\x0F\xA3\101 386,SM
BT reg32,reg32 \321\300\2\x0F\xA3\101 386
-BT rm16,imm \320\300\2\x0F\xBA\204\25 386
-BT rm32,imm \321\300\2\x0F\xBA\204\25 386
+BT rm16,imm \320\300\2\x0F\xBA\204\25 386,SB\r
+BT rm32,imm \321\300\2\x0F\xBA\204\25 386,SB\r
BTC mem,reg16 \320\300\2\x0F\xBB\101 386,SM
BTC reg16,reg16 \320\300\2\x0F\xBB\101 386
BTC mem,reg32 \321\300\2\x0F\xBB\101 386,SM
BTC reg32,reg32 \321\300\2\x0F\xBB\101 386
-BTC rm16,imm \320\300\2\x0F\xBA\207\25 386
-BTC rm32,imm \321\300\2\x0F\xBA\207\25 386
+BTC rm16,imm \320\300\2\x0F\xBA\207\25 386,SB\r
+BTC rm32,imm \321\300\2\x0F\xBA\207\25 386,SB\r
BTR mem,reg16 \320\300\2\x0F\xB3\101 386,SM
BTR reg16,reg16 \320\300\2\x0F\xB3\101 386
BTR mem,reg32 \321\300\2\x0F\xB3\101 386,SM
BTR reg32,reg32 \321\300\2\x0F\xB3\101 386
-BTR rm16,imm \320\300\2\x0F\xBA\206\25 386
-BTR rm32,imm \321\300\2\x0F\xBA\206\25 386
+BTR rm16,imm \320\300\2\x0F\xBA\206\25 386,SB\r
+BTR rm32,imm \321\300\2\x0F\xBA\206\25 386,SB\r
BTS mem,reg16 \320\300\2\x0F\xAB\101 386,SM
BTS reg16,reg16 \320\300\2\x0F\xAB\101 386
BTS mem,reg32 \321\300\2\x0F\xAB\101 386,SM
BTS reg32,reg32 \321\300\2\x0F\xAB\101 386
-BTS rm16,imm \320\300\2\x0F\xBA\205\25 386
-BTS rm32,imm \321\300\2\x0F\xBA\205\25 386
+BTS rm16,imm \320\300\2\x0F\xBA\205\25 386,SB\r
+BTS rm32,imm \321\300\2\x0F\xBA\205\25 386,SB\r
CALL imm \322\1\xE8\64 8086
CALL imm|near \322\1\xE8\64 8086
CALL imm|far \322\1\x9A\34\37 8086,ND
IMUL reg16,imm \320\1\x69\100\31 286,SM
IMUL reg32,imm8 \321\1\x6B\100\15 386
IMUL reg32,imm \321\1\x69\100\41 386,SM
-IN reg_al,imm \1\xE4\25 8086
-IN reg_ax,imm \320\1\xE5\25 8086
-IN reg_eax,imm \321\1\xE5\25 386
+IN reg_al,imm \1\xE4\25 8086,SB\r
+IN reg_ax,imm \320\1\xE5\25 8086,SB\r
+IN reg_eax,imm \321\1\xE5\25 386,SB\r
IN reg_al,reg_dx \1\xEC 8086
IN reg_ax,reg_dx \320\1\xED 8086
IN reg_eax,reg_dx \321\1\xED 386
INSB void \1\x6C 186
INSD void \321\1\x6D 386
INSW void \320\1\x6D 186
-INT imm \1\xCD\24 8086
+INT imm \1\xCD\24 8086,SB\r
INT01 void \1\xF1 P6,ND
INT1 void \1\xF1 P6
INT3 void \1\xCC 8086
REST ignore ignore ignore
RESW ignore ignore ignore
RET void \1\xC3 8086
-RET imm \1\xC2\30 8086
+RET imm \1\xC2\30 8086,SW\r
RETF void \1\xCB 8086
-RETF imm \1\xCA\30 8086
+RETF imm \1\xCA\30 8086,SW\r
RETN void \1\xC3 8086
-RETN imm \1\xC2\30 8086
+RETN imm \1\xC2\30 8086,SW\r
ROL rm8,unity \300\1\xD0\200 8086
ROL rm8,reg_cl \300\1\xD2\200 8086
ROL rm8,imm \300\1\xC0\200\25 186,SB
+++ /dev/null
-' INFO_1: Converter for STANDARD.MAC to MACRO.C
-'
-' INFO_2: Written by Mark Junker in 1997
-' InterNet: mjs@prg.hannover.sgh-net.de
-' FIDO: Mark Junker@2:2437/47.21
-'
-' COMMENT: To start the program press SHIFT+F5 within the QBasic IDE
-' or start it from the command-line with QBASIC /RUN MACROS
-'
-
-DEFINT A-Z
-
-DECLARE FUNCTION StrTrimLeft$ (a$, b$)
-DECLARE FUNCTION StrTrimRight$ (a$, b$)
-DECLARE FUNCTION StrTrim$ (a$, b$)
-DECLARE SUB StrSplitString (SplitString$, SplitChars$, SplitField$(), SplitCount%)
-DECLARE FUNCTION Min% (a%, b%)
-DECLARE FUNCTION StrInstrLeft% (SearchStart%, SearchIn$, SearchFor$)
-DECLARE FUNCTION StrAscii% (a$)
-
-
-CLS
-DIM LineData$(1 TO 2)
-
-OPEN "I", 1, "STANDARD.MAC"
-OPEN "O", 2, "macros.c"
-
-PRINT #2, "/* This file auto-generated from standard.mac by macros.bas - don't edit it */"
-PRINT #2, ""
-PRINT #2, "static char *stdmac[] = {"
-
-WHILE NOT EOF(1)
- LINE INPUT #1, l$
- CALL StrSplitString(l$, ";", LineData$(), SplitCount)
- IF SplitCount THEN
- LineData$(1) = StrTrim$(LineData$(1), CHR$(9) + " ")
- IF LEN(LineData$(1)) THEN
- PRINT #2, " " + CHR$(34) + LineData$(1) + CHR$(34) + ","
- END IF
- END IF
-WEND
-PRINT #2, " NULL"
-PRINT #2, "};"
-
-CLOSE 2
-CLOSE 1
-SYSTEM
-
-FUNCTION Min% (a%, b%)
- IF a% < b% THEN Min% = a% ELSE Min% = b%
-END FUNCTION
-
-FUNCTION StrAscii (a$)
- IF LEN(a$) = 0 THEN
- StrAscii = -1
- ELSE
- StrAscii = ASC(a$)
- END IF
-END FUNCTION
-
-' same as =INSTR(SearchStart, SearchIn, ANY SearchFor$) in PowerBASIC(tm)
-'
-FUNCTION StrInstrLeft (SearchStart, SearchIn$, SearchFor$)
- ValuesCount = LEN(SearchFor$)
- MaxValue = LEN(SearchIn$) + 1
- MinValue = MaxValue
- FOR Counter1 = 1 TO ValuesCount
- SearchChar$ = MID$(SearchFor$, Counter1, 1)
- hVal2 = INSTR(SearchStart, SearchIn$, SearchChar$)
- IF hVal2 > 0 THEN MinValue = Min%(hVal2, MinValue)
- NEXT
- IF MinValue = MaxValue THEN MinValue = 0
- StrInstrLeft = MinValue
-END FUNCTION
-
-'
-' This is a very damn fuckin' shit version of this splitting routine.
-' At this time, it's not very useful :]
-'
-SUB StrSplitString (SplitString$, SplitChars$, SplitField$(), SplitCount)
- StartIndex = LBOUND(SplitField$)
- LastIndex = UBOUND(SplitField$)
- ActualIndex& = StartIndex
- SplitCount = 0
-
- LastPos = 1
- FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$ + CHR$(34))
- GetDirect = 0
- EndLoop = 0
- TempString$ = ""
- DO WHILE FoundPos > 0
- FoundCharVal = StrAscii(MID$(SplitString$, FoundPos, 1))
- PosDiff = (FoundPos - LastPos) + 1
- SELECT CASE FoundCharVal
- CASE 34
- TempString$ = TempString$ + MID$(SplitString$, LastPos, PosDiff - 1)
- SELECT CASE EndLoop
- CASE 0
- EndLoop = 2
- CASE 3
- EndLoop = 0
- END SELECT
- CASE ELSE
- TempString$ = TempString$ + MID$(SplitString$, LastPos, PosDiff - 1)
- SplitField$(ActualIndex&) = TempString$
- TempString$ = ""
- ActualIndex& = ActualIndex& + 1
- IF ActualIndex& > LastIndex THEN
- ActualIndex& = LastIndex
- EndLoop = 1
- END IF
- END SELECT
- SELECT CASE EndLoop
- CASE 0
- DO
- LastPos = FoundPos + 1
- FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$)
- LOOP WHILE LastPos = FoundPos
- FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$ + CHR$(34))
- CASE 1
- FoundPos = 0
- LastPos = LEN(SplitString$) + 1
- CASE 2
- EndLoop = 3
- LastPos = FoundPos + 1
- FoundPos = StrInstrLeft(LastPos, SplitString$, CHR$(34))
- IF FoundPos = 0 THEN
- SplitString$ = SplitString$ + CHR$(34)
- FoundPos = LEN(SplitString$)
- END IF
- END SELECT
- LOOP
- IF EndLoop = 0 THEN
- IF LEN(TempString$) > 0 THEN
- SplitField$(ActualIndex&) = TempString$
- ELSEIF LastPos <= LEN(SplitString$) THEN
- SplitField$(ActualIndex&) = MID$(SplitString$, LastPos)
- ELSE
- ActualIndex& = ActualIndex& - 1
- END IF
- END IF
- FOR a = ActualIndex& + 1 TO LastIndex
- SplitField$(a) = ""
- NEXT
- SplitCount = (ActualIndex& - StartIndex) + 1
-END SUB
-
-FUNCTION StrTrim$ (a$, b$)
- StrTrim$ = StrTrimRight$(StrTrimLeft$(a$, b$), b$)
-END FUNCTION
-
-FUNCTION StrTrimLeft$ (a$, b$) 'public
- p = 0
- l = LEN(a$)
- DO
- p = p + 1
- t$ = MID$(a$, p, 1)
- LOOP WHILE (p < l) AND (INSTR(b$, t$) > 0)
- StrTrimLeft$ = MID$(a$, p)
-END FUNCTION
-
-FUNCTION StrTrimRight$ (a$, b$) 'public
- l = LEN(a$)
- p = l + 1
- DO
- p = p - 1
- IF p > 0 THEN
- t$ = MID$(a$, p, 1)
- ELSE
- t$ = ""
- END IF
- LOOP WHILE (p > 0) AND (INSTR(b$, t$) > 0)
- StrTrimRight$ = LEFT$(a$, p)
-END FUNCTION
-
-\1a
\ No newline at end of file
static char *stdmac[] = {
"%define __NASM_MAJOR__ 0",
- "%define __NASM_MINOR__ 97",
+ "%define __NASM_MINOR__ 98",
"%define __FILE__",
"%define __LINE__",
"%define __SECT__",
#define NASM_MAJOR_VER 0
#define NASM_MINOR_VER 98
-#define NASM_VER "0.98 pre-release 3"
+#define NASM_VER "0.98 pre-release 3.2"
#ifndef NULL
#define NULL 0
#ifndef OF_RDF2
#define OF_RDF2
#endif
+#ifndef OF_IEEE
+#define OF_IEEE
+#endif
#endif /* OF_ALL */
/* turn on groups of formats specified.... */
#ifndef OF_RDF2
#define OF_RDF2
#endif
+#ifndef OF_IEEE
+#define OF_IEEE
+#endif
#endif
/* finally... override any format specifically specifed to be off */
extern struct ofmt of_win32;
extern struct ofmt of_rdf;
extern struct ofmt of_rdf2;
+extern struct ofmt of_ieee;
extern struct ofmt of_dbg;
struct ofmt *drivers[]={
#ifdef OF_RDF2
&of_rdf2,
#endif
+#ifdef OF_IEEE
+ &of_ieee,
+#endif
#ifdef OF_DBG
&of_dbg,
#endif
clean:
rm -f *.o rdfdump ldrdf rdx rdflib rdf2bin rdf2com
-spotless: clean
+distclean: clean
rm -f Makefile
+cleaner: clean
+
+spotless: distclean
+
install: rdfdump ldrdf rdx rdflib rdf2bin rdf2com
$(INSTALL_PROGRAM) rdfdump $(bindir)/rdfdump
$(INSTALL_PROGRAM) ldrdf $(bindir)/ldrdf
-; Standard macro set for NASM 0.97 -*- nasm -*-
+; Standard macro set for NASM 0.98 -*- nasm -*-
; Note that although some user-level forms of directives are defined
; here, not all of them are: the user-level form of a format-specific
; directive should be defined in the module for that directive.
%define __NASM_MAJOR__ 0
-%define __NASM_MINOR__ 97
+%define __NASM_MINOR__ 98
; These two need to be defined, though the actual definitions will
; be constantly updated during preprocessing.
char *name;
} *seghead, **segtail, *ieee_seg_needs_update;
-static struct ieeeObjData {
+struct ieeeObjData {
struct ieeeObjData *next;
unsigned char data[HUNKSIZE];
};
if (p->id1 < 0)
sprintf(buf,"%lX",-p->id1);
else
- sprintf(buf,"L%X,10,/",p->id1);
+ sprintf(buf,"L%lX,10,/",p->id1);
break;
case FT_OFS:
- sprintf(buf,"R%X,%lX,+",p->id1,p->addend);
+ sprintf(buf,"R%lX,%lX,+",p->id1,p->addend);
break;
case FT_REL:
- sprintf(buf,"R%X,%lX,+,P,-,%X,-",p->id1,p->addend,p->size);
+ sprintf(buf,"R%lX,%lX,+,P,-,%X,-",p->id1,p->addend,p->size);
break;
case FT_WRT:
if (p->id2 < 0)
- sprintf(buf,"R%X,%lX,+,L%X,+,%lX,-",p->id2,p->addend,p->id2,-p->id1*16);
+ sprintf(buf,"R%lX,%lX,+,L%lX,+,%lX,-",p->id2,p->addend,p->id2,-p->id1*16);
else
- sprintf(buf,"R%X,%lX,+,L%X,+,L%X,-",p->id2,p->addend,p->id2,p->id1);
+ sprintf(buf,"R%lX,%lX,+,L%lX,+,L%lX,-",p->id2,p->addend,p->id2,p->id1);
break;
case FT_EXT:
- sprintf(buf,"X%X",p->id1,p->id1);
+ sprintf(buf,"X%lX",p->id1);
break;
case FT_EXTREL:
- sprintf(buf,"X%X,P,-,%X,-",p->id1,size);
+ sprintf(buf,"X%lX,P,-,%lX,-",p->id1,size);
break;
case FT_EXTSEG:
/* We needed a non-ieee hack here.
* We introduce the Y variable, which is the low
* limit of the native segment the extern resides in
*/
- sprintf(buf,"Y%X,10,/",p->id1);
+ sprintf(buf,"Y%lX,10,/",p->id1);
break;
case FT_EXTWRT:
if (p->id2 < 0)
- sprintf(buf,"X%X,Y%X,+,%lX,-",p->id2,p->id2,-p->id1*16);
+ sprintf(buf,"X%lX,Y%lX,+,%lX,-",p->id2,p->id2,-p->id1*16);
else
- sprintf(buf,"X%X,Y%X,+,L%X,-",p->id2,p->id2,p->id1);
+ sprintf(buf,"X%lX,Y%lX,+,L%lX,-",p->id2,p->id2,p->id1);
break;
}
ieee_putascii("LR(%s,%lX).\r\n", buf, size);
long offset, int is_global, char *special)
{
struct ieeeSection *seg;
- int used_special = FALSE; /* have we used the special text? */
+ int used_special; /* have we used the special text? */
- (void) special;
+ /* Keep compiler from warning about special and used_special */
+ used_special = special ? FALSE : FALSE;
/*
* If it's a special-retry from pass two, discard it.