@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> anyone have some good macros for making exe files in nasm? (with relocation etc)
<0> also, is there some way to do weak ordering? (e.g. sections .foo and .bar follow .text in arbitrary order, but before .data, which is followed by .baz, which is before .bss, which is followed by .quux) ?
<0> (in a bin file, that is)
<1> nasm cant produce exe-files
<0> not inherently, no.
<0> but it has a fairly decent macro facility.
<0> I just want to avoid having to overload everything that takes a far pointer in order to be able to build the relocation table.
<1> and the ELF/WIN32 support is also very basic
<0> I noticed. But I wasn't building ELF.
<1> iam not sure but maybe you are luckier with yasm
<0> isn't that a different syntax etc?
<0> the fact that the code needs relocation, entirely in asm, by me, should give an indication at how much work it would be to change the syntax at this point :P
<2> yasm aims to be nasm-compatible
<0> k.
<2> but it has some weirdo bugs, so you need to watch out



<0> any idea whether it might have the facilities to do what I want? (that is, ***emble segmented flat files)
<2> not sure, but you could check
<0> one wonders if any of them will eventually include support for topographic sorting of sections :P
<2> yasm is ambitious project, and aims to target all syntaxes, all output formats, all architectures and all stuff
<2> maybe they have .exe covered
<2> also, you could try ***embling to ELF, then using ld(1) with linker scripts and binary output format
<0> one hopes. that level of ambition frequently leads to little code, though.
<0> now there's a thought.
<2> ld(1) probably doesn't have automatic topo-sorting, but you can explicitely specify order of sections in linker script
<0> hmm... if nasm has sufficiently naive include instructions, I could probably do the topological sort thing through some macros and a bunch of recursive inclusions.
<2> *shrug*
<0> for most of my sections I don't need anything other than to tell it that the section needs to be somewhere between two others.
<0> I'd just like to automate the build bits, 's all.
<0> appreciate the help, thought :)
<0> s/thought/though/
<0> yeah. it works. I can build it over %include and %if's.
<3> When a CPU is interrupted it copies the registers out into the stack right?
<4> pretty much depends on the cpu
<4> some cpus just switch to kernel mode, and jump via a vector
<4> and it's down to the OS to preserve registers
<5> what's kernel mode?
<4> whatever your cpu defines as a privileged mode
<4> or that which it switches it on interrupt
<6> morning all
<7> ;)
<8> Well, im reading thoses links @ topic before ask
<8> =.=
<8> Does anyone can explain me how segment registers works in Intel Real Mode ? I've read that in 16-bit mode, stack pointer is at SS:[SP]... but what is SS in RealMode ? an Adress ?
<8> Thanks :)
<9> x2: ss is the segment were your stack is
<9> :)
<10> x2, a component of an address, yes. it's like ss * 16 + offset
<8> Yep like 0x10 ... in Protected mode ?
<9> 0x10?
<8> Err.. Does is deal with the GDT ?
<10> forget about that 0x10. you got the idea wrong.
<9> ss has completely different meaning in protected mode?
<9> and yes, something to do with GDT
<10> x2, that could be an offset into some gdt. but you gotta set it up yourself
<10> lindi-, there's no stack-segment in modern designs
<9> wobster: in real mode there is?
<10> segments are to be avoided
<8> So... in Real Mode (without GDT) this is SS * 16 + SP ?
<9> yep
<10> lindi-, no necesserily
<8> Okies ! thanks a lot ^^
<8> Err :s
<9> wobster: huh?
<10> x2, yes. lindi- you can have stack segments in both modes. or you don't.
<9> wobster: where is the stack then?
<9> if there's no stack segment
<7> hrm. so what are you guys coding in asm? other than shellcode and operating systems.
<9> i'm reverse engineering some old bios stuff
<7> sounds painful :P
<10> lindi-, either you set all segment regs equal or you don't.
<9> stack segment still exists, it's just not separate :)
<9> the same segment can be used for code, data and stack
<10> lindi-, the only diffence is that in realmode the segment-.sizes are very small.
<9> yep



<9> but 64K is enough for anyone ;)
<10> uhm. the correct quote is "640" which is about what's left between bios-stuff and the 1mb boundary
<9> well i'm not quoting :P
<10> but **** that. leave realmode :)
<9> i wish i could ;)
<10> how come?
<9> there's no documentation for the mmc controller in amd sc450 and it only works with the realmode bios routines
<9> but i should be able to write a linux driver soon
<0> hi all
<11> Wer mchte alles meinen Votrag zu Wimax sehn? [PowerPoint 2007]
<9> Stormbreaker: ?
<11> lindi-: ?
<9> Stormbreaker: can you say that again in english?
<11> Naw.
<11> http://www.datenschleuder.eu/get_602f3745d379dc7dfda8ae46cf762059.html
<9> i don't understand anything on that site :/
<9> ah, it wants javascript :(
<12> hey
<12> where can i look up system calls of IA-32 (nasm)
<13> system calls are OS dependent
<12> ah sorry
<12> don't know why i wrote this
<12> where must i look up for system calls for linux?
<12> http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html
<12> that one?
<9> smg: for example
<12> k
<9> smg: http://iki.fi/lindi/utun/syscalls.inc is in nasm format
<12> k
<12> thank you very much
<12> but how can i find out what gets in which reg?
<9> man pages?
<9> sources?
<9> smg: why are you writing in ***embler btw?
<12> lindi-: why not? :p
<12> so i need to look up in the sources, no way of a list?
<2> manpage.
<12> k
<2> they come in fixed order: ebx, ecx, edx, esi, edi
<9> smg: cause it's not portable
<9> you gotta have some reason :)
<9> it can be just fun of course
<12> i agree
<12> so i use man exit
<12> but there isnt told anything about the parameters
<9> void exit(int status);
<12> yes
<9> it does tell about the parameters here
<12> not here
<9> well, you can see 'int status' there
<9> what other info do you need? ;)
<12> he..
<2> exit isn't a syscall.
<12> no?
<12> sys_exit is
<2> it's called
<2> _exit
<2> void _exit(int status);
<12> ah okay
<12> tres bien
<2> this is what manual says
<12> yes
<12> so i know int status
<12> i need to mov eax, [status]
<12> call _exit
<2> and now you take the common syscall parameter order: ebx, ecx, edx, esi, edi
<2> first parameter comes in ebx
<2> so, status is p***ed in ebx
<2> second part is to figure out syscall number to p*** in eax
<12> ah okay
<12> mov ebx, [mystatus]
<2> you do that by searching /usr/include/asm-i486/unistd.h
<12> mov eax, 1
<12> call eax


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #asm
or
Go to some related logs:

gentoo forget to prefix with =?
ipip: Unknown symbol xfrm4_tunnel_register
dt_textrel gentoo
#xine
#perl
rvp plugin gaim -debian
ubuntu beginners alsaconf
#centos
+ubuntu +fsck +boot +journaled
source-list zd1211



Home  |  disclaimer  |  contact  |  submit quotes