@# Quotes DB     useful, funny, interesting





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



Comments:

<0> good night everybody
<1> hi, i am reading Programing GroundUp.pdf and i cant understand whats the reason from "indexed addressing mode" to exist if we have "direct addressing mode" where we can specify where load the data
<1> can someone explain me ?
<2> so that we don't need additional instruction to compute the address -- it's done directly in addressing mode.
<1> so why exist "indexed addressing mode" ?
<2> that was about indexed mode.
<1> "in the indexed addressing mode, the instruction contains an address to load the data from, and also specifies an index register to offset the address ...." and "in the direct addressing mode, the instruction contains the address to load the data from"
<1> i think both are same
<2> ah, this !@#$% book has its own understanding of these terms... oh well
<1> i get it from the topic :!
<2> so, what the book calls 'indexed' addressing mode is 'take some number embedded in ***embler code and add contents of some register to it to obtain the final address'
<2> so it's something like [ 0x1234 + some_register ]
<2> 'direct' addressing mode is the same, except without the register. the address is totally fixed.
<2> [ 0x1234 ]
<1> mwk "direct" mode looks more easy
<2> of course, indexed would be enough, as you can just write 0 to register. but it's better to have both forms to choose from.



<2> yes, direct is easier.
<2> BUT, the address is embedded in instruction. you cannot change it while program is running.
<2> means you can only refer to several fixed places in data area
<1> ap, now i understand! :D
<2> if you want to refer to many different addresses [ie. use something like C pointers], you need to use indexed
<1> thx for ur explain mwk , i have understood :)
<1> now i can keep reading :)
<2> np
<3> what level does the CPL have to be to change the DS register?
<4> elo guys.. i got a lil problem.. how do i output a hex value of 0xFF into integer? like printing in screen as "255" ?
<5> hi, anyone here experienced with zilog microcontrollers? not sure if it's relevant to the topic though (and unsure of where else to ask such questions)
<6> oh, you ought to ask in ##microcontrollers
<5> ah i see, thanks :-)
<6> and btw no i havent
<7> anyone here?
<7> How I can jmp to an hardcoded address?
<2> you just... jump there
<2> jmp 0x1234
<7> Ok. but i'm using real mode
<7> and want to jump to address 0x1000. Aint the address shifted 4 to the left then?
<7> so I need to say jmp 0x0100?
<7> I tried jmpw... but didnt work.. jmp did work :-)
<2> sigh... just... rtfm
<2> addresses in RM are split into two parts
<2> segment:offset
<2> and REAL address in memory is computed as segment*16 + offset
<2> now, about jmp
<2> jmp changes offset but doesn't change the code segment you're in
<2> so jmp 0x1000 will jump to current_code_segment*16 + 0x1000
<2> if you want to jump with segment change, jmp 0x0000:0x1000
<2> 0x0000 here is the segment
<7> I need to change code segment too.. need an "long jump".
<7> ok. cool.
<2> er... you using gas?
<7> yep.. gas. aint that the name of it.. when you movw source, destination ?
<2> ah. segment changing syntax is different in gas. it's ljmp 0x0000, 0x1000
<7> Ah!
<7> Error: too many memory references for `ljmp'
<7> when I try two arguments
<2> uhm... ljmp $0x0000, $0x1000
<2> forgot about this small thingie...
<7> nice. Works :-)
<7> thanks.
<7> any idea where I can look up things like this?
<2> actually, depending on segment organisation, ljmp $0x0100, $0x0000 could be better...
<2> well, ljmp is described in gas manual
<7> looking for a good at&t gas book or something.
<7> Hm. ok.
<2> info as
<2> section 8.11.2
<2> machine dependencies --> i386 --> i386-syntax
<8> re
<9> Does annyone know how i do a long jump? I want the instruction pointer to point at 0x1000 but "jmpl 0x1000" doesnt work
<10> depends on the syntax
<10> in AT&T its 'ljmp'
<9> its AT&T
<9> and i have tried that too :(
<9> Error: suffix or operands invalid for `ljmp'
<10> what did you write?
<9> ljmp $0x1000 #Long jump
<10> you can use a '$' there



