Variable types in ASM
-
In C++ you have ints, variables for floating point numbers, bools. Does Assembly have the same variable differentiation? Can you move any type of variable into a register?
-
In C++ you have ints, variables for floating point numbers, bools. Does Assembly have the same variable differentiation? Can you move any type of variable into a register?
yes and no. There's no types in assembly. You just move data to a register; the data can be anything (int, float, address to a string, ...)
CI/CD = Continuous Impediment/Continuous Despair
-
yes and no. There's no types in assembly. You just move data to a register; the data can be anything (int, float, address to a string, ...)
CI/CD = Continuous Impediment/Continuous Despair
Not entirely true: floating point registers are still separate AFAIK. The rest are all the same.
Mircea
-
In C++ you have ints, variables for floating point numbers, bools. Does Assembly have the same variable differentiation? Can you move any type of variable into a register?
Assembler does have (sort of) data types, in the way that you declare variables. But at the instruction level it is up to the programmer to ensure that the items are handled correctly. Take a look at NASM - The Netwide Assembler[^] for specific details.
-
yes and no. There's no types in assembly. You just move data to a register; the data can be anything (int, float, address to a string, ...)
CI/CD = Continuous Impediment/Continuous Despair
-
Assembler does have (sort of) data types, in the way that you declare variables. But at the instruction level it is up to the programmer to ensure that the items are handled correctly. Take a look at NASM - The Netwide Assembler[^] for specific details.
Richard MacCutchan wrote:
it is up to the programmer to ensure that the items are handled correctly
Truth!
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
Assembler does have (sort of) data types, in the way that you declare variables. But at the instruction level it is up to the programmer to ensure that the items are handled correctly. Take a look at NASM - The Netwide Assembler[^] for specific details.
Richard thanks for your reference.
-
In C++ you have ints, variables for floating point numbers, bools. Does Assembly have the same variable differentiation? Can you move any type of variable into a register?
Thanks for your feedback guys
-
Richard thanks for your reference.