HDL: Optimize assembly code a bit (untested)