Defining WORD and SWORD Data

   ; integer expression
   word1  WORD   100h + 0B00h
   ; smallest signed value
   word2  SWORD  -32768     


Type Usage
WORD 16-bit unsigned integer
SWORD 16-bit signed integer
Using the Operator
The operator generates a repeated storage allocation, using a constant expression as a counter.
   val5  BYTE  10 DUP('a')        ; 10 bytes, all equal to 'a'
   val6  BYTE  10 DUP(?)          ; 10 bytes, uninitialized
   val7  BYTE   3 DUP("test")     ; 12 bytes, "testtesttest"
An array can be created by using the following statement:
   myArray  WORD  10, 10, 10, 10
which is equal to
   myArray  WORD  4 DUP(10)
Offset Value
0000 10
0002 10
0004 10
0006 10
Assume starts at offset 0. All offsets are shown on the above.

 EAX == 12345678h, (Y/N)
 INCLUDE Irvine32.inc
 .data
  X  WORD  1234h
  Y  WORD  5678h
 .code
 main PROC
  mov   eax, X
  call  WriteHex
  exit
 main ENDP
 END main
 INCLUDE Irvine32.inc
 .data
  X  WORD  1234h
  Y  WORD  5678h
  Z  DWORD  ?
 .code
 main PROC
  mov   bx, Y
  mov   Z, bx
  mov   bx, X
  mov   Z+2, bx
  mov   eax, Z
  call  WriteHex
  exit
 main ENDP
 END main
 INCLUDE Irvine32.inc
 .data
  X  WORD  1234h
  Y  WORD  5678h
  
 .code
 main PROC
  mov   bx, Y
  mov   Z, bx
  mov   bx, X
  mov   Z+2, bx
  mov   ecx, OFFSET Z
  
  call  WriteHex
  exit
 main ENDP
 END main
 


Output


Output


Output


EAX =  

 


EAX =  

 

  12345678h  


      “I’m not arguing, I’m just explaining why I’m right.”    
      ― Unknown