0% found this document useful (0 votes)
26 views4 pages

22BCE10014 Prachi Tavse MPMC Class Tutorial

The document outlines various assembly language and C language commands categorized into different types such as data movement, arithmetic, logical, control transfer, and string instructions for assembly, as well as input/output commands, data type declarations, control flow statements, looping constructs, function definitions, memory management, and preprocessor directives for C. Each category lists specific commands along with their brief descriptions. This serves as a comprehensive reference for programming in assembly and C languages.

Uploaded by

aadijain2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views4 pages

22BCE10014 Prachi Tavse MPMC Class Tutorial

The document outlines various assembly language and C language commands categorized into different types such as data movement, arithmetic, logical, control transfer, and string instructions for assembly, as well as input/output commands, data type declarations, control flow statements, looping constructs, function definitions, memory management, and preprocessor directives for C. Each category lists specific commands along with their brief descriptions. This serves as a comprehensive reference for programming in assembly and C languages.

Uploaded by

aadijain2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Prachi Tavse

22BCE10014

Class Tutorial
Assembly Language Commands-
1. Data Movement Instructions

These are used to transfer data between registers, memory, and I/O.

1. MOV - Move data from source to destination.


2. PUSH - Push data onto the stack.
3. POP - Pop data from the stack.
4. LEA - Load effective address of a variable into a register.
5. XCHG - Exchange data between two registers or memory locations.
6. IN - Input data from a port.
7. OUT - Output data to a port.
8. LDS - Load pointer using segment descriptor.
9. LES - Load pointer using extra segment descriptor.
10. MOVSX - Move with sign extension.

2. Arithmetic Instructions

Perform arithmetic operations on data.


11. ADD - Add two values.
12. SUB - Subtract two values.
13. MUL - Multiply two unsigned integers.
14. IMUL - Multiply two signed integers.
15. DIV - Divide unsigned integers.
16. IDIV - Divide signed integers.
17. INC - Increment by one.
18. DEC - Decrement by one.
19. ADC - Add with carry.
20. SBB - Subtract with borrow.

3. Logical Instructions

Perform logical operations on data.


21. AND - Perform logical AND operation.
22. OR - Perform logical OR operation.
23. XOR - Perform logical XOR operation.
24. NOT - Perform logical NOT operation.
25. TEST - Perform AND operation without storing the result.
4. Bit Manipulation Instructions

Operate on individual bits.


26. SHL - Shift bits left (logical).
27. SHR - Shift bits right (logical).
28. SAR - Shift bits right (arithmetic).
29. ROL - Rotate bits left.
30. ROR - Rotate bits right.

5. Control Transfer Instructions

Control the flow of program execution.


31. JMP - Jump to a specified address.
32. CALL - Call a procedure.
33. RET - Return from a procedure.
34. JE/JZ - Jump if equal/zero.
35. JNE/JNZ - Jump if not equal/non-zero.
36. JG/JNLE - Jump if greater.
37. JL/JNGE - Jump if less.
38. JGE/JNL - Jump if greater or equal.
39. JLE/JNG - Jump if less or equal.
40. LOOP - Decrement CX register and jump if CX ≠ 0.

6. String Instructions

Operate on strings.
41. MOVS - Move string data.
42. CMPS - Compare string data.
43. SCAS - Scan string for a value.
44. LODS - Load string data into the accumulator.
45. STOS - Store accumulator data into string.

7. Flag Manipulation Instructions

Modify or check the flag register.


46. CLC - Clear carry flag.
47. STC - Set carry flag.
48. CMC - Complement carry flag.
49. CLI - Clear interrupt flag.
50. STI - Set interrupt flag.
C Language Commands-
1. Input/Output Commands

Used for reading and writing data.

1. printf - Print formatted output to the standard output.


2. scanf - Read formatted input from the standard input.
3. getchar - Read a single character from the standard input.
4. putchar - Write a single character to the standard output.
5. gets - Read a string from standard input (deprecated, use fgets instead).
6. puts - Write a string to the standard output.
7. fopen - Open a file.
8. fclose - Close an open file.

2. Data Type and Variable Declaration

Define and declare variables or constants.


9. int - Declare an integer variable.
10. float - Declare a floating-point variable.
11. char - Declare a character variable.
12. double - Declare a double-precision floating-point variable.
13. const - Define a constant variable.
14. #define - Define a macro.

3. Control Flow Statements

Control the flow of execution in a program.


15. if - Execute a block of code if the condition is true.
16. else - Execute a block of code if the condition in if is false.
17. else if - Chain multiple conditions.
18. switch - Select a block of code to execute based on a value.
19. case - A branch in a switch statement.
20. break - Exit a loop or switch statement.
21. continue - Skip the current iteration of a loop.
22. default - Specify the default block in a switch statement.

4. Looping Constructs

Execute blocks of code repeatedly.


23. for - Loop with initialization, condition, and increment/decrement.
24. while - Loop while a condition is true.
25. do...while - Loop at least once and then while a condition is true.
26. goto - Jump to a specific label in the program.
27. return - Exit from a function and return a value.
28. exit - Exit the program entirely.

5. Function Definition and Prototypes

Used for modular programming.


29. void - Declare a function that does not return a value.
30. main - Define the entry point of a C program.
31. return - Specify the value to return from a function.
32. typedef - Define a new name for a data type.

6. Memory Management

Manage dynamic memory.


33. malloc - Allocate memory dynamically.
34. calloc - Allocate and initialize memory dynamically.
35. realloc - Resize previously allocated memory.
36. free - Free allocated memory.

7. Preprocessor Directives

Commands processed before compilation.


37. #include - Include a header file.
38. #define - Define a macro.
39. #ifdef - Check if a macro is defined.
40. #endif - End conditional preprocessor directive.

You might also like