D-Programming-Language/dmd — pull request #3483 by Orvid (2014-04-21 20:23:36+00:00)
Title: Allow labels as inline asm operands

This PR allows labels to be used as an operand for any op-code that would normally accept a memory location. The backend is able to handle it perfectly fine, but for some reason the frontend only lets you use labels as an operand to branching instructions. The use of this is quite simple: It's currently impossible to create a jump-table within inline-asm without creating a huge amount of boilerplate code resulting in a separate function for each and every case, as well as the default case, and the code after the default case, which is not, in any form of the word, maintainable. This PR makes the default segment for labels being resolved `CS`, however it does still allow you to manually override this segment, just as you would with a normal memory operand. This does not currently include a test for this syntax, as I would normally have put it in an inlineasm test file, but that won't be added until [PR 3469](https://github.com/D-Programming-Language/dmd/pull/3469) is merged.