Pages

Sunday, December 20, 2009

Playing with light




Posted by Picasa

Thursday, September 3, 2009

My responsibilities as a software engineer

I wonder, if i can really be as responsible as i mention here, but i would like to believe some of you will.
As a software engineer, I will:
1) Make sure there are no leaky taps in my part of the building, as i hate fungus.
2) Do politics for the best cabin.
3) Make sure i have the best looking secretary.
4) Always make sure my team is efficient enough to work in my abscence.
5) Ocassionally plant crackers in my Project Managers office.
6) Write programs without semi-colons.(i can actually write any program without semi colon).
7) Move from one city to another very often and claim hilarious amounts of Travel and Reallocation allowance.
8) Write backdoors into defense softwares, and make the government pay me extra loyalty during war.
9) Create trojans and worms and hide them in minesweeper and solitaire.(So that all the suckers who depend on Windows, Do so with some action packed into it)
The topic was suggested by Mrs. Jyothi Neeli as part of a mini class assignment and is written on a lighter note let me know if you hav better ideas.
-- Hemanth G
- Sent Via Nokia E90

IGN Video: Call of Duty: Modern Warfare 2 Xbox 360 Series - IGN Rewind Theater: Flag Runner Multiplayer

IGN Video: Call of Duty: Modern Warfare 2 Xbox 360 Series - IGN Rewind Theater: Flag Runner Multiplayer

Wednesday, September 2, 2009

Lumos launch deffered

The much anticipated launch of Lumos has been delayed, due to technical issues.

The security issues faced in facebook authentication during last week has been fixed.

The delay was due to non availabilty of server, thanks to the computer science dept. We now have a dedicated server hosting the website.

Minor setups need to be made and the user interface finalized, the Privileged preview id's should be dispatched by Fri 4 September 2009.

The delay is regretted, but our dedication is to give you a stable platform.

---Lumos
-- Hemanth G
- Sent Via Nokia E90

Monday, August 31, 2009

What is LUMOS

What is LUMOS?

We have faced this question a lot of time on campus, so here is a detailed idea.
LUMOS is the name of the magazine started by The OPEN Initiative, consisting of students across the campus. The magazine dedicates it self to showcasing the variety and uniqueness.

The OPEN Initiative plans to extend LUMOS as a social network, to bridge the communication gap faced by individuals and special interest groups.

This is achieved in three stages. The first is to network all students and faculty of gat and help them work more productively on the decision making front and getting instant feedback.

The second stage consists of connecting the special interests groups with groups of other colleges enabling a huge amount of information sharing and networking.

The third stage consists of the implementation of the AI, since the launch the social network collects a lot of information about users and their behavior anonymously and continually tries to make itself suit the user making itself better day by day.

All this on a simple platform at no cost is the vision of The OPEN Initiative. And added support to selected ideas or concepts will be given by IT VIRTUOSO both in terms of finance and human resource.

--LUMOS

Confirmation SMS's sent

The confirmation SMS to all GATian's who are interested to join LUMOS has been sent, if you have not recieved the SMS even after you have sent the email please resend your SMS.

There has been a small error in the SMS that has been sent you will recieve the logins on SEP 2 WEDNESDAY and not on AUGUST. The error is regretted.

The official blog for LUMOS is : http://gatlumos.blogspot.com/

-- LUMOS

The logo design is almost over.

The logo design as you can see below has almost been sketched out and all resources are being put into making a 3d perspective of it, here is a basic single color theme of the logo. The students on top the flames are not easily identified, may be we need to use a different color or variation. suggestions invited.


Sunday, August 30, 2009

Privileged preview ID's

You can expect your PPID's in your inbox by monday evening.

-- Hemanth G
- Sent Via Nokia E90

Saturday, August 29, 2009

Lumos@GAT Delayed

To all who were waiting to get logins to lumos today, we have run into some issues on our server, you will get the logins on your email id by monday noon.
Attachment includes the note and its objects

-- Hemanth G
- Sent Via Nokia E90

Sunday, August 23, 2009

