|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
Before the setjmp function is called, the previous values of the stack pointer, instruction pointer, and other registers should have been stored on the stack, so you can read those in the setjmp function (e.g. by declaring an array of ints and accessing it out of range) and store them into global variables.
In the longjmp function, you can read the global variables and write to the same locations in the stack before returning. When the longjmp function returns, it will load the overwritten values in the stack into the registers.
To get this to work, you'd have to look up the specification for whatever calling convention you're using to know which parts of the stack to read and write.
|
|
On May 18 2017 08:38 Nesserev wrote: Btw, I think you have a paradox: "How to store the original stack pointer on the stack if you first have to change the stack pointer to store it", no?
You don't need to move the sp to write into the stack. sw $sp, 4($sp) would do the trick but it's slow and unnecessary since the compiler can keep track of the stack depth and use add/sub instead.
|
so I went to the TA and he basically looked into the assignment portal or whatever and found one kid who handed it in so far. He looked through the answer and told me that I was pretty much on the right track except I needed to also change the frame pointer and add in dummy functions and __main() - no idea why, to get it to work. After I tried and it still didnt work properly, he told me just to double check my code and that it might work on the mips simulator even if it doesnt work after compiling in c. if I still can't get it he said to just hand it in and I"ll get most of the credit for figuring out the logic of the code.
so I'm still just as confused as before lol. but apparently he ran the kid's code and it worked. this class sucks
|
Well, you can't move the stack pointer but you can move the stack content. So I would try to copy the content of the stack down from the setjump point to the longjump point. Obviously you wouldn't really be unwinding the stack and it wastes stack space but I think it fits the requirements of this assignment.
|
Make sure to post a solution here if it'll be available after it's all said and done. It got me curious...
|
Maybe one of you can explain it to me.
So you record a pointer to setjmp, and at longjmp you copy the content all the way to setjmp
so that's cool and all but you have values on the stack and how do you know what they correspond to?
If you had variables assigned to values, the stack is going to have those values on it but you won't know what the values mean.
|
That doesn't matter as long as you don't have pointers into the stack. Only thing you need to fix up are the frame pointers and you can do that since they form a linked list.
|
Question on Microsoft Access. I'm confused as hell as to why this isn't working.
I have two simple queries:select * from TableA left join TableB on TableB.ColumnA = TableA.ColumnA Returns all rows from TableA.
Then: select * from TableA left join TableB on TableB.ColumnB = TableA.ColumnB Returns only rows from TableA where ColumnB is the same.
The first query works like a true left join, giving me all rows from TableA. The second, despite that I've clearly indicated "LEFT", acts like an inner and only gives me matching rows. I cannot fathom why it would do this, why the left join would work as a left when joining on one column but as an inner when joining on another.
I've googled and couldn't really find anything. Was wondering if anyone has seen this before.
Edit: I take that back. I dug a bit more into it and found this: http://allenbrowne.com/bug-10.html. The example I used above is just an example, but what I'm actually doing is joining together two queries, and in one of the queries I have a literal value. Turns out that any join on a literal value will act as an inner join. *sigh*
|
My guess is a typo in your query. The documentation says Ms Access has a left join and documents that it works as you'd expect.
|
I want to make a program that grabs the css of any given page and pulls certain information out of it. I can easily make a program in the language of my choosing that opens a css file and parses through it, but what should I use that would do that through my browser?
I was thinking something like a chrome extension that does the equivalent of pressing F12, finding the css source, sending it to be processed, and spitting out a result.
Anyone have any advice on pointing me into the correct direction with this idea?
|
|
On May 23 2017 11:45 Nesserev wrote:
EDIT: don't know what the alternatives for firefox et al. are, but your options should be similar, no?
It is in your signature...
|
|
Also I stole your idea, didn't realise how bad KMD thread was :D
|
On May 17 2017 05:17 Djagulingu wrote: I'm currently going through tutorials of elixir and phoenix framework and I have been reading it like "Oh shit" "Oh it's nice" "Oh shit this is nice" "Damn this is good" "Hell yeah, this shit is awesome" "Oh my god" "Oh wow" and such. Shit is so easy to learn too. Does anyone here have real world production experience of elixir and phoenix?
i have a little bit of experience with erlang.. what is the advantage of elixir? (In my experience erlang is pretty good at some very specific tasks, basically working with distributed systems, and I do prefer functional programming)
|
Poll: Which is it?React (6) 75% Vue (2) 25% 8 total votes Your vote: Which is it? (Vote): React (Vote): Vue
|
Hyrule18977 Posts
I really like Vue, but all the jobs are react
|
It's front end, who cares?
|
Hyrule18977 Posts
|
|
|
|