about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--126write-int-decimal.subx31
1 files changed, 31 insertions, 0 deletions
diff --git a/126write-int-decimal.subx b/126write-int-decimal.subx
index f2754fda..d30cb762 100644
--- a/126write-int-decimal.subx
+++ b/126write-int-decimal.subx
@@ -263,6 +263,37 @@ test-write-int32-decimal-negative:
     # . end
     c3/return
 
+# There's a special bit pattern that corresponds to no 2's complement integer.
+# There doesn't seem to be a widespread convention for representing it.
+test-write-int32-decimal-indefinite-integer:
+    # setup
+    # . clear-stream(_test-stream)
+    # . . push args
+    68/push  _test-stream/imm32
+    # . . call
+    e8/call  clear-stream/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
+    # write-int32-decimal(_test-stream, 0x80000000)
+    # . . push args
+    68/push  0x80000000/imm32
+    68/push  _test-stream/imm32
+    # . . call
+    e8/call  write-int32-decimal/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+    # check-stream-equal(_test-stream, "-(", msg)
+    # . . push args
+    68/push  "F - test-write-int32-decimal-indefinite-integer"/imm32
+    68/push  "-("/imm32
+    68/push  _test-stream/imm32
+    # . . call
+    e8/call  check-stream-equal/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
+    # . end
+    c3/return
+
 test-write-int32-decimal-negative-multiple-digits:
     # - check that a multi-digit number converts correctly
     # setup
700 1073 - stop fixing the values of primitive recipes' href='/akkartik/mu/commit/cpp/016jump?h=main&id=1848b18f02b158861008214efd19708585bfcbe5'>1848b18f ^
1848b18f ^
f2818edc ^
363be37f ^
f2818edc ^

e4630643 ^







dc1323e9 ^
1066660e ^
35064671 ^
1066660e ^
f2818edc ^

6f8f9fb5 ^

363be37f ^
f2818edc ^
88be3dbc ^
f2818edc ^
100157d1 ^
d7494165 ^
100157d1 ^


d7494165 ^


201b2e6c ^
1848b18f ^

201b2e6c ^
363be37f ^
201b2e6c ^

e4630643 ^











dc1323e9 ^
0487a30e ^
35064671 ^
201b2e6c ^

1066660e ^
35064671 ^
1066660e ^
201b2e6c ^

88be3dbc ^
201b2e6c ^
bc643692 ^

201b2e6c ^
bc643692 ^
201b2e6c ^
bc643692 ^
d7494165 ^
201b2e6c ^
88be3dbc ^
201b2e6c ^
bc643692 ^

201b2e6c ^
bc643692 ^
201b2e6c ^
bc643692 ^
57699011 ^
201b2e6c ^
1848b18f ^

201b2e6c ^
363be37f ^
201b2e6c ^

e4630643 ^











dc1323e9 ^
0487a30e ^
35064671 ^
201b2e6c ^

1066660e ^
35064671 ^
1066660e ^
201b2e6c ^

88be3dbc ^
201b2e6c ^
bc643692 ^

201b2e6c ^
bc643692 ^
201b2e6c ^
bc643692 ^
d7494165 ^
201b2e6c ^
88be3dbc ^
201b2e6c ^
bc643692 ^

201b2e6c ^
bc643692 ^
201b2e6c ^
bc643692 ^
57699011 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142