GPRS comparision in Bangalore

I have been using GPRS on my phones since past 2-3 yrs and you have to really appreciate the way the services have grown here in Bangalore but there is much left to be desired. So here i present a comparison of the most popular service providers and also my experiences using them.


AIRCEL:



The most hyped Pocket Internet service of aircel, is a really dismal and hopeless service in Bangalore the bandwidth is very low compared to AIRTEL and also the connection is never constant even though the network reception is good in your area, a simple traceroute command reveals that all the traffic is routed through a proxy server located in Hyderabad.


They offer two connection plans


1) 3 days -> 14 INR


2) 30 days -> 98 INR




WARNING:


Here a day is with reference to 00Hrs unlike Airtel where a day means 24Hrs. and there is no message when u have gone back to data plan and the first time it cost me very dearly.


And also the service cannot directly or automatically activated, you have to find the nearest Aircel recharge center and recharge for the above mentioned amount, which is pathetic.



BSNL:



BSNL has a few good services up its sleeve like Blackberry services(PUSH EMAIL), and its GPRS, but the speed leaves much to be desired for even though the speed is constant, But if you are a postpaid customer then you may have better offers here.


The GPRS activation is a pain in BSNL as it requires you to submit a letter and wait for them to activate it, it would have been better if it were ON DEMAND.



AIRTEL:



The king of them all The MOBILE OFFICE service is really excellent and gives you complete bandwidth of the GPRS and really good connection(sometimes better than its Network reception!!!).


They offer two connection plans


1)24Hrs -> 20 INR


2)7*24Hrs -> 99 INR




The best thing though is that you can activate the service anytime just send a message and its done and there is also a message sent to you when the service time is up and you are migrated to the DATA PLAN.




This is the best service i have used till date and trust me for my usage its pretty matched both on the iPhone and E90 Communicator, the features i use include GPS, PUSH EMAIL, Browsing, Active Downloading.



VERDICT:


AIRTEL is the best among the available services in Bangalore, May be because it also has a pretty good Broadband service at its backbone.




Technorati : , , , , , , , ,

Del.icio.us : , , , , , , , ,

Friday, July 10, 2009

I wish I still had my Inflatable Dolphin

Inflatable Dolphin


I still remember the dolphin it was my first king size toy. In fact it was bigger than me, and the first time I actually learnt that there is life underwater.




It would be great to still have it, even thought I was very small when I had it, I faintly remember it being ruptured and me trying to mend it but............




Anyway its been my dream to swim alongside a dolphin since then and when I do it I'll definitely have more to write about it.





Del.icio.us : , ,

Sunday, May 17, 2009

Microprocessor Software Lab in 50 mins::Everything YOU NEED TO KNOW

I have commonly found everyone around me complaining that 8086 programming lab under VTU syllabus is difficult and preparing for it myself i could reason out a few obstacles in approach to it. This article is intended to help any one with basic programming knowledge. I have tried to compile all the things you need to remember and how to remember the programs. I don't claim for it to be complete but you can suggest further additions or correction in the comments area, if this post is helpful to you and would like more of such article please leave a comment.If you would like to Co Author any article with me please mail me on : hemanthg4@gmail.com


These are ESSENTIAL things you need to take "care of" in the programming lab.


{I would suggest you learn them or remember them but, out of box solutions are not discouraged ;-)}


