I think there will always be some overlap between electrical engineering and computer science and software engineering. As such, some questions fit both sites and are probably best left wherever the OP asked. A concrete test would be great, but I just don't see how that is possible.
I am a full time professional electrical engineer, and probably spend at least half my time dealing with firmware as apposed to designing circuits, board layout, etc. That's the reality of the field nowadays. Of course sometimes I write host code too, but I wouldn't expect to talk about that here.
The line between firmware that a electrical engineer does as part of designing electronic thingies, and higher level software that a software engineer that doesn't need to know about electronics does is and always will be blurry. As a first approximation, I consider it part of electronics if the code runs on a small resource-limited system with no operating system. That means the code has to touch the hardware directly, which requires understanding of the hardware in the micro and the external circuit it is connected to. Even that definition is vague because "small" and "resource-limited" are judgement calls. It may be hard to define, but I think most of us know it when we see it. Assembler being used is another point in favor of belonging with electrical engineering. Not only does that require knowledge of the hardware, but demonstrates a higher willingness to learn about it and the answers can be more hardware-related. Generic C questions, for example, are still just that and don't belong here just because the code happens to run on a microcontroller. It requires a issue specific to the "small" or "resource-limited" or direct hardware access to qualify.
As for the specific question that brought this up, I felt it was on topic because
- I didn't take it as asking how to write a assembler (that's a computer science question), but wanting to understand how the assembler works, which may allow one to use it better.
- It was about assembler, not a high level language. That pushes more into electrical engineering because nowadays even device drivers are written in high level languages on general purpose systems.
All that said, I agree this question falls into the gray area and I can respect others' reactions that it should be elsewhere.