2 ; This is a macro to generate packed BCD constants.
3 ; It is obsoleted by "dt" with a packed BCD value with a "p"
4 ; suffix, but it is included here as a rest of nested %rep.
6 %macro dtbcd
1-*.nolist
10 %substr
%$sign
%$abc 1
12 %substr
%$abc %$abc 2,-1
15 %substr
%$abc %$abc 2,-1
20 %strlen
%$abclen
%$abc
21 %defstr
%$abclen_str
%$abclen
22 %assign
%$pos
%$abclen
26 %substr
%$chr
%$abc %$pos
28 %if
%$chr
>= '0' && %$chr
<= '9'
30 %assign
%$ld
%$chr
-'0'
33 %warning
"too many digits in BCD constant"
37 db %$ld
+((%$chr
-'0') << 4)
43 %error
"invalid character in BCD constant"
61 dtbcd
765432109876543210
62 dt 765432109876543210p
63 dtbcd
-765432109876543210
64 dt -765432109876543210p
65 dtbcd
+765_432_109_876_543_210
66 dt +765_432_109_876_543_210p
67 dtbcd
-765_432_109_876_543_210
68 dt -765_432_109_876_543_210p
70 ;; Both of these should warn...
71 dtbcd
8_765_432_109_876_543_210
72 dt 8_765_432_109_876_543_210p