I want to check the endianness of my computer in an assembly program ( 8086 ) and to print it.
I know what endianness is and how you find it. It is about the way data is stored in memory. For eg if you store 1234 it will be stored 3412 ( little ) or 1234 ( big ). But i don't know how to do it in assembly language. I'm thinking about storing something in memory than load it and compare it with the original. It should be exactly as the theory says. If i store 1234 i will load it as 3412 or 1234. I have a problem when i'm trying to create an if statement.
litte db "little$"
big db "big$"
mov ax, var1
cmp ax, var2
je equal
jmp notequal
equal:
lea dx, big
notequal:
lea dx, little
I expect it to print little or big, but no matter what values i put in var1 and var 2 it always prints little, because somehow the code is executed line by line. Shouldn't it go to only one label, "equal" or "notequal"? I want something like:
if var1==var2
print big
else
print little