Chapter 3
Assembly Language Fundamentals
Assembly Language Programming Exercise
Problem # 3:
Write a program that contains a definition of each data type listed in Table. Initialize each variable to a value that is consistent with its data type.
Solution:
.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
.data
valByte BYTE 255
valSbyte SBYTE -128
valWord WORD 65535
valSWord SWORD -32768
valDWord DWORD 4294967295
valSDWord SDWORD -2147483648
valFWord FWORD 281474976710,655
valQWord QWORD 18446744073709551615
valTByte TBYTE 1000000000123456789Ah
valReal4 REAL4 -1.2
valReal8 REAL8 1.0E-260
valReal10 REAL10 1.0E+4000
.code
main PROC
INVOKE ExitProcess,0
main ENDP
END main
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
.data
valByte BYTE 255
valSbyte SBYTE -128
valWord WORD 65535
valSWord SWORD -32768
valDWord DWORD 4294967295
valSDWord SDWORD -2147483648
valFWord FWORD 281474976710,655
valQWord QWORD 18446744073709551615
valTByte TBYTE 1000000000123456789Ah
valReal4 REAL4 -1.2
valReal8 REAL8 1.0E-260
valReal10 REAL10 1.0E+4000
.code
main PROC
INVOKE ExitProcess,0
main ENDP
END main
Let me know in the comment section if you have any question.
Previous Post:
Program for Symbolic Integer Constants in Assembly Language using Visual Studio
Previous Post:
Program for Symbolic Integer Constants in Assembly Language using Visual Studio