Monday, March 29, 2010

Pointer (Coding skills & technique)


Interlude:

Or pointes, these could be one of the challenging scheme a programmers must be adept or skillful to . Almost data declarations in a compiler epscially to an objected oriented programming languages ,a pointer is a bit extra technique which is interesting to be learned.Basically, one reason is the minimizations of coding and the eficacy of applying it in a given program.

Here , we coud have a look of some methods how we would be able to learn adopting and simpliying the use of a pointer to debug a source code.My experienced way back then in dealing with this "pointer" seriously was the challenged that convinced me in porting a TCP/IP Stack code from one c compiler to another(AVR glib libraries to CCS libraries and hopefully to SDCC).

Another are the encouragement that I need to convinced these kind of tricks by myself; 1)I am able to run PIC16F877a as an ethernet server and include details of applications to it, 2) published the documents if nescessary for free.So I decided to recode first the Microchip TCP/IP Stack -a sort of: enc28j60(h,c) , mac(h,c) then the stacktask(h,c) before I can make any algorithm or programming flow of my own style.

Here is that thing I was thingking then-a simple ping reply
main()
{
initialise :
MCU
ENC28j60
tweaking the TX/RX between the two interface
detect for a raw packet then send back to it.
}

Even with a copied uChip TCP/IP Stack it couldn't been easy as what had been thought than done -especillay when porting the code.So,need to consider really the functions of buffer,register and bank selector in enc28j60 as to how I could minimized the program to fit exactly from 32Kb to an 8K!(RAM) flash memory of PIC16F877a. In order to make it more definitive, it is the pointer issues that burned my eybrows -just on porting code of the program.And now, let us discussed a learning schemes how pointer/s are adopted using its advantages in coding a program instead.

Let's take a scrutinizations to these:
Pointers and Constants:
Given the following:
char buffer[100];
char name[20];

//pointer to const char
const char *p = buffer;
p = name; // ok
*p = ’x’; // error!

//const pointer to char
char * const p = buffer
*p = ’x’; // ok
p = name; // error!
const char space = ’ ’;
const char *p = &space; // ok
char *q = &space; // error!

Tuesday, March 16, 2010

GAMBAS (Opensource Visual Basic)



Introductions:

Visual Basic is one of the most dominant programming languages throughout the decades and the favorite to all professional devoted programmers. VB6 which was considered as a third-generation event-driven programming language derived from BASIC. Lately, it was revealed that majority of the database program deployed all over the world was developed by using visual basic.Visual Basic got its throne because it had influences so many BASIC programming languages (compiler/interpreter).There are more features that VB platforms offers :uGUI,DBase ,OSX ,DLL ,Web scripting and add ons killer applications.

If we are going to review its predecessor we will find out that its origin is basic for dos to its latest versions until then enhanced to VB for dos (GUI running in Dos). Then later that development came the VB 5-6 (final version was until 1998) up to the designated successor -VB.net.

No wonder ,Gambas was inspired by VB programming ingenuity and intended to provide a similar experience for developing BASIC programs to Visual Basic. Gambas is intended to be an alternative for former Visual Basic developers who have decided to migrate to Linux or Unix like OS.

So Kudos! to VB and its migration in Linux-Gambas.

Objectives:
To be familiar with Gambas
To adapt Gambas with previous VB6 knowledge back ground
To create a simple sample program in Gambas
To use Gambas in MCU embedded support programs.

Methodology:


Detail(1) : sudo apt-get install













Remarks:


Conclusions:


Monday, March 15, 2010

The Big Four(Assembler,Basic,Pascal and C/C++)


It was my first year in highschool when we had an informal orientation of learning a basic computer concepts it was then that I experienced operating a computer - an 8086 AT IBM computer(atlast ! the real keyboard not a dashboard drawing).Fresh from my memory as I was able to remember those weird techy things, I took my first programming lesson way back our third year in highschool. Well, we're a little bit fortunate because our school was supervised by an Italian priesthood(Sumascan order ) and the technology that they had were unselfishly shared to us.

We we're taught a couple of languages: one was GWBASIC and another one was the Pascal 3.0 (I wish I had that right version).I found an easiness of GWBASIC's usage -why? oh,perhaps from the word itself it is "basic" .Alas! We had then the first unforgetable "Hello World" and several program statement;" Enter 1st Number" plus "Enter the 2nd Number" and " The Sum is:" there all begun our world of programming from cut and paste to syntax modifications.

So after our high-school graduations, and serious life was soon eminent to be faced of; I took computer engineering course becuase I really miss computering.During my college, burning eyebrows there was only one rule I insidted my self to stick learning into-"Explore the BIG 4". I am pertaining to the most important computer languages I should have to study (burning eyebrows as I've said) very well: Assembler,Pascal,Basic and C.

Assembly language made me appreciate computer architecture ,Pascal hits me to the extremities of graphical User interface as Super Mario then was so popular computer games-and to inform you it was developed in Pascal. But as oppurtune knocked the door for computer programmer s I'ved realized then that there were changes in maket demand of software programming ;VB6 and a VC++ for application programer and a C origin JAVA++ for a WEB programmer . VB6 dominate much on Database programming wich included killer apps : interface to ADO,MSQL,MSACCES and etc.VC++ and it continous revision with its excellent platforms such device drivers,libraries and addons beside C/C++ entices the majority of the use of computing research to almost University/Insitutions ( a middle level class of programming).

In my own analogy that is business and MicroSoft had supported these two programming languages and included to its package accesories-Visual Sutdio. It was not so surprising becuase MS Windows was built in C and so was its rival OS Linux.Though of such cases Pascal now caveat is Delphi and Assembly never joined the competitions except it play as a useful programming tool to hardware embedded programming. Sometimes Assembler is being used as an inline interface to its 3 contemporaries compiler or interpreter-BASIC,PASCAL and C/C++.

So , what I learn through it was that somehow this " Big 4" really influenced our digital world -nonetheles the syntax the logic and functions.







Real Basic( Porting VB in Linux)