Assembly Language - Data Types
Hello guys I am back... So in the previous post i explained the Endianness which shows how data is stored into the memory. Now in this post I am going to explain the Data Types used in the Assembly Language
If you guys have done programming in your life means at least addition program in the C then you know that it looks something like this int a=5; right.
Data Types :-
- Data types represents what type of data you are storing into the memory.
- It could be INT, CHAR, DOUBLE etc.
Why we need the Data Types ?
- Well as I said "Data types represents what type of data you are storing into the memory"
- Data Types are requires so that your OS knows how much memory location it needs to allocate for that data being store.
- Like imagine Compiler allocates 8 bytes for the a character. The rest 7 bytes will remain unused thus increasing the program size.
If some of you guys still wondering why in python we doesn't required to specify the Data Type.
- Well because is very high level language and it automatically detects which data type is of the variable
Now finally,
Data Types in the Assembly Language :-
- Well there isn't a specific Data Type in the assembly language like INT and CHAR.
- Rather Data Types in the Assembly Language only shows how much data is being stored or in simple words how much size of data they can hold like 8 bit, 16 bit, 32 bit or 64 bit.
- Examples Below...
Examples :-
- Byte - 8 bits
- Word - 16 bits
- Dword - 32 bits
- Qword - 64 bit
DB Define Byte
DW Define Word
DD Define Doubleword
DQ Define Quadword
Syntax :-
Data Type Var_name Value
Ex- 1. DB bh "BinaryHakka"
2. DW h1 0x1234
I hope you have understand the data types in the assembly language if not then feel free to message me on twitter... see you in the next blog post till then keep smiling... :)
Assembly Language - Data Types
Reviewed by h4kk4
on
March 23, 2020
Rating:
No comments:
Enter your comments here if you need any help: