NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: Ben on March 21, 2009, 01:43:24 PM
-
I'm starting out using nasmide and have been given 2 simple programs to create. with both of them i am receiving the same error messages when attempting to allocated bytes of space in SECTION .BSS
below is one of the programs where I receive the following error message:
"warning: uninitialised space declared in .BSS section"
The code below is just to create a simple addition of two numbers
BITS 16 ;SET CODE GENERATION TO 16 BIT MODE
ORG 0X0100 ;SET CODE START ADDRESS TO 0100H
SECTION .TEXT ;MAIN CODE SEGMENT
MAIN:
MOV AX,[NUM1]
ADD AX,000FH
MOV [NUM2],AX
MOV AX,4C00H
INT 21H
SECTION .DATA ;DATA SEGMENT FOR INITIALISED DATA & CONSTRAINTS
NUM1 DW 001FH ;RESERVE 2 BYTES OF SPACE
SECTION .BSS ;DATA SEGMENT FOR UNINITIALISED DATA
NUM2 RESB 2 ;RESERVE 2 BYTES OF SPACE
-
Hi Ben,
We learn something new every day! I've been using Nasm a long time - lots of dos .com files. As you know, Nasm knows ".text", ".data", and ".bss" as section names. It doesn't say so in the Friendly Manual, but these names are case-sensitive! I never realized that!!! Guess I never tried 'em in upper-case! In all this time...
So change ".BSS" to ".bss" (might as well do ".text" and ".data", too - although it doesn't make as much difference), and Nasm will be happy again. Other than that, your code is fine! I had to *try* it to spot the problem.
When you say you're using "nasmide", do you mean Rob Anderton's old "nasmide"? Or http://sf.net/projects/nasmide (http://sf.net/projects/nasmide) ? If the latter, what is it? (I can't even *look* at stuff that's distributed as an .exe!)
Best,
Frank
-
Hi Frank,
Thanks very much that's put my mind at ease, didn't like to think that I was not able to do something that simple. At least it was something easy to sort!
Having a look through they seem to be the only thing that Nasm is case-sensitive with. Very strange!
As for the Ide that I am using, it is Robert Andersons NASM-IDE 1.8 , it is just what we were asked to use by my University, so as a beginner I have stuck with it.
I have to build up a portfolio of code in the next few weeks so if stuck I may call upon you again if this is ok?
Thanks,
Ben