Even if the previous answer seems nice, it does not answer your question at all.
ASLR is not randomizing every address of your program, but only it base address.
Let's say that, without ASLR, you program is calling a function that is statically located at 0x556d528a5772. By enabling ASLR, your function will be located at 0x5826beca9772, which is random, but share the same suffix whan the 'original' address. Only the base address have changed.
That's why you can play with offsets and addresses at the assembly level, but still have something working when ASLR is enabled.