Article ID: 111502
Article Last Modified on 10/14/2003
<name> SUBSTR <string>, <index>
<name> SUBSTR <string>, <start>, <length>
; Assemble options needed: /c /Fl
.model small
.data
op1 substr <12345678>,8 ; 4
op2 sizestr op1 ; 5
op3 substr <12345678>,9 ; 7 - should be A2091 here
op4 sizestr op3 ; 8 - should be A2006 here
op5 substr <12345678>,10 ; 10 - A2091 here
op6 sizestr op5 ; 11 - A2006 here
END
Assembling this will correctly generate two errors (A2091 and A2006) on
lines 10 and 11 as shown in the following (partial) listing. These errors
should also be generated on lines 7 and 8 of the source, but aren't, and
the value 0 (zero) is incorrectly assigned to symbol op4.
; Assemble options needed: /c /Fl
.model small
0000 .data
= 8 op1 substr <12345678>,8 ; 4
= 0001 op2 sizestr op1 ; 5
= op3 substr <12345678>,9 ; 7 - should be A2091 here
= 0000 op4 sizestr op3 ; 8 - should be A2006 here
op5 substr <12345678>,10 ; 10 - A2091 here
test.asm(10): error A2091: index value past end of string
op6 sizestr op5 ; 11 - A2006 here
test.asm(11): error A2006: undefined symbol : op5
END
Additional query words: 6.00 6.00a 6.00b 6.10 6.10a buglist6.10 buglist6.10b buglist6.11 buglist6.00 buglist6.00b buglist6.00a
Keywords: KB111502