Usually in C/C++ Programming knowing the syntax of all the commands/constructs/functions we will be using and the logic of the program is enough to come out with flying colors. Its the same with 8086 programming i would suggest that you first understand the logic of the program and then adjust the logic(usually minor changes) to 8086 way of programming then you can easily write a program in 10mins(That's for the bigger ones). This might sound all awkward but the illustrated program at the bottom will show you how easy it is.


The first thing you need to know in 8086 is the places where we store data, we store them based on the usage of the data in the following places:


general purpose registers



8086 CPU has 8 general purpose registers, each register has its own name:



  • AX - the accumulator register (divided into AH / AL).

  • BX - the base address register (divided into BH / BL).

  • CX - the count register (divided into CH / CL).

  • DX - the data register (divided into DH / DL).

  • SI - source index register.

  • DI - destination index register.

  • BP - base pointer.

  • SP - stack pointer.


Despite the name of a register, it's the programmer who determines the usage for each general purpose register. the main purpose of a register is to keep a number (variable). the size of the above registers is 16 bit, it's something like: 0011000000111001b (in binary form), or 12345 in decimal (human) form.


segment registers





  • CS - points at the segment containing the current program.

  • DS - generally points at segment where variables are defined.

  • ES - extra segment register, it's up to a coder to define its usage.

  • SS - points at the segment containing the stack.


although it is possible to store any data in the segment registers, this is never a good idea. the segment registers have a very special purpose - pointing at accessible blocks of memory.


special purpose registers





  • IP - the instruction pointer.

  • flags register - determines the current state of the microprocessor.


Memory Access


To access memory we can use these four registers: BX, SI, DI, BP.


combining these registers inside [ ] symbols, we can get different memory locations.


Variables


Variable is a memory location. For a programmer it is much easier to have some value be kept in a variable named "var1" then at the address 5A73:235B, especially when you have 10 or more variables.




Our compiler supports two types of variables: BYTE and WORD.



Syntax for a variable declaration:




name DB value




name DW value




DB - stays for Define Byte.


DW - stays for Define Word.




name - can be any letter or digit combination, though it should start with a letter. It's possible to declare unnamed variables by not specifying the name (this variable will have an address but no name).




value - can be any numeric value in any supported numbering system (hexadecimal, binary, or decimal), or "?" symbol for variables that are not initialized.


Arrays




Arrays can be seen as chains of variables. A text string is an example of a byte array, each character is presented as an ASCII code value (0..255).




Here are some array definition examples:




a DB 48h, 65h, 6Ch, 6Ch, 6Fh, 00h


b DB 'Hello', 0





b is an exact copy of the a array, when compiler sees a string inside quotes it automatically converts it to set of bytes.


If you need to declare a large array you can use DUP operator.


The syntax for DUP:




number DUP ( value(s) )


number - number of duplicate to make (any constant value).


value - expression that DUP will duplicate.


Address of a Variable




There is LEA (Load Effective Address) instruction and alternative OFFSET operator. Both OFFSET and LEA can be used to get the offset address of the variable.


LEA is more powerful because it also allows you to get the address of an indexed variables. Getting the address of the variable can be very useful in some situations, for example when you need to pass parameters to a procedure.


These lines:


LEA BX, VAR1


MOV BX, OFFSET VAR1



are even compiled into the same machine code: MOV BX, num


num is a 16 bit value of the variable offset.




Please note that only these registers can be used inside square brackets (as memory pointers): BX, SI, DI, BP!


Constants




Constants are just like variables, but they exist only until your program is compiled (assembled). After definition of a constant its value cannot be changed. To define constants EQU directive is used:


name EQU < any expression >


FLAGS


As you may see there are 16 bits in this register, each bit is called a flag and can take a value of 1 or 0.


Carry Flag (CF) - this flag is set to 1 when there is an unsigned overflow. For example when you add bytes 255 + 1 (result is not in range 0...255). When there is no overflow this flag is set to 0.




Zero Flag (ZF) - set to 1 when result is zero. For none zero result this flag is set to 0.




Sign Flag (SF) - set to 1 when result is negative. When result is positive it is set to 0. Actually this flag take the value of the most significant bit.




Overflow Flag (OF) - set to 1 when there is a signed overflow. For example, when you add bytes 100 + 50 (result is not in range -128...127).




Parity Flag (PF) - this flag is set to 1 when there is even number of one bits in result, and to 0 when there is odd number of one bits. Even if result is a word only 8 low bits are analyzed!




Auxiliary Flag (AF) - set to 1 when there is an unsigned overflow for low nibble (4 bits). Interrupt enable Flag (IF) - when this flag is set to 1 CPU reacts to interrupts from external devices.




Direction Flag (DF) - this flag is used by some instructions to process data chains, when this flag is set to 0 - the processing is done forward, when this flag is set to 1 the processing is done backward.


Interrupts


Interrupts can be seen as a number of functions. These functions make the programming much easier, instead of writing a code to print a character you can simply call the interrupt and it will do everything for you.


1) Commonly used interrupts.


