The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Artoo on June 22, 2005, 09:52:10 AM

Title: Seems a bit quirky to me? -"Beep"
Post by: Artoo on June 22, 2005, 09:52:10 AM
Could someone please tell me why the follow reports an error:
   error A2071: initializer magnitude too large for specified size
on the line that is commented in the code below?


.586
.model flat, stdcall
option casemap :none

include windows.inc
include kernel32.inc
include user32.inc

includelib kernel32.lib
includelib user32.lib
   
T_Beep       EQU     "Beep"
T_Beeep      EQU     "Beeep"

.data
   
strBeep1     DB     T_Beep,0     ; error A2071: initializer magnitude too large for specified size
strBeep2     DB     T_Beeep,0    ; but no error here!

.code
start:
    mov eax, 0
    invoke ExitProcess,eax
end start
Title: Re: Seems a bit quirky to me? -"Beep"
Post by: Jeff on June 22, 2005, 10:06:13 AM
T_Beep is being treated as a number rather than text (4 characters == 4 bytes == could be a number).  you could either use the TEXTEQU directive or enclose the text in angle brackets:T_Beep       EQU     <"Beep">
T_Beeep      EQU     <"Beeep">