summaryrefslogtreecommitdiff
path: root/test/radix.asm
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-22 16:53:48 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-22 16:53:48 -0700
commitbea0bbb62c9947421bc0fddcd2b58a40435e2181 (patch)
tree21623213cc08b04a9eb771b2a46bb1e057a1948c /test/radix.asm
parent3b2ad1bc370653e90d6b2fa9cfc587a7aea405f3 (diff)
downloadnasm-bea0bbb62c9947421bc0fddcd2b58a40435e2181.tar.gz
nasm-bea0bbb62c9947421bc0fddcd2b58a40435e2181.tar.bz2
nasm-bea0bbb62c9947421bc0fddcd2b58a40435e2181.zip
More consistent handling of radix letters
Allow any radix letter from the set [bydtoqhx] to be used either "Intel-style" (0...x) or "C-style" (0x...). In Intel style, the leading 0 remains optional as long as the first digit is in the range 0-9. As a consequence, allow the prefix "0h" for hexadecimal floating point.
Diffstat (limited to 'test/radix.asm')
-rw-r--r--test/radix.asm23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/radix.asm b/test/radix.asm
new file mode 100644
index 0000000..35dbcee
--- /dev/null
+++ b/test/radix.asm
@@ -0,0 +1,23 @@
+ dd 1010_0101 ; Decimal
+ dd 01010_0101 ; Decimal (*not* octal!)
+ dd 0d1010_0101 ; Decimal
+ dd 0t1010_0101 ; Decimal
+ dd 1010_0101d ; Decimal
+ dd 1010_0101t ; Decimal
+
+ dd 0b1010_0101 ; Binary
+ dd 0y1010_0101 ; Binary
+ dd 1010_0101b ; Binary
+ dd 1010_0101y ; Binary
+
+ dd 0o1010_0101 ; Octal
+ dd 0q1010_0101 ; Octal
+ dd 1010_0101o ; Octal
+ dd 1010_0101q ; Octal
+
+ dd 0h1010_0101 ; Hex
+ dd 0x1010_0101 ; Hex
+ dd 1010_0101h ; Hex
+ dd 1010_0101x ; Hex
+ dd $1010_0101 ; Hex
+ \ No newline at end of file