The compilers will generate code that will work on multiple platforms (portability).
If you're looking at x86 assembly and you're only intending your program to run on that platform, then the bog-standard x86 instructions will do fine. But if you start referencing 64-bit registers (RAX, RBX, etc) and run your program on a 32-bit platform, then it'll fail.
Assembly language is not difficult to learn, but it is fiddly. To do it properly you need to understand how each instruction handles the flags and how they can thus be made to work correctly together.
It starts to get fun if you're using the SIMD instructions, where there are different opcodes which are more platform-specific; SSE2 has instructions that do not exist in SSE1 and there may be differences between what AMD offer and what is provided by Intel. I've not coded with those instructions, but I have read a bit about them online and it looks like you're VERY likely to run into cross-platform difficulties and backward compatibility problems if you're not careful.
Helping a loved one through a mental health issue? Remember ALGEE...
Assess the risk | Listen nonjudgementally | Give reassurance and info | Encourage professional help | Encourage self-help and support network