Interrupts are of two types


1)Hardware


2)Software




We use only software interrupts in our lab.




syntax:


INT value


Where value can be a number between 0 to 255 (or 0 to 0FFh)


To specify a sub-function AH register should be set before calling interrupt.


Interrupts we use in our lab:


INT 10h / AH = 2 - set cursor position.


input:


DH = row.


DL = column.


INT 10h / AH = 0Ah - write character only at cursor position.

input:


AL = character to display.


BH = page number.//This can be ignored.


CX = number of times to write character.


INT 21h / AH=1 - read character from standard input, with echo, result is stored in AL.


if there is no character in the keyboard buffer, the function waits until any key is pressed.


INT 21h / AH=2 - write character to standard output.


DL = character to write, after execution AL = DL.


INT 21h / AH=9 - output of a string at DS:DX. String must be terminated by '$'.


INT 21h / AH=0Ah - input of a string to DS:DX, fist byte is buffer size, second byte is number of chars actually read. this function does not add '$' in the end of string. to print using INT 21h / AH=9 you must set dollar character at the end of it and start printing from address DS:DX + 2.


INT 21h / AH=2Ch - get system time;


return: CH = hour. CL = minute. DH = second. DL = 1/100 seconds.


INT 21h / AH= 3Ch - create or truncate file.CX = file attributes:


0=normal - no attributes.


1=read-only.


2=hidden.


4=system.


7=hidden,system and read-only!


16=archive


DS:DX -> ASCII filename.




returns:




CF clear if successful, AX = file handle.


CF set on error AX = error code.




2) Common code snippets(input/output).


These instructions affect these flags only:


CF, ZF, SF, OF, PF, AF.



  • ADD - add second operand to first.


  • SUB - Subtract second operand to first.


  • CMP - Subtract second operand from first for flags only.


  • AND - Logical AND between all bits of two operands. These rules apply:


    1 AND 1 = 1


    1 AND 0 = 0


    0 AND 1 = 0


    0 AND 0 = 0




As you see we get 1 only when both bits are 1.



  • TEST - The same as AND but for flags only.


  • OR - Logical OR between all bits of two operands. These rules apply:


    1 OR 1 = 1


    1 OR 0 = 1


    0 OR 1 = 1


    0 OR 0 = 0




As you see we get 1 every time when at least one of the bits is 1.



  • XOR - Logical XOR (exclusive OR) between all bits of two operands. These rules apply:1 XOR 1 = 0



1 XOR 0 = 1


0 XOR 1 = 1


0 XOR 0 = 0


As you see we get 1 every time when bits are different from each other.


MUL and IMUL instructions affect these flags only:


CF, OF


When result is over operand size these flags are set to 1, when result fits in operand size these flags are set to 0.




For DIV and IDIV flags are undefined.



  • MUL - Unsigned multiply:

    when operand is a byte:


    AX = AL * operand.


    when operand is a word:


    (DX AX) = AX * operand.



  • IMUL - Signed multiply:

    when operand is a byte:


    AX = AL * operand.


    when operand is a word:


    (DX AX) = AX * operand.



  • DIV - Unsigned divide:

    when operand is a byte:


    AL = AX / operand


    AH = remainder (modulus).
    .


    when operand is a word:


    AX = (DX AX) / operand


    DX = remainder (modulus).
    .



  • IDIV - Signed divide:

    when operand is a byte:


    AL = AX / operand


    AH = remainder (modulus).
    .


    when operand is a word:


    AX = (DX AX) / operand


    DX = remainder (modulus).
    .




INC, DEC instructions affect these flags only:


ZF, SF, OF, PF, AF.




NOT instruction does not affect any flags!




