Skip to content

Instantly share code, notes, and snippets.

View berk76's full-sized avatar
🌱
I grow my projects on Codeberg

berk76

🌱
I grow my projects on Codeberg
View GitHub Profile
@berk76
berk76 / com_exe.md
Last active November 22, 2024 11:00
DOS: com vs exe

COM vs. EXE Program

EXE program can have any size whereas COM program can have maximally 64kB (just one segment).

COM Program

At the beginning of program there is program segment prefix (PSP). Because COM program is stored only in one segment so PSP occupies first 256 bytes (100h). Therefore start point begins at 100h. Values of segment registers are set to the begin of segment and don’t change during executing.

COM program in memory:

@berk76
berk76 / terminal_resize.md
Last active February 16, 2021 10:00
UNIX: Detecting terminal window resize

Detecting terminal window resize in UNIX

How to get current size of terminal window and how to detect changes.

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include