Hi Toast, i forgot to say: You were storeing bytes in unallocated space
hey.s = "hey" is 4 bytes - [ h, e, y and 0 ]
but you were storeing 3 bytes beyond your allocation, thats not "healthy" you could be overwriting something.
Well i really don't know anything about asm, but..
Code: Select all
; hey.s = Space(8)
hey.s = "hey you?"
MOV Ebx, hey.s
MOV byte [Ebx],108
MOV byte [Ebx + 4],32
MOV byte [Ebx + 1],111
MOV byte [Ebx + 5],112
MOV byte [Ebx + 6],98
MOV byte [Ebx + 2],118
MOV byte [Ebx + 3],101
MOV byte [Ebx + 7],0
Debug hey ; This what we really want :)
Code: Select all
*hey = AllocateMemory(10)
MOV Ebx, *hey
MOV byte [Ebx],73
MOV byte [Ebx +1],32
MOV byte [Ebx +2],108
MOV byte [Ebx + 6],32
MOV byte [Ebx + 3],111
MOV byte [Ebx + 7],112
MOV byte [Ebx + 8],98
MOV byte [Ebx + 4],118
MOV byte [Ebx + 5],101
MOV byte [Ebx + 9],0
Debug PeekS(*hey,10) ; This what we really want :)
Best Henrik.