2022-12-05 14:40:26 +01:00
|
|
|
# Here is what I prompted OpenAI with to get day4-by-ai.c and day4-by-ai.s:
|
2022-12-05 14:24:14 +01:00
|
|
|
consider a text file like this:
|
2022-12-05 14:40:59 +01:00
|
|
|
```
|
2022-12-05 14:24:14 +01:00
|
|
|
22-65,22-66
|
|
|
|
91-94,63-91
|
|
|
|
6-88,5-31
|
|
|
|
85-86,64-86
|
|
|
|
40-65,40-65
|
|
|
|
25-82,24-94
|
2022-12-05 14:40:59 +01:00
|
|
|
```
|
2022-12-05 14:24:14 +01:00
|
|
|
|
|
|
|
write an gnu-x86 assembly program that:
|
|
|
|
- reads a text file like this line by line and count how often one of the two ranges contains the other.
|
|
|
|
- accepts the filename via command line arg
|
|
|
|
- outputs the result using printf with a suitable string
|
|
|
|
A range r1 contains the other r2 when the r1.lower <= r2.lower and r1.upper >= r2.upper
|
|
|
|
the program needs to output how often that is the case in the entire file
|
|
|
|
|