Author Topic: asm code problem.  (Read 4818 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Re: asm code problem.
« Reply #15 on: March 21, 2013, 07:51:18 AM »
Something runs wrong with last OxygenBasic versions.

I have had never problems with making of dlls. But now, 24 hour on the day.
One could think, Charles don't like aliens dlls. It makes him afraid.

Charles Pegge

  • Guest
Re: asm code problem.
« Reply #16 on: March 21, 2013, 11:39:40 AM »

Hi Emil,

This will work when run directly in memory, but when compiled, it cannot work because you are writing into a code section, which is configured as read-only. To create some data space you can map to global and static variables for fixed-location storage, or local variables to stack storage or strings and bstrings for heap-allocated storage.

Interesting case :)

Code: [Select]
addr ecx,xx
mov [ecx] , 0x64
print hex [ecx]
end

.xx
dd  0

Peter,

I'm giving DLLs a thorough workout with ScriptBasic, PowerBasic and thinBasic interfacing. Since my last Oxygen posting (with the RTLs)  I have not come across any major problems, though a  few subtle ones,  mainly associated with complex C headers.

Charles

Emil_halim

  • Guest
Re: asm code problem.
« Reply #17 on: March 22, 2013, 12:01:31 AM »

oh . i got it Charles , this will work okay
Code: [Select]
sub main()
addr ecx , xx
print hex [ecx]
MOV [ecx] , 100
print hex [ecx]
end sub

main
end

.xx
dd  10

but see the next one it compiled and worked okay , as you said it will resident in  read-only section!!!!!!!

Code: [Select]
addr ecx , xx
print hex [ecx]
end

.xx
dd  10

thanks ,
Emil.