Understanding ARM Registers

ARM Registers

In any ARM processor, total 16 registers are accessible in any operation Mode. Those registers are as shown in following image, 13 general-purpose registers R0-R12 1 Stack Pointer (SP) 1 Link Register (LR) 1 Program Counter (PC) 1 Application Program Status Register (APSR)’ The meaning and purpose of this ARM registers is as below, R0 to R12 – The initial 13 registers are … Read more

C program in Linux to find the current working directory (PWD)

getcwd, getwd, get_current_dir_name functions return a null-terminated string containing an absolute pathname that is the current working directory of the calling process. The pathname is returned as the function result and via the argument buf, if present.

C program to convert integer number to string

Following program converts integer number 42 to string “42” using sprintf. sprintf() writes to the character string. We can compile this program is using gcc as, We can compile run program on command line as,

How to write Comments in C Program ?

In C program, comments doesn’t have any use other than for better understanding of the developers of the source code in case you are writing big program and wants to remember what is the functionalities of the code blocks (functions/lines) in program. Single Line Comment — Any text on a single line after // is … Read more

Sending ARP request and receiving ARP Reply using C code

This post is in continuation of our previous post “Understanding ARP (Address Resolution Protocol) basics“ To visualise what ARP reply we are getting from arping command, we need to write an ARP reply receiver code as below, compile this code as, So, as we can see “arping” sent above ARP reply to broadcast destination mac … Read more

Bitbake / Yocto recipes for cross compiling golang program

For compiling simple golang helloworld program as part of yocto build framework, we need to download meta-golang from https://github.com/madisongh/meta-golang and use this meta layer along with poky to build our written bitbake recipes for cross compilation of golang program. PLEASE NOTE: Starting with OE-Core ‘rocko’ (Yocto Project 2.4), Go support is available directly in OE-Core, … Read more

C program to know storage size of int, char and float

To get the exact size of a type or a variable on a particular platform, you can use the sizeof operator. The expressions sizeof(type) yields the storage size of the object or type in bytes. Following is an example to get the size of int type on any machine.

Subscribe for New Post Updates

Join 211 other subscribers