Today was a good day. The MAR test was okay. I think I did very well, but I'm not too sure about one of my answers. I should have gotten all the extra credit, so that will make up for my mistake. Lab was similarly easy. We had to write a MARIE program to handle: (A*B)/(C-D). It wasn't all that hard. I learned what the Jns command does. It stand for "Jump And Store", meaning it will jump to a location and store its previous location in the new address. Basically, wherever you're jumping to has to be a variable. That way it will store the previous location in the variable and continue the program after that variable declaration. At the end of the "function" (or whenever you want to return from where you came from), you call JumpI variable. It will tell the program to jump to the address that is stored in the variable. Thus, the variable is a pointer, pointing to the address of the last jump point. It's pretty cool, and definitely handy for creating functions. I was using goto (Jump) in my last program. And now I don't have to.
Lecture was about cache memory. I understand it all, but I don't entirely see what I can do to utilize this knowledge. I mean, I have no idea how to incorporate the machine code into my C++ programs. Next month, we learn about the Game Boy Advance architecture, so I suppose we'll learn about it then. I cannot wait.
***
I haven't made any further progress on my OpenGL project. I could be working on it now, but I'm lazy. And I'm lead to believe all I have left is textures, audience chairs, and cameras. The cameras should take about half an hour, more if I'm trying hard. The chairs should take about an hour: part design, part placement. Textures ... that'll take a while. I guess I'll be pretty busy on Sunday. But it shouldn't be too bad.
***
Bleach 60 should be subbed tomorrow! I can't wait. They finally wrapped up one battle, and now we're waiting to see about the rest of them. Though it looks like they've started a new battle. Wooh!
***
Still nothing from Laptops-Plus. One of my friends turned his laptop into school the Monday after break. (Mine was the Monday before break.) He just got an email from the school saying it's ready. So ... I may have been better off not taking it in to Laptops-Plus. Apparently HP doesn't give them high enough priority to get system boards shipped out fast. Maybe tomorrow? I'll probably call them. I won't have time before school to pick it up on Thursday. Though, I've got that feeling they've re-imaged my harddrive, so it probably doesn't matter. I'm told that most places have that "shoot first, ask questions later" policy. Jerks.
***
I'm bored. I guess I'll play Slay for a while and then watch a movie.
2 Comments:
You can put assembler code in line with C++ code with the "asm()" declaraction. The stuff inside the parentheses would be pure assembler code text for whatever machine. Very machine and compiler specific, though. It's only used at the very lowest level of implementation, but then that's what your MAR class is all about.
There's different kinds of cache memory - instruction cache, data cache, etc. You don't usually (or ever?) use it directly, but knowing how it works in the particular machine can help you optimize some code. We've got some performance issues here that seem to be due to poor cache hit rates (instruction cache in this case, I guess). Part of the solution has been to not "inline" certain methods -- but the developers were dumb and inlined some huge-ass functions. Yeah, yeah ... Tjarks's law #1 ... but what they were doing was just indiscriminate. No engineering judgement at all.
But no one except you and I and Matt have any idea what I'm talking about.
Yeah, I've been tempted to declare large inline functions just because I'm too lazy to put them in a .cpp. But, of course, I don't.
Post a Comment
<< Home