File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -130,19 +130,19 @@ $ ./number-mashing
130
130
Give me some numbers: -2147483648 -1
131
131
zsh: floating point exception ./number-mashing
132
132
```
133
- On x86 architecture idiv assembly instruction is used, quick google ` idiv floating point exception ` bring us to
133
+ On x86 architecture idiv assembly instruction is used, quick google _ idiv floating point exception _ bring us to
134
134
[ stackoverflow] ( https://stackoverflow.com/questions/56303282/why-idiv-with-1-causes-floating-point-exception ) .
135
135
idiv will raise an exception in two cases:
136
136
137
137
* You divide by zero
138
138
* The division result is not in the range that can be represented by the ` eax ` register
139
139
140
- Indeed, range for 4 byte number is from -2147483648 to 2147483647, so ideally ` -2147483648 / -1 = 2147483648 ` which doesn't fit
141
- range above, hence we got error.
140
+ Indeed, range for 4 byte number is from -2147483648 to 2147483647, so result of ` -2147483648 / -1 = 2147483648 ` doesn't fit in
141
+ the range above, hence we got error.
142
142
143
143
On arm architecture sdiv instruction is used, it doesn't raise exception, instead carry flag is set in cpsr register.
144
144
145
- Connecting to server and submitting two numbers got us the flag.
145
+ Connecting to the challenge server and submitting two numbers got us the flag.
146
146
147
147
## Epilogue
148
148
You can’t perform that action at this time.
0 commit comments