Function crashes seem to be related to the diVide option with V4 function commands.
For CARD, this command and options in DIR by itself will crash SAD.
Code: Select all
func C020 C097 :W V +4096 :W V +1 P +5
For CARD, these commands and options in DIR each by their self will NOT crash SAD.
Code: Select all
func C020 C097 :W :W
OR
func C020 C097 :W :W P +5
For CARD, this command and options in DIR by itself will crash SAD.
Code: Select all
func C098 C0A5 :S Y V +1 :Y V +8 P +5
For CARD, these commands and options in DIR each by their self will NOT crash SAD.
Code: Select all
func C098 C0A5 :S Y :Y
OR
func C098 C0A5 :S Y :Y P +5
This will not crash or produce MSG errors.
Single entry in DIR
Code: Select all
func C020 C097 [ UW = float ( x / 12800) ] [W]
Zero is not the right answer...but 12800.0 you will say...
LST
Code: Select all
c020: ff,ff,87,0b func 0, 2951
c024: 00,50,87,0b func 0, 2951
c028: 00,48,38,08 func 0, 2104
c02c: 00,44,1d,07 func 0, 1821
c030: cd,3c,4d,05 func 0, 1357
c034: 9a,39,97,04 func 0, 1175
c038: 66,36,01,04 func 0, 1025
c03c: 33,33,7c,03 func 0, 892
c040: 00,30,fb,02 func 0, 763
c044: cd,2c,89,02 func 0, 649
c048: 9a,29,29,02 func 0, 553
c04c: 66,26,d4,01 func 0, 468
c050: 33,23,88,01 func 0, 392
c054: 9a,21,66,01 func 0, 358
c058: 00,20,41,01 func 0, 321
c05c: 66,1e,22,01 func 0, 290
c060: 33,1b,eb,00 func 0, 235
c064: 9a,19,d2,00 func 0, 210
c068: 00,18,bb,00 func 0, 187
c06c: 66,16,a3,00 func 0, 163
c070: cd,14,90,00 func 0, 144
c074: 33,13,80,00 func 0, 128
c078: 00,10,62,00 func 0, 98
c07c: cd,0c,46,00 func 0, 70
c080: 9a,09,31,00 func 0, 49
c084: cd,04,1a,00 func 0, 26
c088: 9a,01,15,00 func 0, 21
c08c: 00,00,00,00 func 0, 0
c090: 00,00,00,00 func 0, 0
c094: 00,00,00,00 func 0, 0
...12800.0 Single entry in DIR
Code: Select all
func C020 C097 [ UW = float ( x / 12800.0) ] [W]
An error is printed to MSG
Code: Select all
## func C020 C097 [ UW = float ( x / 12800.0) ] [W]
## Error - Invalid floating point number after '2800.0'
No crash but no good.
LST
Code: Select all
c020: ff,ff word ffff
c022: 87,0b word b87
c024: 00,50,87,0b,00,48 ???
c02a: 38,08,00,44,1d,07 ???
c030: cd,3c,4d,05,9a,39 ???
c036: 97,04,66,36,01,04 ???
c03c: 33,33,7c,03,00,30 ???
c042: fb,02,cd,2c,89,02 ???
c048: 9a,29,29,02,66,26 ???
c04e: d4,01,33,23,88,01 ???
c054: 9a,21,66,01,00,20 ???
c05a: 41,01,66,1e,22,01 ???
c060: 33,1b,eb,00,9a,19 ???
c066: d2,00,00,18,bb,00 ???
c06c: 66,16,a3,00,cd,14 ???
c072: 90,00,33,13,80,00 ???
c078: 00,10,62,00,cd,0c ???
c07e: 46,00,9a,09,31,00 ???
c084: cd,04,1a,00,9a,01 ???
c08a: 15,00,00,00,00,00 ???
c090: 00,00,00,00,00,00 ???
c096: 00,00 ???
Lets try Integer instead of float.
DIR
Code: Select all
func C020 C097 [ UW = integer ( x / 12800) ] [W]
Should be 5, 2951 for the first row.
LST
Code: Select all
c020: ff,ff,87,0b func 0, 2951
c024: 00,50,87,0b func 0, 2951
c028: 00,48,38,08 func 0, 2104
c02c: 00,44,1d,07 func 0, 1821
c030: cd,3c,4d,05 func 0, 1357
c034: 9a,39,97,04 func 0, 1175
c038: 66,36,01,04 func 0, 1025
c03c: 33,33,7c,03 func 0, 892
c040: 00,30,fb,02 func 0, 763
c044: cd,2c,89,02 func 0, 649
c048: 9a,29,29,02 func 0, 553
c04c: 66,26,d4,01 func 0, 468
c050: 33,23,88,01 func 0, 392
c054: 9a,21,66,01 func 0, 358
c058: 00,20,41,01 func 0, 321
c05c: 66,1e,22,01 func 0, 290
c060: 33,1b,eb,00 func 0, 235
c064: 9a,19,d2,00 func 0, 210
c068: 00,18,bb,00 func 0, 187
c06c: 66,16,a3,00 func 0, 163
c070: cd,14,90,00 func 0, 144
c074: 33,13,80,00 func 0, 128
c078: 00,10,62,00 func 0, 98
c07c: cd,0c,46,00 func 0, 70
c080: 9a,09,31,00 func 0, 49
c084: cd,04,1a,00 func 0, 26
c088: 9a,01,15,00 func 0, 21
c08c: 00,00,00,00 func 0, 0
c090: 00,00,00,00 func 0, 0
c094: 00,00,00,00 func 0, 0
Lets try integer with 4096.
DIR
Code: Select all
func C020 C097 [ UW = integer ( x / 4096) ] [W]
Should be 15 or 16, 2951 for the first row.
LST
Code: Select all
c020: ff,ff,87,0b func 3, 2951
c024: 00,50,87,0b func 1, 2951
c028: 00,48,38,08 func 1, 2104
c02c: 00,44,1d,07 func 1, 1821
c030: cd,3c,4d,05 func 0, 1357
c034: 9a,39,97,04 func 0, 1175
c038: 66,36,01,04 func 0, 1025
c03c: 33,33,7c,03 func 0, 892
c040: 00,30,fb,02 func 0, 763
c044: cd,2c,89,02 func 0, 649
c048: 9a,29,29,02 func 0, 553
c04c: 66,26,d4,01 func 0, 468
c050: 33,23,88,01 func 0, 392
c054: 9a,21,66,01 func 0, 358
c058: 00,20,41,01 func 0, 321
c05c: 66,1e,22,01 func 0, 290
c060: 33,1b,eb,00 func 0, 235
c064: 9a,19,d2,00 func 0, 210
c068: 00,18,bb,00 func 0, 187
c06c: 66,16,a3,00 func 0, 163
c070: cd,14,90,00 func 0, 144
c074: 33,13,80,00 func 0, 128
c078: 00,10,62,00 func 0, 98
c07c: cd,0c,46,00 func 0, 70
c080: 9a,09,31,00 func 0, 49
c084: cd,04,1a,00 func 0, 26
c088: 9a,01,15,00 func 0, 21
c08c: 00,00,00,00 func 0, 0
c090: 00,00,00,00 func 0, 0
c094: 00,00,00,00 func 0, 0
Soooo, what is this bug.
Lets do a hex calculation;
0xFFFF / 0x4096 = 0x3
Bingo, SAD has an issue with handling Hex VS Decimal from Binary VS User DIR entries.
Should SAD accept a math formula as an inferred conversion from Hex to Decimal??
Is native Hex math required for a use case, by the user??
Should the user have to specify the radix of math formulas entered in DIR??