Well... there *are* instructions which are perfectly okay with the CPU, but which are "illegal" in "protected mode" OSen - Windows or Linux (it's "protected" from *us*!). Reading/writing ports, for example, or accessing memory you don't "own". But I don't think that's the problem in this case...
The "instructions" shown, when viewed as ascii, say "call "! Seems like you're trying to "execute data" for some reason. Failing to "exit" cleanly would do it, if the word "call " appears in the data. Possibly "line wrap", although I don't think Nasm will assemble it ("invalid combination of opcodes and operands"... there would be no "operands")... ("fire.asm" has the word "call" at the end of a comment line, where it might wrap - but when I deliberately "wrap" it, Nasm barfs).
I suppose you might get this result by renaming "myfile.asm" to "myfile.com" and attempting to execute it. In any case, I think it's a "simple error" rather than a real "illegal instruction". More than one file does this, eh? Which one(s)?
I haven't read Jeff's book, but I've looked at the example code downloadable from duntemann.com - there were a couple of bugs in the version I've got... errors "translating" from the Masm syntax of the first edition, I think. Probably fixed by now. If you... well, here:
-------------------
diff -u orig/eat3.asm ./eat3.asm
--- orig/eat3.asm Sun Dec 12 14:18:02 1999
+++ ./eat3.asm Mon Jan 28 19:41:28 2002
@@ -110,7 +110,7 @@
ClrScr:
mov CX,0 ; Upper left corner of full screen
- mov DX,LRXY ; Load lower-right XY coordinates into DX
+ mov DX,[LRXY] ; Load lower-right XY coordinates into DX
ClrWin:
mov AL,0 ; 0 specifies clear entire region
ScrlWin:
diff -u orig/eat5.asm ./eat5.asm
--- orig/eat5.asm Sun Dec 12 14:25:04 1999
+++ ./eat5.asm Mon Jan 28 21:09:18 2002
@@ -15,7 +15,7 @@
[SECTION .text] ; Section containing code
-%include "BOOK\MYLIB.MAC" ; Load in screen control macro library
+%include "MYLIB.MAC" ; Load in screen control macro library
START: ; This is where program execution begins:
diff -u orig/info.asm ./info.asm
--- orig/info.asm Sun Dec 12 14:29:22 1999
+++ ./info.asm Mon Jan 28 20:44:00 2002
@@ -21,7 +21,7 @@
START: ; This is where program execution begins:
call VidCheck ; Initialize all video information variables
- Clear VidSegment,ClearAtom,VidBufSize ; Clear the screen
+ Clear VidOrigin,ClearAtom,VidBufSize ; Clear the screen
; Here we display the name of the program and its author:
Writeln IDString,LIDString ; Display the program name
@@ -274,8 +274,8 @@
; system and are initialized by the VidCheck procedure:
;---------------------------------------------------------------
DispType DB 0 ; Code for display adapter type
-VidSegment DW 0B000H ; Segment of installed display buffer
VidOrigin DW 0 ; Offset for FAR pointer to refresh buffer
+VidSegment DW 0B000H ; Segment of installed display buffer
VisibleX DB 80 ; Number of columns on screen
VisibleY DB 25 ; Number of lines on screen
VidBufSize DW 4000 ; Default to 25 X 80 X 2 (char & attribute)
diff -u orig/mylib.mac ./mylib.mac
--- orig/mylib.mac Mon Sep 20 12:04:08 1999
+++ ./mylib.mac Mon Jan 28 20:58:40 2002
@@ -32,8 +32,8 @@
;---------------------------------------------------------------
%macro Clear 3 ;VidAddress,ClearAtom,BufLength
les DI,[%1] ; Load ES and DI from FAR pointer
- mov AX,%2 ; Load AX with word to blast into memory
- mov CX,%3 ; Load CX with length of buffer in bytes
+ mov AX,[%2] ; Load AX with word to blast into memory
+ mov CX,[%3] ; Load CX with length of buffer in bytes
shr CX,1 ; Divide size of buffer by 2 for word count
cld ; Set direction flag so we blast up-memory
rep stosw ; Blast away!
---------------------
As you can see(?), the main problem is "[]" where Masm doesn't need 'em, but Nasm does. I don't know what the story is with "info.asm" - the version I've got is "just plain wrong"! (offset before segment in memory - we're "little endian" in that respect, too!) But worry about that when you get to it... (IIRC, "eat3" works with the error in, but *looks* a lot nicer with it fixed)
But that's got nothing to do with the "illegal instruction"... if you can't get that fixed, holler!
Best,
Frank