I have just spent most of today (sunday) working on my assembly programming assignment..its finished by the way.....lol, I just have to write another version of the code that runs faster. It was just a matrix multiplication code in C that we had to rewrite in MIPS 64 Assembly. The hardest part for me was knowing how to calculate the index in a 2-d array in assembly. I finally figured it out, so check this out:
consider a simple 2-d array a[i][j]. To get the element at this location, we simply use the formula:
(i * max_index_of_i +j)<<3.
We need to shift by 3, because in assembly, we are just stepping through an array, and each element occupies 8 bits.
So this principle is shown in MIPS64 assembly code to reference p[i][k] in a 3x3 array.
daddi $t7, $r0, 3 ; $t7=3
dmul $t6, $t0, $t7 ; $t6=i*3
dadd $t6 , $t6, $t2 ; i*3 +k
dsll $t4, $t6, 3 ; $t4=(i*3+k)<<3 multiply by 3
daddi $t8, $r0, p ; get base address of p
dadd $t8, $t8,$t4 ; $t8 has the address of p[i][k]
lw $t9, 0($t8) ; $t9 has the value of p[i][k]
Now I am getting back to debugging. See you later!
Sunday, October 28, 2007
Wednesday, October 24, 2007
We finally finished the first assignment of the compiler construction project, which was to make the reference compiler recognize records. We were able to compile the test file, record.ast, and it generated the right c-code. Today, we simply ported the code from the old compiler to the new one. The new one had some new assert statements, to check if the right subtype was being used, and all, but it didn't take so long.
We now began the testing phase. We have this Java applet called diagnostix which is able to evaluate the quality of our test suite, and it showed us that our test cases detected 3/5 bugs the compiler should guard against...not bad for our first day of testing, and we are way ahead of schedule.
An interesting case we had was checking that a record name could not be used as a variable name, and also checking that it is illegal in our compiler to check for equality of two records.
Later, thats all for today.
We now began the testing phase. We have this Java applet called diagnostix which is able to evaluate the quality of our test suite, and it showed us that our test cases detected 3/5 bugs the compiler should guard against...not bad for our first day of testing, and we are way ahead of schedule.
An interesting case we had was checking that a record name could not be used as a variable name, and also checking that it is illegal in our compiler to check for equality of two records.
Later, thats all for today.
Thursday, October 18, 2007
Compiler construction
I am currently working on the compiler construction course with my greek partner, and its one of the baddest courses in my msc program. We basically have a reference compiler written in C, called asterix, and we are meant to make the compiler recognize record structures. The code generation part has to generate c-structs for the records. For the second assignment, we are meant to change the entire back end code generator from producing C code to assembly.
So far so good, things are alright, we were able to compile a simple record program, and our compiler was able to generate C structs, which was a relief.
Now we need to implement the dot (.) operator so that it is possible to do stuff like this:
record foo is
begin
a:int;
end
Now, our extended compiler should be able to handle statements like
f:foo /*record declaration */
f.a:=2.
But unfortunately, we still get a segmentation fault, which we might tackle tomorrow.
Well more news later, and Im still thesis hunting.
So far so good, things are alright, we were able to compile a simple record program, and our compiler was able to generate C structs, which was a relief.
Now we need to implement the dot (.) operator so that it is possible to do stuff like this:
record foo is
begin
a:int;
end
Now, our extended compiler should be able to handle statements like
f:foo /*record declaration */
f.a:=2.
But unfortunately, we still get a segmentation fault, which we might tackle tomorrow.
Well more news later, and Im still thesis hunting.
Wednesday, August 15, 2007
Finally, I was able to install, MySQL 5.0. I had problems with it before. I am not sure about why it worked now, but maybe its because I ran spybot on my system and found out that there was a script on my system that had messud up my security centre updates....
Well now I have entered into the cool part of ruby, which is the rails framework. The framework uses the WEBrick server, and all I had to do was just type
ruby script/server, at the command prompt, and that was enough to start the server. This dosent need any fancy XML configuration files like I was doing with Apache Tomcat in the days of JSP.
Then I simply opened my browser window and entered this url http://localhost:3000/
and viola:

