Skip to content

Instantly share code, notes, and snippets.

View m4salah's full-sized avatar
❄️
Focusing

Mohamed A. Salah m4salah

❄️
Focusing
View GitHub Profile
@m4salah
m4salah / cat.s
Last active June 21, 2025 15:36
This is simple "cat" in assembly it's cli for displaying the content of a file
# PURPOSE: This program displays the contents of an input file
# to the standard error
#
# Processing:
# 1) Open the input file
# 2) While we're not at the end of the input file
## a) read part of file into our memory buffer
## b) write the memory buffer to the standard error
#
# To run: From the command line
@m4salah
m4salah / hello_world.asm
Created February 15, 2025 23:34
hello_world.asm
; nasm -felf64 hello_world.asm && ld hello_world.o -o hello_world && ./hello_world
; this from https://github.com/hackclub/some-assembly-required/tree/main/code/x86-intel
; I added some comment to indicate my understanding.
global _start
section .text
_start:
; all of this just to tell the operating system to write to the stdout.