Search code examples
assemblyx86masmmasm32

x86 assembly: how do I use a semicolon within a string constant?


I have some x86 assembly code, compiling under MASM32 6.14.8444 (to be precise), and there is one line of code that is causing me some problems:

semicolon equ ";"

As you can see, I'm simply trying to assign the text ";" to a variable named 'semicolon', but I get this error:

error A2046: missing single or double quotation mark in string

I'm guessing this is because assembly takes the semicolon to be the start of a comment. In this case, how can I escape the semicolon in my string constant?


Solution

  • This compiles

    semicolon equ 0x3b