Rails uses a Model View controller paradigm, and one has to create a controller, and give the controller a couple of actions.....
The controller is a .rb file which has a class inheriting from class ApplicationController.
Well I gotta go back to study, I will write some more later.
Went to a bookstore and saw this cute book on python.......who knows,that might be my next project......
Well now I have entered into the cool part of ruby, which is the rails framework. The framework uses the WEBrick server, and all I had to do was just type
ruby script/server, at the command prompt, and that was enough to start the server. This dosent need any fancy XML configuration files like I was doing with Apache Tomcat in the days of JSP.
Then I simply opened my browser window and entered this url http://localhost:3000/
and viola:
Rails uses a Model View controller paradigm, and one has to create a controller, and give the controller a couple of actions.....
The controller is a .rb file which has a class inheriting from class ApplicationController.
Well I gotta go back to study, I will write some more later.
Went to a bookstore and saw this cute book on python.......who knows,that might be my next project......
Tuesday, August 14, 2007
Thesis hunt
I havent blogged for like a month now........its because I didnt think I had done anything freaky enough to blog about.
Right now I am shopping for a master thesis project in a company. Ive gotten a couple of them, and Im still chilling and watching, till I make my final decision.
One interesting thesis project is about a repository for documentation. Different stakeholders in the system (i.e mechanical engineer, software architect), should be able to access the system and view documentation, relevant to their area of interest.
The repository is basically for embedded systems, and the main snag is that embedded systems are made up of hardware and software, and mechatronical parts, and there isnt any sort of way of defining relations between these artifacts.
UML cant be used, cus its just meant for modelling OO software systems, so I need to
1 Find relations that can be used in this context.
2.See how all this can be applied in a reverse engineering framework.
The project also involves some traceability, in the sense that a user should be able to trace a certain requirement from the highest level of abstraction, throughout the system, into hardware and software parts.
Whew.......thats just one of them........I will be back later.
Meanwhile, Im still doing ruby, but taking it slowly.
Right now I am shopping for a master thesis project in a company. Ive gotten a couple of them, and Im still chilling and watching, till I make my final decision.
One interesting thesis project is about a repository for documentation. Different stakeholders in the system (i.e mechanical engineer, software architect), should be able to access the system and view documentation, relevant to their area of interest.
The repository is basically for embedded systems, and the main snag is that embedded systems are made up of hardware and software, and mechatronical parts, and there isnt any sort of way of defining relations between these artifacts.
UML cant be used, cus its just meant for modelling OO software systems, so I need to
1 Find relations that can be used in this context.
2.See how all this can be applied in a reverse engineering framework.
The project also involves some traceability, in the sense that a user should be able to trace a certain requirement from the highest level of abstraction, throughout the system, into hardware and software parts.
Whew.......thats just one of them........I will be back later.
Meanwhile, Im still doing ruby, but taking it slowly.
Thursday, June 7, 2007
LaTex
I have to write this report for a course called computer architecture: special topics.
We were required to read a few scientific papers relating to any area relating to computer architecture, and then make some presentations and write a report.
I was all right with it, until the prof announced he wanted the report to be in a format called LaTex.
First I was like WTF? Then I got a book from the library and checked it out. Seems its a markup language for formatting scientific journals and reports.
I was like "why cant these dudes just use word and get it over with?" So in addition to research and all, I had to learn a new markup language.
Well I decided to stop complaining and installed Miktek, and TeXniCentre. And I jumped in, as I love to do.After doing a few trial runs, and viewing the output in PDF, I could see why scientists and all like using this . The output is of really high quality and really really tight. So if you feel like, just try it and play with it. If you could learn HTML, then I am sure you can handle LaTex.
Ciao!
We were required to read a few scientific papers relating to any area relating to computer architecture, and then make some presentations and write a report.
I was all right with it, until the prof announced he wanted the report to be in a format called LaTex.
First I was like WTF? Then I got a book from the library and checked it out. Seems its a markup language for formatting scientific journals and reports.
I was like "why cant these dudes just use word and get it over with?" So in addition to research and all, I had to learn a new markup language.
Well I decided to stop complaining and installed Miktek, and TeXniCentre. And I jumped in, as I love to do.After doing a few trial runs, and viewing the output in PDF, I could see why scientists and all like using this . The output is of really high quality and really really tight. So if you feel like, just try it and play with it. If you could learn HTML, then I am sure you can handle LaTex.
Ciao!
Thursday, May 31, 2007
pimpin my windows
I just finished pimping my windows xp. I basically just replaced my utheme.dll file with a special patch, enabling my xp to support themes.....especially vista.........lol
So men My windows is the bomb!!!
So men My windows is the bomb!!!
Subscribe to:
Posts (Atom)