| 1 | <h2>Comments</h2> |
| 2 | <pre><code>; This is a comment</code></pre> |
| 3 | |
| 4 | <h2>Labels</h2> |
| 5 | <pre><code>label1: ; a non-local label |
| 6 | .local: ; this is really label1.local |
| 7 | ..@foo: ; this is a special symbol |
| 8 | label2: ; another non-local label |
| 9 | .local: ; this is really label2.local |
| 10 | </code></pre> |
| 11 | |
| 12 | <h2>Registers</h2> |
| 13 | <pre><code>st0 |
| 14 | st1 |
| 15 | ax |
| 16 | rax |
| 17 | zmm4</code></pre> |
| 18 | |
| 19 | <h2>Strings</h2> |
| 20 | <pre><code> |
| 21 | mov eax,'abcd' |
| 22 | |
| 23 | db 'hello' ; string constant |
| 24 | db 'h','e','l','l','o' ; equivalent character constants |
| 25 | dd 'ninechars' ; doubleword string constant |
| 26 | dd 'nine','char','s' ; becomes three doublewords |
| 27 | db 'ninechars',0,0,0 ; and really looks like this |
| 28 | |
| 29 | db `\u263a` ; UTF-8 smiley face |
| 30 | db `\xe2\x98\xba` ; UTF-8 smiley face |
| 31 | db 0E2h, 098h, 0BAh ; UTF-8 smiley face |
| 32 | </code></pre> |
| 33 | |
| 34 | <h2>Numbers</h2> |
| 35 | <pre><code>mov ax,200 ; decimal |
| 36 | mov ax,0200 ; still decimal |
| 37 | mov ax,0200d ; explicitly decimal |
| 38 | mov ax,0d200 ; also decimal |
| 39 | mov ax,0c8h ; hex |
| 40 | mov ax,$0c8 ; hex again: the 0 is required |
| 41 | mov ax,0xc8 ; hex yet again |
| 42 | mov ax,0hc8 ; still hex |
| 43 | mov ax,310q ; octal |
| 44 | mov ax,310o ; octal again |
| 45 | mov ax,0o310 ; octal yet again |
| 46 | mov ax,0q310 ; octal yet again |
| 47 | mov ax,11001000b ; binary |
| 48 | |
| 49 | db -0.2 ; "Quarter precision" |
| 50 | dw -0.5 ; IEEE 754r/SSE5 half precision |
| 51 | dd 1.2 ; an easy one |
| 52 | dd 0x1p+2 ; 1.0x2^2 = 4.0 |
| 53 | dq 0x1p+32 ; 1.0x2^32 = 4 294 967 296.0 |
| 54 | dq 1.e10 ; 10 000 000 000.0 |
| 55 | dq 1.e+10 ; synonymous with 1.e10 |
| 56 | dq 1.e-10 ; 0.000 000 000 1 |
| 57 | dt 3.141592653589793238462 ; pi |
| 58 | do 1.e+4000 ; IEEE 754r quad precision |
| 59 | </code></pre> |