This repository contains examples and exercises related to computer organization and low-level programming. It includes examples written in C and x86 Assembly language, demonstrating concepts such as endianness and system calls.
BigLittleendian.c
- A C program to determine the endianness of the system.first.asm
- An x86 assembly program to print a string using DOS interrupts.
This C program checks whether the system is using big-endian or little-endian byte order. The program uses a union to store a short integer and a character array, then examines the byte order in memory.
To compile and run the BigLittleendian.c
program:
gcc BigLittleendian.c -o BigLittleendian
./BigLittleendian
This x86 assembly program prints a string to the console using DOS interrupts. It demonstrates the use of the DOS interrupt 21h to print a string and terminate the program.
Assembly and Execution
- To assemble and run the print_string.asm program, you need an assembler like MASM or TASM, and an environment to run DOS programs like DOSBox.
masm first.asm;
- Link the object file:
link first.obj;
- Run the executable in DOSBox or a similar DOS environment:
first.exe
This repository is licensed under the MIT License. See the LICENSE file for more information.
Aitya Singh