BYTE and SBYTE Data
val0 SBYTE 50h+10h ; integer expression val1 BYTE 'A' ; character constant val2 BYTE 255 ; largest unsigned byte val3 SBYTE -128 ; smallest signed byte val4 BYTE ? ; space allocated but not the value
| Each initializer must be an 8-bit integer expression or character constant. |
|
|
0 + (–10) |
0 + 246 |
BYTE: (–10) + 20
|
INCLUDE Irvine32.inc .data X BYTE -10 .code main PROC sub eax, eax add al, X call DumpRegs exit main ENDP END main |
INCLUDE Irvine32.inc .data X BYTE 246 .code main PROC sub eax, eax add al, X call DumpRegs exit main ENDP END main |
INCLUDE Irvine32.inc .data X BYTE -10 Y BYTE 20 .code main PROC sub eax, eax add al, X add al, Y call WriteInt exit main ENDP END main |
|
Output |
Output |
Output |
SBYTE: (–10) + 20
|
SBYTE: 10 + (–20)
|
MOVSX: 10 + (–20)
|
INCLUDE Irvine32.inc .data X SBYTE -10 Y SBYTE 20 .code main PROC sub eax, eax add al, X add al, Y call WriteInt exit main ENDP END main |
INCLUDE Irvine32.inc .data X SBYTE 10 Y SBYTE -20 .code main PROC sub eax, eax add al, X add al, Y call WriteInt exit main ENDP END main |
INCLUDE Irvine32.inc .data X SBYTE 10 Y SBYTE -20 .code main PROC sub eax, eax add al, X add al, Y movsx eax, al call WriteInt exit main ENDP END main |
|
Output |
Output |
Output |
|
“I’m not arguing, I’m just explaining why I’m right.” ― Unknown |