| |
| |
| |
|
Page: 1 2 3
<BobtheAvenger> hey <skuggi> ho <BobtheAvenger> sup? <skuggi> just about to go to bed. <BobtheAvenger> hmm, bed, i should do that too <BobtheAvenger> but i'm outa a mood so i got energy <skuggi> well, i've got an exam tomorrow morning, so i'd like to sleep some.. <skuggi> night. <BobtheAvenger> ooo, thats what i forgot <BobtheAvenger> peace <looth> hum... when I get an interrupt... do I need to provide an interrupt stack? I mean... else, it will use whatever thread stack was active? <prolific> What's the syntax to jmp ahead X number of bytes? <Robert> jmp $+123 in NASM/FASM/YASM, I think. <prolific> Ah nice. What about Gas? <Robert> No idea. <Robert> rtfm? :) <prolific> Yeah.. :p <imaginator> prolific: you can do: jmp (1f + 123) \n :1 <prolific> imaginator, I don't get it :/ <prolific> 1f and 123 are arbitrary? <imaginator> :1 is a local label. 1f means the address of local label 1 that is forward <prolific> Oh interesting <prolific> But since when does jmp care if a label is forward or backward? <imaginator> prolific: 1f and 1b are just special gas instructions for local labels. <imaginator> you can also do things like: 2f and so on <prolific> Hm. Placing ':1' on a line by itself doesn't work. Nor 1: if that's what you meant <prolific> 2f = two label's forward? <prolific> Or a label named '2' that is forward? <imaginator> oh I meant 1: sorry <imaginator> here's an example: 1: \n movl $1b,%eax \n 2: \n movl $2b,%ecx <prolific> So it wouldn't work if I did: jmp here+number_of_bytes? <prolific> here = the label just following the jmp <imaginator> it should work. I think the jmp is relative to the next instruction. <prolific> I think so also <imaginator> jmp (1f + (2f - 1f)) <imaginator> 1: <imaginator> ret <imaginator> call abort <imaginator> 2: <imaginator> ret <imaginator> that seems to work <imaginator> at least it doesn't abort and the code returns <prolific> So, that example wouldn't work if the first line were: jmp (one + (two - one) )? <prolific> Sorry, I'm slow <imaginator> are one and two labels? <prolific> Yes; and the same as in that example <prolific> Just 1 = one. etc <imaginator> it should work <imaginator> try it :) <prolific> Ok. Thanks for you help <prolific> I'm :p <imaginator> you're welcome. have fun <prolific> I just have a bunch of string comparisons and call'ing procedures based on which is inputted. So instead of saying: if this!="command1" / je command2 <prolific> I want to simply jmp ahead 9 bytes to the next string comparison <prolific> But now it looks like I'm going to have labels all over the place with this method :) <prolific> M way would require a new COMMAND_X label for each string comparison I add <prolific> My <prolific> Wish I could just jmp $9 :/ oh well <imaginator> jmp (label + 9) ; but why do that? labels are meant to be used. I mostly use local labels for anything that isn't a procedure. <imaginator> one thing I find especially frustrating in asm in unrolling loops. I'm still practicing this a lot <prolific> Well, my basically boils down to the switch/case concept, although I'm trying to implement it myself of course. In psuedo code I have something like: if buf != this_string: jmp do_next_comparison / do_next_comparison2: if buf != this_string2: jmp do_next_comparison3 <prolific> But each time I add a new command (string comparison), I have to add another "do_next_comparisonX" and replace the old...bleh <prolific> And each jmp do_next_comparison is a constant distance <prolific> Ah , you mean like detecting compiler-rolled loops? <imaginator> I think switch/case uses a jump table usually., so there is like an array of pointers in memory for code to jump to, and maybe a range cmp before that. <imaginator> prolific: no. I mean unrolling loops in pure asm code. <prolific> Right <prolific> imaginator, For what purpose? <imaginator> more speed <prolific> Hm can you give me an example? <imaginator> sure, just a sec. I'll show you something I want to unroll <prolific> Ok <imaginator> http://rafb.net/paste/results/GcWQDf59.html <prolific> So you wouldn't totally get rid of the loop in that case, right? <imaginator> what I want to do is more bts patterns, but also not set bits that shouldn't be set. <imaginator> I suppose I should do something like Duff's device using the modulus as an index into some labels <prolific> Ah, I see how that can be _a lot_ quicker <prolific> Later <|isubx|> woohoo almost got it http://www.rafb.net/paste/results/fAwGOE46.html <|isubx|> its big and its ugly but it compiles and it works outside of the fact it is skipping the first 3 fibonacci numbers 1,1,2 starting at 3 :) <daleXXgribbel> hey all <|isubx|> hello Mr. Gribbel <daleXXgribbel> does this room include the masm ***embler? <imaginator> daleXXgribbel: yes <|isubx|> who has cursed you with masm :P <daleXXgribbel> my instructor ;D <|isubx|> sounds like were both in the same leaky boat <daleXXgribbel> i'm working on a recursive fibonacci procedure that is just not working <|isubx|> lemme guess your also reading the holy grail of kip r. irvine :P <daleXXgribbel> lol, yes, which i have been told is not a great source <|isubx|> the book is actually fairly good.. its his damn library that is garbage <daleXXgribbel> haha <|isubx|> what school you going too? <daleXXgribbel> well my instructor tells me that the book isn't great, but its been a decent resource <daleXXgribbel> austin community college <daleXXgribbel> you? <|isubx|> rofl! mr black? <imaginator> you're both in the same cl*** aren't you? <|isubx|> sounds like it! rofl <daleXXgribbel> hahaha <daleXXgribbel> thats awesome <|isubx|> and who in my cl*** are you?? lol <daleXXgribbel> ben, and who are you? <|isubx|> gabriel <daleXXgribbel> which program are you working on? <|isubx|> same one lol finally got it working for the most part <daleXXgribbel> oh man <daleXXgribbel> i have been slaving over this thing for every night over the past week and i feel like i'm still not making much headway <|isubx|> i have been bugging these guys all weekend <daleXXgribbel> haha <|isubx|> ohh yea ive been bangin my head against the desk <|isubx|> my last problem at this point is my fib sequence is starting at 3 and skipping 1,1,2 <daleXXgribbel> so, does it work for 4? <daleXXgribbel> or above? <|isubx|> ya works fine <daleXXgribbel> oh thats cool <daleXXgribbel> mine works great for 0,1, or 2 <daleXXgribbel> lol <|isubx|> i read lots of other peoples source on fib sequences posted on the net and then my biggest problem was doing it different from thiers <daleXXgribbel> yeah i've gone over lots as well, none seem to be helping me much <|isubx|> and its pretty ugly but better than just living in a debugger <daleXXgribbel> sure <|isubx|> evening xark <daleXXgribbel> did you find one example that was particularly helpful? <|isubx|> here is sheng jiang's source.. he took mr black last semester http://spaces.msn.com/members/jiangsheng/Blog/cns!1pVUmC6mid-3zVpLZNQTgtuw!187.entry <|isubx|> met him in the computer lab acouple weeks ago <daleXXgribbel> wow <|isubx|> i believe he is the student who mr black was saying came back to test his microcode on the pic <daleXXgribbel> oh thats awesome <|isubx|> funny how small a world we live in! <daleXXgribbel> yeah i enjoy the cl***, i think he is a good instructor <daleXXgribbel> haha definitely <daleXXgribbel> sorry, i don't think we've actually met in cl***, i have longer hair and gl***es <|isubx|> ya he is, im just not that great a student lol <daleXXgribbel> haha <|isubx|> ya last tuesday you came into the computer lab before cl*** and you sat down next to me <|isubx|> usually have a black cap on, think a guy sits between us in cl*** <daleXXgribbel> oh cool <daleXXgribbel> how did you do on the test? <|isubx|> made an 88 <daleXXgribbel> thats awesome <|isubx|> ya i should have done better, everything i got wrong was stupid stuff that i knew better <daleXXgribbel> yeah i studied a ton for it <|isubx|> same here, i had 2 other tests that same day tho was a day from hell <daleXXgribbel> yikes <daleXXgribbel> omg it is finally giving me something back <|isubx|> lol it always feels so good when things start to work <daleXXgribbel> i lost so much sleep last week over this
Return to asm or Go to some related
logs:
beginner moo.dll np script now playing java
|
|