NEG instruction affects these flags only:


CF, ZF, SF, OF, PF, AF.



  • NOT - Reverse each bit of operand.


  • NEG - Make operand negative (two's complement). Actually it reverses each bit of operand and then adds 1 to it. For example 5 will become -5, and -2 will become 2.


Jump instructions that test single flag






































































InstructionDescriptionConditionOpposite Instruction
JZ , JEJump if Zero (Equal).ZF = 1JNZ, JNE
JC , JB, JNAEJump if Carry (Below, Not Above Equal).CF = 1JNC, JNB, JAE
JSJump if Sign.SF = 1JNS
JOJump if Overflow.OF = 1JNO
JPE, JPJump if Parity Even.PF = 1JPO
JNZ , JNEJump if Not Zero (Not Equal).ZF = 0JZ, JE
JNC , JNB, JAEJump if Not Carry (Not Below, Above Equal).CF = 0JC, JB, JNAE
JNSJump if Not Sign.SF = 0JS
JNOJump if Not Overflow.OF = 0JO
JPO, JNPJump if Parity Odd (No Parity).PF = 0JPE, JP

Jump instructions for unsigned numbers













































InstructionDescriptionConditionOpposite Instruction
JE , JZJump if Equal (=).


Jump if Zero.
ZF = 1JNE, JNZ
JNE , JNZJump if Not Equal (<>).


Jump if Not Zero.
ZF = 0JE, JZ
JA , JNBEJump if Above (>).


Jump if Not Below or Equal (not <=).
CF = 0


and


ZF = 0
JNA, JBE
JB , JNAE, JCJump if Below (<).


Jump if Not Above or Equal (not >=).


Jump if Carry.
CF = 1JNB, JAE, JNC
JAE , JNB, JNCJump if Above or Equal (>=).


Jump if Not Below (not <).


Jump if Not Carry.
CF = 0JNAE, JB
JBE , JNAJump if Below or Equal (<=).


Jump if Not Above (not >).
CF = 1


or


ZF = 1
JNBE, JA

Generally, when it is required to compare numeric values CMP instruction is used (it does the same as SUB (subtract) instruction, but does not keep the result, just affects the flags).


Procedures


Procedure is a part of code that can be called from your program in order to make some specific task. Procedures make program more structural and easier to understand. Generally procedure returns to the same point from where it was called.




The syntax for procedure declaration:


name PROC




; here goes the code


; of the procedure ...




RET


name ENDP




name - is the procedure name, the same name should be in the top and the bottom, this is used to check correct closing of procedures.




Probably, you already know that RET instruction is used to return to operating system. The same instruction is used to return from procedure (actually operating system sees your program as a special procedure).




PROC and ENDP are compiler directives, so they are not assembled into any real machine code. Compiler just remembers the address of procedure.




CALL instruction is used to call a procedure.


The Stack


Stack is an area of memory for keeping temporary data. Stack is used by CALL instruction to keep return address for procedure, RET instruction gets this value from the stack and returns to that offset. Quite the same thing happens when INT instruction calls an interrupt, it stores in stack flag register, code segment and offset. IRET instruction is used to return from interrupt call.




We can also use the stack to keep any other data,


there are two instructions that work with the stack:




PUSH - stores 16 bit value in the stack.




POP - gets 16 bit value from the stack.


Macros


Macros are just like procedures, but not really. Macros look like procedures, but they exist only until your code is compiled, after compilation all macros are replaced with real instructions. If you declared a macro and never used it in your code, compiler will simply ignore it.


3) Logic of the program.


Each program accomplishes a certain task using certain tools. Know the logic of the program if you expect any marks.


How to remember and utilize the logic is illustrated below in the example.


4) How to show off your output.


Showing off your output is one other thing, Remember not all programs show output just by pressing f5.


Most of the programs if they are out putting some thing then you can switch to the commend prompt by pressing f4 and see it.


If that is not useful press f5 to see what the program does and if it works successfully then click f4 and check. still nothing, then you have one of the sorting kind of programs you need to check each array you can do this by typing db array_name or dw array_name.


