How to DigitalWrite in Assembly Using Variables, Not Constants

The compiler needs to know the value at compile-time so you will not succeed in using a variable that changes during runtime. Different constraints will not help you either.

EDIT: Since the PORT* constants are memory-addresses, you may be able to do it by accessing those areas in memory directly (using LD and ST). Or you may check the port variable in assembly (using cp) and break (breq) to a label where that port is set as a constant.