8085 Interview Questions
Q : To multiply a number by 8 in 8085 we have to use RAL instruction
- When RAL instruction is used once the number is doubled.
Q : IC (instruction cycle), FC (fetch cycle) and EC (executive cycle) are related as
A. IC = FC – EC
B. IC = FC + EC @
C. IC = FC + 2EC
D. EC = IC + EC
- Answer: Option B (Explanation: Instruction cycle consists of fetch and execute cycles).
Q: 8085 has 6 how many sign flags ?
- It has one sign flag S.
C Interview Questions
- Storage Classes
- Structure & Union Difference
- Which Library needs to add the bool variable? Answered include “stdbool.h”
- Question: Difference between debug and release mode in compiler?
- Debug mode – Optimization should not be done.
- Release mode – Optimization should be enabled.
What will be printed as the result of the operation below?
#include <stdio.h>
int main()
{
char temp = -127;
printf("\n char -256 : %d",temp);
/*
printf("\n 8051 char size : %d",sizeof(char));
printf("\n 8051 unchar size : %d",sizeof(unsigned char));
printf("\n 8051 int size : %d",sizeof(int));
printf("\n 8051 unsigned int size : %d",sizeof(unsigned int));
// printf("\n 8051 float size : %d",sizeof(float));
// printf("\n 8051 unsigned float size : %d",sizeof(unsigned float));
// printf("\n 8051 double size : %d",sizeof(double));
// printf("\n 8051 unsigned double size : %d",sizeof(unsigned double));
*/ return 0;
}
Output
8051 char size : 1 8051 unchar size : 1 8051 int size : 2 8051 unsigned int size : 2
Digital Electronics Interview Questions
What is Latch?
The latch is an electronic logic circuit, it has two inputs(Set and Rest) and one output. In the micro controller Latch is a temporary memory unit. it can control signals while the data transmission.
Differnet beween Flip flop and Latch?
- The basic difference between a latch and a flip-flop is a gating or clocking mechanism.
- In Simple words. Flip Flop is edge-triggered and a latch is level triggered.
Embedded Interview Questions
Four Button are need to connect with single GPIO
- Resistor Ladder (Voltage Divider) Method
What is open drain concept.
Open-drain (or open-collector in bipolar transistors) is a hardware output design where a device can only pull the line to ground (0) but cannot drive it high (1) directly.
Instead, when it’s not pulling low, the pin is left floating (high impedance), and an external pull-up resistor (or internal pull-up in MCU) brings the line high.
1. How to Fix a Bug?
Fixing a bug in C (or any programming language) generally follows these steps:
- Identify the Problem
- Reproduce the bug consistently.
- Understand exactly when and how it occurs.
- Check the Error Message or Symptoms
- If there’s a compiler error, read it carefully to know which line or file has the issue.
- If it’s a runtime bug (wrong output, crash), use print statements or a debugger to trace variable values.
- Analyze the Code Logic
- Verify your algorithm, loops, conditionals, and pointer usage.
- Look for common issues: uninitialized variables, wrong conditions, memory leaks, buffer overflows.
- Use Debugging Tools
- GDB (GNU Debugger) on Linux.
- Visual Studio Debugger or Code::Blocks debugger on Windows.
- Apply the Fix & Test Again
- Change only what’s necessary.
- Re-run and ensure the bug is gone without introducing new issues.
2. What is SDCL?
SDCL can refer to different things depending on context, but in C development environments it usually means:
- Source Definition Command Language – a scripting or command language used in older build systems for software compilation.
- In modern software engineering, SDLC (Software Development Life Cycle) is more common, meaning the complete process from requirements to maintenance.
- If you meant SDLC: it’s a framework describing stages like planning, analysis, design, coding, testing, and deployment.
You’ll want to confirm which your context refers to — SDCL is rare today.
3. How to View the C Compiling Process?
When you compile a C program, it goes through four main stages:
- Preprocessing (
.c→ preprocessed.ifile)- Handles
#include,#define, and macros. - Command example:
gcc -E program.c -o program.i
- Handles
- Compilation (
.i→.sassembly code)- Converts preprocessed code to assembly language.
- Command example:
gcc -S program.i -o program.s
- Assembly (
.s→.oobject code)- Converts assembly to machine code.
- Command example:
gcc -c program.s -o program.o
- Linking (
.o+ libraries → executable)- Combines object files and libraries into the final
.exeor binary. - Done automatically if you run:
gcc program.c -o program.exe
- Combines object files and libraries into the final
4. How Can I Run a C Program in Windows?
Option 1: Using GCC (MinGW or TDM-GCC)
- Install MinGW from MinGW website.
- Add
binfolder to your Windows PATH. - Open Command Prompt and type:
gcc program.c -o program.exe program.exe
Option 2: Using Code::Blocks or Dev-C++
- Download and install Code::Blocks (includes GCC).
- Create a new C project, write your code, press F9 to compile and run.
Option 3: Using Visual Studio
- Install Visual Studio Community edition.
- Create a C project and press Ctrl + F5 to run.
5. How to Compile a C Program in Windows?
From Command Prompt with GCC:
gcc mycode.c -o mycode.exe
Then run:
mycode.exe
From Visual Studio Developer Command Prompt:
cl mycode.c
(Here cl is Microsoft’s C compiler.)
RTOS
Question: What is the service you have used in RTOS?
Answer:
- Thread creation (task Creation)
- Mutex
- Semaphore
Question: How would you assign priority to task in RTOS?
Question: Write the parameters of semaphore API in RTOS?
Question: Write a program for print odd and even numbers, one threat need to print even number and another thread print odd Numbers. (or) Print Even and Odd Numbers Using 2 Threads
Question :
1.Check null char present are not. if null present then exit
2. Count the space in given string and if second space then log the string into another array. then print that array.
What will get printed when this code is executed?
int* foo(int p){
int result;
result = p+10;
return(&result);
}
void main()
{
int *value; value = foo(20);
printf("value = %d",*value);
}
What value gets printed here when the code is executed?
ptr points to address 0x4000
int16 value = 0x1234;
void main (void){
Int16 *ptr = &value;
ptr++;
printf("value = %d",(int)ptr);
}
Write a function for a 0x0000 to be updated to 0x0x02 location
C function that updates the value stored at memory address 0x0002 (or offset 0x0002) to 0x0000.
Here’s a basic example:
#include <stdint.h>
void update_location(void) {
// Point to the memory location 0x0002
uint16_t *ptr = (uint16_t *)0x0002;
// Update the value at that location to 0x0000
*ptr = 0x0000;
}
int main() {
update_location();
return 0;
}
Important Notes:
- Directly accessing fixed addresses only works if you’re on a platform (like embedded systems / microcontrollers) where that memory is valid and mapped.
- On a normal PC program, doing this will likely cause a segmentation fault because address
0x0002is not valid for user-space programs. - If you meant offset inside an array or EEPROM/Flash register, the implementation would differ.