If that doesn't work then you must have a variable to check (like the factorial program) just type ? var_name, db or ?var_name,dw


PROGRAM ILLUSTRATION:


4 a) Read an alpha numeric character and display its equivalent ASCII code at the center of the screen.


APPROACH:


First lets get a rough logic of what our program has to do and what tools from above we might need to do it:


1. Read an alphanumeric character.


Interrupt to read the character, Place to store the character.


2. Move to the center of the screen.


Interrupt to move cursor,


3. Calculate ASCII equivalent.


know how to calculate ASCII equvalent.


4. Display and exit.


Interrupt to put character on screen.


Now let us improvise it by filling the details:


1. Read an alphanumeric character.


Interrupt to read the character,


<!--INT 21h / AH=1-->


mov ah,01h


int 21h


Place to store the character.


By default it is stored in al


save a copy in bl


mov bl,al


2. Move to the center of the screen.


Interrupt to move cursor,


<!--


INT 10h / AH = 2 - set cursor position.


input:


DH = row.


DL = column. -->


mov dh,12


mov dl,35


mov ah,02


int 10h


3. Calculate ASCII equivalent.


know how to calculate ASCII equvalent


set counter cl=4


mov cl,04h


get the LEFT side digit


if it is less than ADD 30h


else add 07h


and move it to dl


and al,0f0h ; and al,1111 0000. and means logical multiplication


; and operation suppress the right number




shr al,cl ; cl contains 4. So shift the contents


; of al by 4 position


; shr operation moves the left number


; from higher nibble to lower


;nibble


cmp al,0ah


jl next1


add al,07h ;To Skip/suppress :,;,<,=,>,?,@


; (That is 3A,3B,3C,3D,3E,3F,40)


next1: add al,30h


mov dl,al


Print the left digit


GET THE RIGHT DIGIT and its ASCII value


mov al,bl

and al,0FH ; Remember here it is 0FH and not 0f0h.


;0FH means 00001111


cmp al,0ah


jl next2


add al,07h




next2: add al,30h


mov dl,al


mov ah,02h


int 21h


mov ah,4ch


int 21h


Display the Right digit.



4. Display and exit.


Interrupt to put character on screen.


<!--


INT 10h / AH = 0Ah - write character only at cursor position.

input:


AL = character to display.


BH = page number.//This can be ignored.


CX = number of times to write character. -->


And that's pretty much it You all have the programs if not all the software working programs are available for download from here.


Let me know if there are any doubts, a few thing may vary as my sources include The text as well as Wikipedia and lots of other froggled and soopeled custom search query result.



Powered by Zoundry Raven



Technorati : ,

Del.icio.us : ,

Zooomr : ,

Flickr : ,

SePeRATION code

First it was DReSS code now it's the new SePeRATION code, and i'm not talking about just an other college here but with the BJP govt. here in Karnataka many things seem to have taken the so called MORAL PATH.

The new Seperation code being implemented across all major Pre University and Engineering colleges is "...aimed at steering students in the RIGHT path, as boys and girls "mingling" together is not our culture..." Reports Bangalore Mirror .

Just what the hell is wrong with these opressive political psychos, a level headed bloke may never know. First it was Mangalore Pub now its the campuses, This seems to be the newest form of terrorism "Moral Policing".

But things are not really that worse here considering that my own college has no restrictions of the sort(atleast not Active Rules) and also the negligence shown by most Engineering colleges to these CODES. Even thought VTU has banned the useage of mobile phones on campus it's a common for a lecturer to come in class and ask us to put it in silent mode. And even if the lecturer is specific about Boys and Girls not sitting together, they are only as far as the digital divide.

This move by the colleges is sure going to benefit the Multiplexes, Malls,Cafes and Discotheques, Who are always ready to bend the 18 and above rule.

Powered by Zoundry Raven


Technorati : , , , , ,

Del.icio.us : , , , , ,

Zooomr : , , , , ,

Flickr : , , , , ,