Message board for the users of flat assembler.
> Main > DB/DW/DD/etc
Hi. I've been browsing this forum for a while and I have a question.
Do the DB/DW/DD/etc keywords operate the same in .code/.text as they do
in .data? For some reason, the following code causes an access violation:
dd vga 0
mov eax, [esp + 4]
mov dword [vga], eax
Why doesn't this work? vga is defined in the .code section directly before this
|28 Jun 2006, 08:09||
Also, here is a procedure I wrote that refers to bytes defined inside code, and it works perfectly, so I don't understand why the previous code doesn't.
; n2th(*t, n) - Convert 32BIT number to unsigned hexadecimal text
mov eax, [esp + 8]
mov ecx, [esp + 4]
xor edx, edx
mov dl, al
and dl, 15
mov dl, [(n2th-16) + edx]
mov [ecx], dl
shr eax, 4
mov byte [ecx], 0
|28 Jun 2006, 08:34||
.code section maybe has not atrribute "writeable"?
see macro '.code' and macro '.data' and compare it.(and if you need correct ".code" macro(add writeable attribute))
|28 Jun 2006, 08:35||
it's best to use macros only when you understand them. for example, instead of .code you can write section '.text' code readable executable. To make it writable, change this to section '.text' code readable writeable executable
|28 Jun 2006, 08:40||
Oh, I forgot the "writeable" attribute It was: section '.code' code readable executable.
|28 Jun 2006, 10:45||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.