logs archiveIRC Archive / Undernet / #asm / 2006 / June / 15 / 1
r420r
hi
hi have a question
vml
Paranoid schizophrenics outnumber their enemies at least two to one.
sawak
hi all
i've got one question;]
can i?
Hutley
lo all
The_Base
hello
I keep getting this error: relocation truncated to fit: R_386_16 against '.bss' in this line mov dl,[buffer+bx] where buffer has been declared in bss. Anyone know why is this happening ?
nice, I changed the line to mov edx,[buffer+ebx] and it worked. Dont know why the mov dx,[buffer+bx] didnt work
flavious
Hi
What is between the image base address (usually 00400000) and the start of .text (at 00401000) ? The stack ?
in a PE file of course
MrAshe
Why would the stack be in the .exe
Or you mean at that address in memory?
(cause then it's just data, I guess)
edcba
the pe header
flavious
that's 400 in size, the rest of 600 are just NOOPs ?
         

MrAshe
What's just 400?
There's idata, data and some other, iirc
flavious
the header
well, .data begins at virtual addr 00003000
The_Base
what could I use to read the Left and Right keys from the keyboard? A C function would be great
MrAshe
Depends of your OS
The_Base
Linux
should I use a syscall ?
MrAshe
Could probably do something with some ncurses
The_Base
oh yes. ncurses
I was gonna use scanf but I dont think it only returns ascii and there is no valeu for Left and Right
I think it only*
yes. getch will do it
MrAshe
c-bot oman
c-bot
MrAshe, here you go: .OM
BoR0
MrAshe?
MrAshe
Ja?
BoR0
i thought you were dead, and now that you arent im dissapointed :p
MrAshe
I'll do my best to satisfy you within the next few hours
The_Base
I im using a C funcition in an asm prog. That lib has a constant (#define). Do I have to use extern with it ?
wkr
(Action) hugs MrAshe
ThFabba
#define affects the preprocessor - that means if you #define CONSTANT something, then CONSTANT will be replaced with something in the c code
thus, the constant definition will not exist in the actual object code
you could use const int BLAH = 5; instead though to allow this
(or simply copy your constant to the asm source)
MrAshe
(not in C)
Unless you mean have an actual variable and not a constant
The_Base
but will nasm check the .h for that constant if I use extern CONST ?
like it looks for the function when I use extern printf
ThFabba
nasm doesn't check anything with extern
it puts a reference to an extern object into the object code... then the linker looks whether it finds the referenced object anywhere (likely in the library)
The_Base
hm
:(, this is gonna give me a lot of trouble
         

ThFabba
just copy (and reform) the declarations from the header file and make an asm include file out of it
The_Base
yes. Im doing it :-(
it stdio a constant ?
because I remember that I used extern stdio and used it with fwrite(stdio, ...)
sorry
stdout*
its not
never mind :)
damn
ncurses doesnt define the escape key. I just wrote the whole code >:-(
I declared a constant like this %define KEY_ESCAPE 0027 but I keep getting the error: operation size not specified in this line: cmp [direc],KEY_LEFT .How can I specify that ?
Chiu_Lee
cmp WORD [direc],KEY_LEFT
edcba
cmp word ptr [direc],KEY_LEFT
Chiu_Lee
that %define looked like nasm syntax to me :D
edcba
ah
The_Base
I got it. I tried dd instead of dword :p
Im dizzy, been programming asm the whole day. I'm back later. BB all
and thanks again for the help :)
Deathmaster
i need to add an extra shared segment in my dll. how do i declare the new segment in the source code? (i'm using masm)
malfunc
i have never used masm, but afair it has a linker option that lets you specify some flags for a section
 /SECTION:name,[E][R][W][S][D][K][L][P][X]
no idea if that's helpful to you :)
« prev next »