<9> can or can't
<9> because if i didnt, i got this message: Warning: indirect ljmp without `*'
<10> cant* *G*
<10> yeah
<9> so should it be * instead of $ ?
<10> yes
<9> nice! it worked :) thanks alot
<9> time to go home for the day :)
<2> NO!
<2> slash_: wrong.
<2> ljmp *0x1000 takes 16:16 far pointer from memory cell 0x1000 and jumps to that address
<2> he needed ljmp $0x0000, $0x1000 [to specify both parts of address]
<10> hehe
<2> though... if he didn't realise that he needs both segment and offset, he probably doesn't understand segmentation anyway and should keep the **** away from ljmp
<10> i know but that wasnt the question
<2> he said he wanted ip == 0x1000
<2> actually... it's the second guy today to want to ljmp to 0x1000...
<10> whoops :D
<10> i guess to much debugging today
<2> blah. he'll come back. i feel it.
<11> whats the best way to do a stack trace on x86 with frame pointer omission turned off?
<2> DWARF.
<2> er... omission turned off?
<2> with ebp chain, just... follow the chain, what's the big issue?
<11> erk, fpo turned on :)
<2> DWARF .dwarf_frame
<2> compile with -g
<2> and gdb will show you the backtrace
<2> alternatively, you could compile with -fexceptions and mis-use .eh_frame for that... this has the advatange that the program can stack-trace itself with _Unwind family of functions
<2> but is tricky
<11> i'm...erm...using a different os/compiler *ducks*
<12> where can i find some good asm tutorials ?
<12> i need a list of all the jump commands
<13> jmp jge jle jg jl ja jb jnz jne jc
<12> ya i need to know what they all do
<13> jmp = unconditional jump
<13> jge = jump if greater than or equal
<13> jle = jump if less than equal
<12> greater then less
<13> jg = jump if greater
<13> jl = jump if less
<13> je = jump if equal
<13> jne = jump if not equal
<13> jc = jump on carry
<13> jnz = jump if not zero
<13> jz = jump if zero
<13> ja = jump if above
<13> jb = jump if bellow
<12> jc and jnz ?
<13> Yes
<12> ahh
<12> ok
<12> thanks :)
<13> no prob
<12> hmm
<12> i'd like to learn asm but it takes soo much code just to do the simplest stuff
<14> download docs from amd's site, they have a good listing of all the instructions
<12> when C++ allows me to make alot better and more complicated stuff in no time
<2> so stick to c++.
<12> thats what i'm doing :)
<12> but is asm worth learning ?
<13> I learned ***embly mostly for the braging rights
<2> it's good idea to learn it. but it's rather bad idea to actually code in it.
<12> hmm
<13> The way to use it is to optomize compiler generated code by hand
<12> what code would need to be optimized?
<13> Pretymuch anything involving graphics
<12> O_O
<12> what is there to optimize exactly
<13> dirrectx code
<12> is the compiler gonna stick in an extra for(int i = 0; i < 10000; i++) /*continue*/ lol
<12> hmm i use sdl for gfx mainly.. i'm sure thats slower than directly using directx
<13> no but it is going to do other stuff, for instance, mov eax, mem1; mov mem2, eax; can be replaced with push mem1; pop mem2
<13> the latter will be faster


Name:

Comments:

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






Return to #asm
or
Go to some related logs:

#math
structure has no member hun
#gentoo
gaim maybe the room is full
#bash
msse3 turion
/var/log/messages numa
debian Host 'localhost.localdomain' is not allowed to connect to this MySQL serv
banananaphone
#gentoo



Home  |  disclaimer  |  contact  |  submit quotes