.Data

myString db "something",0

___________________________

.code


myString db "something",0


When doing TextOut operations only the code string continues to be retrievable.


The Data string has one occurance and if you call that string a second time it will not appear in client are with a call to TextOut.

Why is this so.



:alright:
Posted on 2003-01-11 23:11:44 by IwasTitan
Not sure what the TextOut problem is, but if you're asking about having data in the code section, there are several reasons not to in most cases. Most CPUs have a data cache and a code cache is one reason. Read Agner Fog's optimization guide for others. :)
Posted on 2003-01-11 23:38:43 by S/390

.Data

myString db "something",0

[...deleted...]

The Data string has one occurance and if you call that string a second time it will not appear in client are with a call to TextOut.

Why is this so.
You're probably overwriting your string with other data. Do you have pointer data in front that are mistakenly being accessed as arrays or structures?
Posted on 2003-01-12 03:17:04 by tenkey

You're probably overwriting your string with other data. Do you have pointer data in front that are mistakenly being accessed as arrays or structures?


This what i have:

.DATA

OsInfoString db "Computer Name",13,10
db "Major Version",13,10
db "Minor Version",13,10
db "Build Number",13,10
db "Platform ID",13,10
db "CSDVersion",13,10
db "Windows Directory",0
____________________________________

.CODE

.IF ax==IDM_GETOSINFO; reponse to menu command
invoke InvalidateRect,hWnd,addr rect,TRUE
invoke UpdateWindow,hWnd
invoke DrawText,hdc,addr OsInfoString,-1,addr rect, DT_EDITCONTROL


If i select that menu command again i get no text the second time. If i put the string in the code section there is no problem. This is only a piece of the entire code but the other code shouldn't interfere with this.

Any help appreciated.
Posted on 2003-01-12 14:06:00 by IwasTitan
I should not have to release the DC because i specified CS_OWNDC in the window creation data.

Link version 5.012.8078.0

ML does not give the version
Posted on 2003-01-12 14:42:02 by IwasTitan

Email me at donkey@ntl.sympatico.ca and I'll send you more recent versions of the assembler. At least you can eliminate that.

Donkey


No need...its working. I must have overlooked something to do with restoring the YPOS

when using this.

invoke TextOut,hdc,XPOS,YPOS,addr buffer,eax

I use it several times with increased YPOS values so maybe the DrawText function was using that as a starting position which might end up being out of the client area.

In other words i corrected my YPOS problem "after" i decided that my string needed to be in .code section rather than .Data

Any way it seems fine now in the Data section.

Thanx for the support.
Posted on 2003-01-12 15:42:10 by IwasTitan