Hi,
How can I point to the end of a string ? We have ACTULEN, the length of string .
For example :
LEA SI, KBNAME + ACTULEN
KBNAME is name of our string .
But this is not work .
Thanks .........................

To get the offset of the last byte in a string:

;MASM Syntax
LEA SI, STR_ADDR + LENZ 
DEC SI
;NASM Syntax
LEA SI, [STR_ADDR + LENZ]
DEC SI

100 S
101 T
102 R
103 Z Length is 4
100+4=104-1=103

STR_ADDR+LENGTH=Address of first byte past the string
This is useful for indexing into several byte long data items
in an array.
ARR 01,02,03,04,01,02,03,04
Second sequence of 1,2,3,4 is at ARR+4

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.