You're trying to read a random record from an opened FCB? What is this, "old code day"?
The problem is that int 21h is dos (16-bit), and you're assembling and linking as a Windows PE (32-bit) executable. Won't work.
If you assemble it into a .com file (nasm -f bin -o myfile.com myfile.asm - no linker needed) it may or may not work. I think 32-bit Vista supports dos ("fake dos"), 64-bit Vista does not(?). Won't work on Linux... except under dosemu (try "sudo aptget dosemu install" in Ubuntu - no guarantee that's right).
We can show you a simple example of a Windows PE and/or an ELF executable for Linux. In the "example code" section of this forum there's a "cross-compiling" example that might interest you. But that won't help you follow along with your book, which is apparently for dos(?). What book are you using, Flippin Monkey? (I'm probably not familiar with it, but it won't hurt to try)
A simple example of a dos .com file:
; nasm -f bin -o myfile.com myfile.asm
org 100h ; dos will load us at offset 100h (256) into some segment
section .text
mov ah, 9
mov dx, msg
int 21h
ret
section .data
msg db "hello world!$"
A dos .com file is about as simple as it gets. Without knowing, I'd guess that your book is probably teaching you to create an MZ executable - only slightly more complicated, but requires slightly different source code (and a linker -
http://alink.sf.net should work well with Nasm). We can provide an example of that, too. Your book presumably has examples, but they may not be in the proper syntax for Nasm. Easy enough to "translate" (we can help), but it may be easier to use the assembler that your book expects. As you've probably figured out, assemblers "do" the same thing, but have different syntax... and generally won't assemble each other's code.
To be honest, I'd jump right into Linux, if I were you. It's "different", but it isn't really that "scary". For comparison:
; nasm -f elf32 myfile.asm
; ld -o myfile myfile.o
global _start ; tell the linker
section .text
_start:
mov edx, msg_len ; length to write
mov ecx, msg ; address of buffer
mov ebx, 1 ; "file descriptor" - stdout
mov eax, 4 ; write to a file
int 80h
mov eax, 1 ; exit to shell
int 80h
section .data
msg db "hello world", 10
msg_len equ $ - msg ; let Nasm count 'em!
Simple enough, eh? But it probably won't help you follow along in your book. Perhaps you should post an example from the book, and we can show you what changes (if any) would make it work with Nasm.
Nasm *is* a great assembler - you got that part right!
Best,
Frank