3. Program for Data Definitions in Assembly Language using Visual Studio

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.

Assembly Basics, Assembly Language, Coding for beginners, Coding tutorial, Computer Science, Learn Coding, Learn programming, Programming for beginners, Programming Tutorial, Visual Studio

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