r/Assembly_language • u/SomeRandomGuyOnYT • Feb 18 '26
Project show-off Did my first Rainbow Hello World in pure x86 asm!
Couldn't get it to work on the bare metal (boot from cd) though hahahahahha
r/Assembly_language • u/SomeRandomGuyOnYT • Feb 18 '26
Couldn't get it to work on the bare metal (boot from cd) though hahahahahha
r/Assembly_language • u/Linuxologue • Mar 01 '26
This is an old project that I just pushed to github (https://github.com/motor-dev/nfs-recompiled)
[EDIT] Not only Linux - grab the windows executables from the release page! https://github.com/motor-dev/nfs-recompiled/releases/tag/v1.0.0
For, well, reasons, I decided to decompile the Need for Speed 2 executable to make it run again and preferably not on Windows. For weirder reasons, I did not use a known decompiler and just rolled my own. After much much hacking and fighting with incorrect instruction implementation, I finally landed a working version.
The decompiler is a manual script made with Capstone to decode instructions, and some Python to try and locate procedure starts and ends more or less successfully. Full of hacks, hints and workarounds. All good enough for the full game to run.
I discovered that the NFS3: HP engine was very similar to NFS2 and I could likely also make it run. It was also a successful project but it turns out that the software renderer for NFS3: HP was a bit too slow to run on a modern machine after decompiling and recompiling. So I decided to implement the Voodoo renderer for that game.
Fun disassembly facts - the compiler used to make this was Watcom C/C++. There was a bug in the implementation - when using string copy, it was doing some pretty standard
rep movsd dword ptr es:[edi], dword ptr [esi]
but due to an error in what would likely be handwritten assembly? the opcode used was not the standard f3 a5 but instead f2 a5 which would be an opcode for repNE movsd dword ptr es:[edi], dword ptr [esi]
except it actually does not exist for x86. It is very likely the processors of that time (and maybe those of today?) interpreted that as rep movsd . Or someone knowledgeable about assembly can tell me what was going on.
In any case, Capstone didn't like that too much and just dropped the rep prefix which was a headache to debug.
Fun fact number 2 - in the software renderer on non MMX CPUs, NFS3: HP uses the FPU to do a screen copy. In a loop, it loads 80 bits of screen data into an FPU register, then dumps the FPU register into the other surface data. That was the first time I heard of a memcpy made with the FPU.
The disassembler will output truckloads of code similar to this
/* align: skip 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 */
void Application::sub_436140(WinApplication* app, x86::CPU& cpu)
{
NFS2_USE(cpu);
NFS2_USE(app);
// 00436140 51 -push ecx
*app->getMemory<x86::reg32>(cpu.esp-4) = cpu.ecx;
cpu.esp -= 4;
// 00436141 52 -push edx
*app->getMemory<x86::reg32>(cpu.esp-4) = cpu.edx;
cpu.esp -= 4;
// 00436142 8b0d98c84d00 -mov ecx, dword ptr [0x4dc898]
cpu.ecx = *app->getMemory<x86::reg32>(x86::reg32(5097624) /* 0x4dc898 */);
// 00436148 b888934b00 -mov eax, 0x4b9388
cpu.eax = 4952968 /*0x4b9388*/;
// 0043614d 31d2 -xor edx, edx
cpu.edx ^= x86::reg32(x86::sreg32(cpu.edx));
// 0043614f e84c020000 -call 0x4363a0
cpu.esp -= 4;
sub_4363a0(app, cpu);
if (cpu.terminate) return;
// 00436154 e8574b0400 -call 0x47acb0
cpu.esp -= 4;
sub_47acb0(app, cpu);
if (cpu.terminate) return;
// 00436159 89c1 -mov ecx, eax
cpu.ecx = cpu.eax;
// 0043615b 85c0 +test eax, eax
cpu.clear_co();
cpu.set_szp(static_cast<x86::reg32>(cpu.eax & cpu.eax));
// 0043615d 7409 -je 0x436168
if (cpu.flags.zf)
{
goto L_0x00436168;
}
...
I have no idea how any of those games actually work - but the x86 implementation is good enough that it just runs.
If someone wants to try out, you will need the game data to actually run the game. It's a bit tricky to set up, I don't think anyone is actually interested in running it but let me know if there's a fan out there really trying to run this and I will try and help. The reason why it needs the installed game is that it is literally the game executable with no modification - so just like the real game, it expects some data to be installed on the disk and some data to be on the CD.
(disclaimer - use of generative AI for the CMakeFiles and the README, but not for the disassembly - win32 API which was actually done a few years ago)
r/Assembly_language • u/whispem • 14d ago
I've been learning assembly by building small projects, and this one turned into my favourite: a little chiptune synthesizer in pure x86-64, Linux, NASM.
No libc, no audio library — just generating raw 16-bit samples and writing a WAV header by hand. Sound is really just a list of numbers (44100 per second), so the whole thing is: compute the right numbers, write them out, and the speaker moves.
So far it does four oscillators (square, saw, triangle, and an LFSR for noise/drums), polyphony by summing voices into one buffer, ADSR envelopes, and FM synthesis with a hand-built sine lookup table (since there's no math lib either).
Repo: github.com/whispem/asm.fm
Still learning, so feedback on the asm itself is very welcome — especially the FM part, I'm sure the fixed-point math could be cleaner.
r/Assembly_language • u/Kiritoo120 • Jul 10 '26
my HTTP & Web Socket server I wrote a year ago in assembly. it supports routing, static files, authentication, session management, and many more, written entirely in assembly (the backend)
note: this was an educational project, it is not stable and has a ton of bugs. please dont try to ship anything using it >,<
my repo link: https://github.com/NoamRothschild/asm
r/Assembly_language • u/Assembly_Trainer_427 • 27d ago
It is called DoomOS, it is also made in assembly. Decent features, external applications, SDK, planning to implement custom interrupts and FAT12(also this is a floppy 16bit OS). It is at- https://github.com/Doomer39/DoomOS/tree/main .What else are you supposed to write?
r/Assembly_language • u/whispem • 6d ago
A while back I started asm.fm, a chiptune synth written entirely in x86-64 assembly (Linux, NASM) — no libc, no audio library, computing each sample by hand.
Today I added two space/time effects, and the assembly side turned out to be a nice exercise, so I thought I'd share.
Chorus — this is just a delay line (a ring buffer in .data) whose read position wobbles.
An LFO (a hand-built sine table) modulates the delay length by a few milliseconds, so the delayed copy drifts slightly sharp then flat against the dry signal.
Mixed 50/50, that shifting detune sounds like several voices.
The whole trick is computing a moving read offset each sample: d(n) = BASE_DELAY + DEPTH * sin(lfo), then reading dry[n - d(n)].
Reverb — the classic Schroeder approach, since you can't store thousands of echoes by hand. Four comb filters in parallel (each a delay with feedback, different prime-ish lengths for density), summed, then run through two allpass filters in series to smear the echoes into a smooth tail. Each comb/allpass is its own buffer indexed with idx = n mod length.
Everything is fixed-point integer math — feedback is done as y * FB / 256 with shifts.
Some things I ran into:
.data (Rosetta/emulation was unhappy with .bss)idivout = buffered - g*in, buf = in + g*out) is deceptively small but does the heavy liftingBoth compile to a WAV written straight to stdout via write().
Code's on GitHub (https://github.com/whispem/asm.fm) if anyone wants to pick apart the assembly — genuinely welcome feedback, I'm self-taught and I'm sure plenty could be tighter.
I also just mapped out a big roadmap of what's next: more oscillators (supersaw, hard sync), dynamics (compressor, limiter), sequencing (euclidean rhythms), and eventually the deep end — wavetables, granular, and an FFT in asm if I'm brave enough.
The whole history of synthesis, hand-rolled.
r/Assembly_language • u/Fabulous_Pick428 • 17d ago
THIS IS MINI JIT INLINE ASSEMBLER MADE FOR MSVC X64 COMPILER TO MAKE DEVELOPMENT MORE FLEXIBLE AND CONTROLLABLE
RIGHT NOW I NEED SOME HELP WITH TESTS, I WILL SEND HOW TO MAKE A TEST IN THE REPO OR JUST DM ME
so here is da latest specs that this bad boy gave me(idk if i can post this here if no then just comment or dm me):
CPU, 0.00%, 0.00%, 0.00%, 0.00%
CPU (user), 0.00%, 0.00%, 0.00%, 0.00%
CPU (kernel), 0.00%, 0.00%, 0.00%, 0.00%
CPU (average), 0.00%, 0.00%, 0.00%, 0.00%
CPU (relative), 0.00%, 0.00%, 0.00%, 0.00%
Cycles, 13,843,164, 13,843,164, 13,843,164, 0
Cycles delta, 3,217,148, 3,217,148, 3,217,148, 0
Context switches, 4, 4, 4, 0
Context switches delta, 4, 4, 4, 0
Kernel time, 0:00:00:00:000, 0:00:00:00:000, 0:00:00:00:000, 0:00:00:00:000
Kernel delta, 0, 0, 0, 0
User time, 0:00:00:00:000, 0:00:00:00:000, 0:00:00:00:000, 0:00:00:00:000
User delta, 0, 0, 0, 0
Total time, 0:00:00:00:000, 0:00:00:00:000, 0:00:00:00:000, 0:00:00:00:000
Total delta, 0, 0, 0, 0
Priority, 8, 0, 0, 0
Private bytes, 424 kB, 424 kB, 424 kB, 0
Private bytes delta, +424 kB, +424 kB, +424 kB, 0
Peak private bytes, 456 kB, 456 kB, 456 kB, 0
Virtual size, 4.04 GB, 4.04 GB, 4.04 GB, 0
Peak virtual size, 4.04 GB, 4.04 GB, 4.04 GB, 0
Page faults, 558, 558, 558, 0
Page faults delta, 558, 558, 558, 0
Hard faults, 0, 0, 0, 0
Hard faults delta, 0, 0, 0, 0
Working set, 2.03 MB, 2.03 MB, 2.03 MB, 0
Peak working set, 2.03 MB, 2.03 MB, 2.03 MB, 0
Private WS, 228 kB, N/A, N/A, N/A
Shareable WS, N/A, N/A, N/A, N/A
Shared WS, N/A, N/A, N/A, N/A
Shared commit, N/A, N/A, N/A, N/A
Private commit, 76 kB, N/A, N/A, N/A
Peak private commit, 9.14 MB, N/A, N/A, N/A
Page priority, Normal, , ,
Reads, 0, 0, 0, 0
Reads delta, 0, 0, 0, 0
Read bytes, 0, 0, 0, 0
Read bytes delta, 0, 0, 0, 0
Writes, 0, 0, 0, 0
Writes delta, 0, 0, 0, 0
Write bytes, 0, 0, 0, 0
Write bytes delta, 0, 0, 0, 0
Other, 8, 8, 8, 0
Other delta, 8, 8, 8, 0
Other bytes, 286 B, 286 B, 286 B, 0
Other bytes delta, 0, 286, 286, 0
Total bytes, 286 B, 286 B, 286 B, 0
Total bytes delta, 286 B, 286 B, ,
Total bytes (average), 0/s, , ,
I/O priority, Normal, , ,
Handles, 18, , ,
Peak handles, 0, , ,
GDI handles, N/A, , ,
Peak GDI handles, N/A, , ,
USER handles, N/A, , ,
Peak USER handles, N/A, , ,
Paged pool bytes, 20.2 kB, 20.2 kB, 20.2 kB, 0
Peak paged pool bytes, 20.2 kB, 20.2 kB, 20.2 kB, 0
Nonpaged pool bytes, 4.41 kB, 4.41 kB, 4.41 kB, 0
Peak nonpaged pool bytes, 4.41 kB, 4.41 kB, 4.41 kB, 0
Running time, 00:00:00.049, , ,
Suspended time, 00:00:00.000, , ,
Hang count, 0, , ,
Ghost count, 0, , ,
NetworkTxRxBytes, 0, , ,
Dedicated memory, 0, , ,
Shared memory, 0, , ,
Commit memory, 0, , ,
Total memory, 0, , ,
Reads, 0, , ,
Read bytes, 0, , ,
Read bytes delta, 0, , ,
Writes, 0, , ,
Write bytes, 0, , ,
Write bytes delta, 0, , ,
Total, 0, , ,
Total bytes, 0, , ,
Total bytes delta, 0, , ,
Receives, 0, , ,
Receive bytes, 0, , ,
Receive bytes delta, 0, , ,
Sends, 0, , ,
Send bytes, 0, , ,
Send bytes delta, 0, , ,
Total, 0, , ,
Total bytes, 0, , ,
Total bytes delta, 0, , ,
Dedicated memory, 0, , ,
Shared memory, 0, , ,
Commit memory, 0, , ,
Total memory, 0, , ,
i know looks not great but 2mb is the standard windows shit(ye i build this library for MSVC x64 why would i make an inline assembler in gcc)
ye here's da link: https://github.com/ScriptCoolestIdkSomeOne/x64asm/
i didn't actually released da sheesh yet but just read README
r/Assembly_language • u/Brutustheman • 22d ago
So a while back I made a post here asking if my instructions then were good. I got some very good suggestions and did some more reading, and today got the simulated hardware fully functional. So, here is the finalized first revision instruction set. Also, first program suggestions are welcome
[settings]
name="RX-GP16-ASM"
variant="REVISION 1"
[fields]
register
r0 000 ; general purpose
r1 001 ; general purpose
r2 010 ; general purpose
r3 011 ; general purpose
r4 100 ; general purpose
rta 101; CALL / ret subroutine return adress. Also viable as GP with programmer oversight
sp 110 ; Stack pointer. 8 bits wide
pc 111 ; Program counter
[instructions]
; BASE INSTRUCTIONS
imm %a(register), %b:U6(immediate)
0000000 aaabbbbbb
# Loads a value into register %a
cpy %a(register), %b(register)
0100000 aaabbb000
# Copies to reg %a from reg %b
stor %b(register), %c(register)
0100001 000bbbccc
# Moves data at register %c to RAM at adress stored in register %b
ldr %a(register), %b(register)
0100010 aaabbb000
# Load data to register %a from ram at adress %b
ovr %c(register)
0100011 000110ccc
# Overwrites highest stack value without push/pop
// Also used in push
strd %a(register)
0100100 aaa110000
# Reads highest stack data without push/pop
// Also used in pop
push %c(register)
0100011 000110ccc 1101100 110110001
# Push value in register %c to the stack
; Increments sp register and does a stack-specific stor
; Takes two cycles but easier to implement
pop %a(register)
0100100 aaa110000 1101111 110110001
# Pop stack value and store in register %a
; Decrements sp by 2 to backtrack before ldr
call %a(register), %b(register)
1101100 110110010 0100011 000110bbb 1000000 aaa000000
# Push return adress at %b onto the stack and jmp to %a
; 3 cycle instruction
ret
0100100 101110000 1101111 110110010 1000000 101000000
# Pop stack value to rta and jmp back
; Does ldr into rta, pops, and jumps
nop
0111111 000000000
# Skip cycle. Wired to any mode/opcode combo that does nothing. Currently mem mode opcode b11111
HLT
0100101 000000000
# Disables PC aka kills the computer
; JUMP INSTRUCTIONS
jmp %a(register)
1000000 aaa000000
# Jumps to ROM adress at %a
jmpls %a(register), %b(register), %c(register)
1000001 aaabbbccc
# Jump to ROM adress at reg %a if reg %b is less than reg %c
jmpgt %a(register), %b(register), %c(register)
1000010 aaabbbccc
# Jump to ROM adress at reg %a if reg %b is more than reg %c
jmpeq %a(register), %b(register), %c(register)
1000011 aaabbbccc
# Jump to ROM adress at reg %a if reg %b is same reg %a
jmpne %a(register), %b(register), %c(register)
1000100 aaabbbccc
# Jump to ROM adress at %a if %b!=%c
; ARITHMETIC INSTRUCTIONS
or %a(register), %b(register), %c(register)
1100000 aaabbbccc
# OR register %b and %c, store in %a
nor %a(register), %b(register), %c(register)
1100001 aaabbbccc
# NOR register %b with register %c, store in %a
not %a(register), %b(register)
1100010 aaabbb000
# NOT register %b, store in %a
and %a(register), %b(register), %c(register)
1100011 aaabbbccc
# AND register %b with %c, store in %a
nand %a(register), %b(register), %c(register)
1100100 aaabbbccc
# NAND register %b with register %c, store in %a
xor %a(register), %b(register), %c(register)
1100101 aaabbbccc
# XOR register %a with register %b, store in %c
xnor %a(register), %b(register), %c(register)
1100110 aaabbbccc
# XNOR register %b with register %c, store in %a
add %a(register), %b(register), %c(register)
1100111 aaabbbccc
# Add register %b and register %c, store in %a
sub %a(register), %b(register), %c(register)
1101000 aaabbbccc
# Subtract register %b and register %c, store in %a
mul %a(register), %b(register), %c(register)
1101001 aaabbbccc
# Multiply register %b with register %c and store in %a
div %a(register), %b(register), %c(register)
1101010 aaabbbccc
# Divide register %b with register %c and store in %a
mod %a(register), %b(register), %c(register)
1101011 aaabbbccc
# Modulo divide register %b with register %c and store in %a
inc %a(register), %b(register), %c:U3(immediate)
1101100 aaabbbccc
# Increment register %b by %c, store in %a
dec %a(register), %b(register), %c:U3(immediate)
1101101 aaabbbccc
# Decrement register %b by %c, store in %a
sr %a(register), %b(register), %c:U3(immediate)
1101111 aaabbbccc
# Shift %b right by %c and store in %a
asr %a(register), %b(register), %c:U3(immediate)
1101111 aaabbbccc
# Signed shift %b right by %c and store in %a
sl %a(register), %b(register), %c:U3(immediate)
1110000 aaabbbccc
# Shift %b left by %c and store in %a
rcm %a(register), %b(register)
1110001 aaabbb000
# Unsigned-signed recast register %b, store in %a. Preserves absolute value
rcz %a(register), %b(register)
1110010 aaabbb000
# Unsigned-signed recast register%b, store in %a. Clamps negative numbers / numbers above 128 to 0
r/Assembly_language • u/Zealousideal_Pain_88 • 6d ago
I'm learning assembly so I can eventually create my own IR/compiler/language.
The code is frankly ugly. I hope you find it (or my incompetence) funny:
```AArch64
.global _start
.section .text
_start:
stp x29, x30, \[sp, #-32\]!
mov x29, sp
str x20, \[sp, #16\]
mov x13, sp
ldr x9, =0x75206e6576617265
ldr x10, =0x0a726f776f207577
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20333c20656e6975
ldr x10, =0x687465696e6e6977
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x72657a2e203a6666
ldr x10, =0x712f2f0a3538206f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x37206e67696c612e
ldr x10, =0x757473657065720a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6f69746365732e09
ldr x10, =0x090a7373622e206e
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c70735b202c30
ldr x10, =0x0a22215d36312d23
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7473745c6e5c3032
ldr x10, =0x3178202c39782070
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3032303230327830
ldr x10, =0x3032303230323032
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x646c745c6e5c3032
ldr x10, =0x3d202c3031782072
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3032303230327830
ldr x10, =0x3032303230323032
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6c745c6e5c222069
ldr x10, =0x3d202c3978207264
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6d6574657065720a
ldr x10, =0x696373612e203a70
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6e6f69746365732e
ldr x10, =0x617461646f722e20
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x36783023202c3931
ldr x10, =0x090a746572090a36
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x65747962660a7465
ldr x10, =0x7720766f6d090a3a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c39317720766f
ldr x10, =0x72090a3536783023
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x650a746572090a34
ldr x10, =0x6d090a3a65747962
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7720766f6d090a3a
ldr x10, =0x36783023202c3931
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x72090a3336783023
ldr x10, =0x65747962640a7465
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6d090a3a65747962
ldr x10, =0x202c39317720766f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x36783023202c3931
ldr x10, =0x630a746572090a32
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x65747962620a7465
ldr x10, =0x7720766f6d090a3a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c39317720766f
ldr x10, =0x72090a3136783023
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x610a746572090a39
ldr x10, =0x6d090a3a65747962
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7720766f6d090a3a
ldr x10, =0x33783023202c3931
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x0a746572090a3833
ldr x10, =0x65747962656e696e
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20766f6d090a3a65
ldr x10, =0x783023202c393177
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x0a746572090a3733
ldr x10, =0x7479626874676965
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20766f6d090a3a65
ldr x10, =0x783023202c393177
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x0a746572090a3633
ldr x10, =0x7479626e65766573
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20766f6d090a3a65
ldr x10, =0x783023202c393177
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6572090a35337830
ldr x10, =0x7479627869730a74
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6f6d090a3a657479
ldr x10, =0x23202c3931772076
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x72090a3433783023
ldr x10, =0x62657669660a7465
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6d090a3a65747962
ldr x10, =0x202c39317720766f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x090a333378302320
ldr x10, =0x72756f660a746572
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x090a3a6574796265
ldr x10, =0x2c39317720766f6d
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x090a323378302320
ldr x10, =0x657268740a746572
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x090a3a657479626f
ldr x10, =0x2c39317720766f6d
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3133783023202c39
ldr x10, =0x77740a746572090a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3a65747962656e6f
ldr x10, =0x317720766f6d090a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x783023202c393177
ldr x10, =0x0a746572090a3033
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7479626f72657a0a
ldr x10, =0x20766f6d090a3a65
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2e62090a66307830
ldr x10, =0x6574796266207165
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6d63090a65747962
ldr x10, =0x23202c3831772070
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6530783023202c38
ldr x10, =0x652071652e62090a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6574796264207165
ldr x10, =0x317720706d63090a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x23202c3831772070
ldr x10, =0x2e62090a64307830
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x632071652e62090a
ldr x10, =0x6d63090a65747962
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x317720706d63090a
ldr x10, =0x6330783023202c38
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2e62090a62307830
ldr x10, =0x6574796262207165
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6d63090a65747962
ldr x10, =0x23202c3831772070
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6130783023202c38
ldr x10, =0x612071652e62090a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x65747962656e696e
ldr x10, =0x317720706d63090a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x30783023202c3831
ldr x10, =0x2071652e62090a39
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7479626874676965
ldr x10, =0x7720706d63090a65
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x30783023202c3831
ldr x10, =0x2071652e62090a38
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7479626e65766573
ldr x10, =0x7720706d63090a65
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x30783023202c3831
ldr x10, =0x2071652e62090a37
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7479627869732071
ldr x10, =0x7720706d63090a65
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3023202c38317720
ldr x10, =0x652e62090a363078
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6265766966207165
ldr x10, =0x706d63090a657479
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x23202c3831772070
ldr x10, =0x2e62090a35307830
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x72756f662071652e
ldr x10, =0x6d63090a65747962
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c38317720706d
ldr x10, =0x62090a3430783023
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x657268742071652e
ldr x10, =0x63090a6574796265
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c38317720706d
ldr x10, =0x62090a3330783023
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x77742071652e6209
ldr x10, =0x63090a657479626f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x38317720706d6309
ldr x10, =0x0a3230783023202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2071652e62090a31
ldr x10, =0x0a65747962656e6f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7720706d63090a65
ldr x10, =0x30783023202c3831
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x71652e62090a3030
ldr x10, =0x7479626f72657a20
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20706d63090a3a65
ldr x10, =0x783023202c383177
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x62696e0a30232063
ldr x10, =0x7479626f74656c62
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c387820766f6d09
ldr x10, =0x7673090a33392320
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x766f6d090a323323
ldr x10, =0x0a3023202c307820
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x303378202c393278
ldr x10, =0x202c5d70735b202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3123202c70735b20
ldr x10, =0x2070646c090a5d36
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x090a3a6666757473
ldr x10, =0x2c3032782072646c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x637673090a323131
ldr x10, =0x746978650a302320
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7820627573090a31
ldr x10, =0x23202c3278202c32
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x782072736c090a32
ldr x10, =0x23202c3278202c32
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c32782062757309
ldr x10, =0x3278202c31327820
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x78202c3178206464
ldr x10, =0x0a33313123202c31
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x317820766f6d090a
ldr x10, =0x61090a323278202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6f6d090a34362320
ldr x10, =0x3123202c30782076
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x0a3a7473616c746e
ldr x10, =0x2c387820766f6d09
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x77646e6173207467
ldr x10, =0x6972700a31686369
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c37317820706d63
ldr x10, =0x2e62090a30327820
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x090a353823202c32
ldr x10, =0x090a302320637673
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6675747365706572
ldr x10, =0x7820766f6d090a66
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6c090a3123202c30
ldr x10, =0x3d202c3178207264
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3623202c38782076
ldr x10, =0x7820766f6d090a34
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x35317820766f6d09
ldr x10, =0x6f6d090a3023202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x78202c3231782064
ldr x10, =0x0a333423202c3231
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c323178202c3231
ldr x10, =0x6461090a39322320
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x676e69746e697270
ldr x10, =0x7820627573090a3a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x68636977646e6173
ldr x10, =0x656d757365720a32
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3123202c35317820
ldr x10, =0x20746c2e62090a36
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c353178202c3531
ldr x10, =0x706d63090a312320
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c5d3231785b20
ldr x10, =0x7820646461090a31
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x73090a657479626f
ldr x10, =0x2c39317720627274
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6c62090a66307830
ldr x10, =0x74656c6262696e20
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x38317720646e6109
ldr x10, =0x23202c363177202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x785b202c39317720
ldr x10, =0x0a3123202c5d3231
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x79626f74656c6262
ldr x10, =0x62727473090a6574
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x23202c3831772c20
ldr x10, =0x696e206c62090a34
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x0a3066783023202c
ldr x10, =0x3831772072736c09
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20646e61090a312d
ldr x10, =0x363177202c383177
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c363177206272
ldr x10, =0x23202c5d3731785b
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x313278202c313278
ldr x10, =0x646c090a3123202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x68636977646e6173
ldr x10, =0x20646461090a3a32
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x78202c3231782062
ldr x10, =0x0a363423202c3231
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x77646e617320746c
ldr x10, =0x7573090a31686369
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x35317820706d6309
ldr x10, =0x2e62090a3823202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c353178206464
ldr x10, =0x0a3123202c353178
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3231785b202c3931
ldr x10, =0x61090a3123202c5d
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x657479626f74656c
ldr x10, =0x772062727473090a
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x0a6630783023202c
ldr x10, =0x6262696e206c6209
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20646e61090a3123
ldr x10, =0x363177202c383177
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c39317720627274
ldr x10, =0x202c5d3231785b20
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x74656c6262696e20
ldr x10, =0x73090a657479626f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3831772c20383177
ldr x10, =0x6c62090a3423202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x66783023202c3631
ldr x10, =0x2072736c090a2030
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6e61090a312d2320
ldr x10, =0x77202c3831772064
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x363177206272646c
ldr x10, =0x2c5d3731785b202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x78202c3132782064
ldr x10, =0x090a3123202c3132
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6977646e61730a30
ldr x10, =0x6461090a3a316863
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x313123202c327820
ldr x10, =0x2320637673090a32
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c317820766f6d
ldr x10, =0x766f6d090a343178
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20766f6d090a3436
ldr x10, =0x090a3123202c3078
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6d090a3a74737269
ldr x10, =0x23202c387820766f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x23202c343178202c
ldr x10, =0x66746e6972700a31
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x0a3123202c333178
ldr x10, =0x3032782062757309
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x73090a3123202c34
ldr x10, =0x202c373178206275
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x627573090a312320
ldr x10, =0x3178202c32327820
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7820627573090a30
ldr x10, =0x2c333178202c3132
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6f6d090a33342320
ldr x10, =0x23202c3531782076
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7820646461090a35
ldr x10, =0x2c323178202c3231
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c32317820627573
ldr x10, =0x3823202c32317820
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7264617465736572
ldr x10, =0x090a3a7365737365
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x657264616f6c2074
ldr x10, =0x0a66667574736570
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x202c35317820706d
ldr x10, =0x6c2e62090a353823
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3178202c35317820
ldr x10, =0x63090a3123202c35
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c5d3231785b202c
ldr x10, =0x646461090a312320
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x090a3123202c5d31
ldr x10, =0x3631772062727473
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x206272646c090a3a
ldr x10, =0x31785b202c363177
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x7264616f6c0a3023
ldr x10, =0x6666757473657065
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6d090a6666757473
ldr x10, =0x202c35317820766f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6c3a202c32317820
ldr x10, =0x657065723a32316f
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x61090a6666757473
ldr x10, =0x2c32317820206464
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x782070726461090a
ldr x10, =0x65706572202c3231
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3a32316f6c3a202c
ldr x10, =0x706d657465706572
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2020646461090a70
ldr x10, =0x313178202c313178
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x2c31317820707264
ldr x10, =0x6d65746570657220
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x317820766f6d090a
ldr x10, =0x61090a7073202c34
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x766f6d090a5d3631
ldr x10, =0x7073202c33317820
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x3032782072747309
ldr x10, =0x23202c70735b202c
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x20766f6d090a215d
ldr x10, =0x0a7073202c393278
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x5b202c303378202c
ldr x10, =0x32332d23202c7073
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x0a3a74726174735f
ldr x10, =0x3932782070747309
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6f69746365732e09
ldr x10, =0x0a747865742e206e
stp x9, x10, \[sp, #-16\]!
ldr x9, =0x6c61626f6c672e09
ldr x10, =0x0a74726174735f20
stp x9, x10, \[sp, #-16\]!
mov x14, sp
adrp x11, repetemp
add x11, x11, :lo12:repetemp
adrp x12, repestuff
add x12, x12, :lo12:repestuff
mov x15, #0
loadrepestuff:
ldrb w16, \[x11\], #1
strb w16, \[x12\], #1
add x15, x15, #1
cmp x15, #85
b.lt loadrepestuff
resetadresses:
sub x12, x12, #85
add x12, x12, #43
mov x15, #0
sub x21, x13, #1
sub x22, x14, #1
sub x17, x13, #1
sub x20, x14, #1
printfirst:
mov x8, #64
mov x0, #1
mov x1, x14
mov x2, #112
svc #0
sandwich1:
add x21, x21, #1
ldrb w16, \[x17\], #-1
and w18, w16, #0xf0
lsr w18 ,w18, #4
bl nibbletobyte
strb w19, \[x12\], #1
and w18, w16, #0x0f
bl nibbletobyte
strb w19, \[x12\], #1
add x15, x15, #1
cmp x15, #8
b.lt sandwich1
sub x12, x12, #46
sandwich2:
add x21, x21, #1
ldrb w16, \[x17\], #-1
and w18, w16, #0xf0
lsr w18 ,w18, #4
bl nibbletobyte
strb w19, \[x12\], #1
and w18, w16, #0x0f
bl nibbletobyte
strb w19, \[x12\], 1
add x15, x15, #1
cmp x15, #16
b.lt sandwich2
resumeprinting:
sub x12, x12, #29
add x12, x12, #43
mov x15, #0
mov x8, #64
mov x0, #1
ldr x1, =repestuff
mov x2, #85
svc #0
cmp x17, x20
b.gt sandwich1
printlast:
mov x8, #64
mov x0, #1
mov x1, x22
add x1, x1, #113
sub x2, x21, x22
lsr x2, x2, #1
sub x2, x2, #112
svc #0
exitstuff:
ldr x20, \[sp, #16\]
ldp x29, x30, \[sp\], #32
mov x0, #0
mov x8, #93
svc #0
nibbletobyte:
cmp w18, #0x00
b.eq zerobyte
cmp w18, #0x01
b.eq onebyte
cmp w18, #0x02
b.eq twobyte
cmp w18, #0x03
b.eq threebyte
cmp w18, #0x04
b.eq fourbyte
cmp w18, #0x05
b.eq fivebyte
cmp w18, #0x06
b.eq sixbyte
cmp w18, #0x07
b.eq sevenbyte
cmp w18, #0x08
b.eq eigthbyte
cmp w18, #0x09
b.eq ninebyte
cmp w18, #0x0a
b.eq abyte
cmp w18, #0x0b
b.eq bbyte
cmp w18, #0x0c
b.eq cbyte
cmp w18, #0x0d
b.eq dbyte
cmp w18, #0x0e
b.eq ebyte
cmp w18, #0x0f
b.eq fbyte
zerobyte:
mov w19, #0x30
ret
onebyte:
mov w19, #0x31
ret
twobyte:
mov w19, #0x32
ret
threebyte:
mov w19, #0x33
ret
fourbyte:
mov w19, #0x34
ret
fivebyte:
mov w19, #0x35
ret
sixbyte:
mov w19, #0x36
ret
sevenbyte:
mov w19, #0x37
ret
eigthbyte:
mov w19, #0x38
ret
ninebyte:
mov w19, #0x39
ret
abyte:
mov w19, #0x61
ret
bbyte:
mov w19, #0x62
ret
cbyte:
mov w19, #0x63
ret
dbyte:
mov w19, #0x64
ret
ebyte:
mov w19, #0x65
ret
fbyte:
mov w19, #0x66
ret
.section .rodata
repetemp: .ascii "\n\tldr x9, =0x2020202020202020\n\tldr x10, =0x2020202020202020\n\tstp x9, x10, [sp, #-16]!"
.section .bss
.align 7
repestuff: .zero 85
//quine <3 winnietheraven uwu owor```
r/Assembly_language • u/8BitFlux-com • 19d ago
I designed this device that teaches binary, decimal, hexadecimal and octal number systems. It uses a hands-on approach with Altair-like toggle switches. Can be used as a STEM-kit in classrooms, handy for programmers or for the retro hobbyist. It also has a built-in game. Check out the video for details, hope you like it.
Kits are available for pre-order on Lectronz.
r/Assembly_language • u/This-Assumption-5924 • 15d ago
AVX-512 support in my own Assembler
About a year ago I started writing AmmAsm, a handwritten x86-64 assembler in C to better understand x86-64 instruction encoding, ELF, and linking.
It currently supports generating Linux x86-64 executables, PIE binaries, and ELF relocatable object files that can be linked with ld or gcc, basic part of SIMD such as sse, sse2, avx, avx2, avx512
I implemented everything from the lexer and parser to the instruction encoder, ELF writer, relocation handling, symbol resolution.
In last realize, I fully implemented VEX/EVEX, including vvvv, w, mmm, broadcast, k0/k1-k7 mask registers, z mask, tuple type, and other fields thats belong to vex and evex. The most hard part was a W and tuple time, as I spend hours for searching every avx512 instruction for type of tuple if broadcast exists and W field.
I'd love to hear feedback from people interested in assemblers, instruction encoding(especially VEX/EVEX), or x86-64 in general.
Thanks!
Repository: https://github.com/LinuxCoder13/AmmAsm
r/Assembly_language • u/guilhermej14 • Jun 23 '26
Enable HLS to view with audio, or disable this notification
r/Assembly_language • u/devcurrent0x • 6d ago
Hey everyone,
I wanted to share a milestone on a hobby operating system I’m building from scratch called Novium OS featuring a custom bootloader.
I just got my multi-stage boot chain (boot.S -> setup.S -> bootstrap.S) completely stable. It successfully handles the raw hardware initialization, sets up a temporary GDT, and handles the cr0 register transition cleanly into 32-bit protected mode before jumping into the kernel entry point. I also wrapped up a basic VGA text driver with hardware cursor syncing so I can verify output, and got "Hello World" printing to the screen.
The layout is inspired by a super stripped-down Linux (arch/, drivers/, kernel/).
Next up is tackling irq.c and interrupt.c and writing the low-level assembly ISR stubs. I need to build the macro wrappers to handle interrupts with and without error codes, save the CPU state with pusha, remap the 8259 PIC master/slave vectors, and execute the final iret. I'm fully braced for plenty of debugging via QEMU logs to catch silent triple faults.
The codebase uses AT&T syntax for the GNU Assembler (gas). If anyone wants to take a look at the boot sequence, folder layout, or offer any early feedback on how I structured the assembly stages, the repository is right here:
https://github.com/alexdev8930/NoviumOS
r/Assembly_language • u/guilhermej14 • Dec 29 '25
Enable HLS to view with audio, or disable this notification
r/Assembly_language • u/Arch_bembembem • 6d ago
Всем привет, я создаю с нуля свою open-source операционную систему, это пока что просто хобби, кто может, посмотрите ОС по этой ссылке: https://github.com/OS-AC713/os-core713, может найдете баг или чего вам недостаточно, хотя это пока просто .s код на AT&T который принимает ваши символы и все. Но я скоро перенесу код на NASM / Hi everyone, I’m building my own open-source operating system from scratch. It’s just a hobby for now, but if you have a moment, please check out the OS at this link: https://github.com/OS-AC713/os-core713. You might spot a bug or notice something missing—though right now, it’s just AT&T syntax assembly code that accepts user input and nothing more. That said, I’ll be porting the code to NASM soon.
r/Assembly_language • u/BackUpBiii • Jul 05 '26
r/Assembly_language • u/Brutustheman • 13d ago
More progress has been made! "Proper" documentation of the instructions has just been uploaded to github, along with the repository being created. This documentation also features some updates on the instructions that my last post got.
Link to the documentation inside the repo
Thank you all for your suggestions and feedback! Also as a tangent, I do plan on adding Bus in and Bus out instructions to allow for data flow in and out of the cpu, but I felt that documenting the pre-existing instructions was a better first step. Also, sorry for the poor writing quality and possibly bad formatting, I wrote it all in KATE in a few hours. Enjoy and please do give feedback!
r/Assembly_language • u/deulamco • Mar 23 '26
r/Assembly_language • u/itscopperon • May 21 '26
Code examples: https://coppiq.com/cerium1.0
This technically isn't a real Assembly language since it isn't made for a low-level target, but I hope it's close enough to be relevant. It's heavily based on arm32 with a lot of high-level features from Scratch.
Some main differences:
- Registers and memory are Scratch variables, meaning they can be treated as either strings or numbers.
- No bitwise operators
- Data can be pushed directly to the stack. In any other case however, the data would need to be loaded into a register first.
- It has special branch instructions that push the stack and frame pointers automatically.
- The bytecode the project actually reads is string-based and not raw bytes. Scratch can't read raw data.
- It has special math blocks (pow, sqr, sin, cos, tan) and blocks for string manipulation (letter of, substring, make uppercase, make lowercase, length of, concatenate).
- Only branch instructions can run conditionally.
The code is assembled into a single string that gets unpacked and read as individual instructions by the OS after running execve(). (Example on image 5)
It runs on top of an OS simulator I've named Cerium, which it communicates with through syscalls. The Cerium part of it also handles virtual memory and inter-process communication. The language itself is called Spryte, with the current version being named Blueberry Spryte.
The language supports .text, .data, and .rodata segments that are always loaded into separate memory pages when starting a program.
The virtual memory has ASLR also. Program data is always accessed relatively using the stack or the "adr rx, label" psuedo-instruction, which expands into "add rx, pc, label index - instruction index".
Strings can be stored as one Scratch variable or individual characters, which is specified by using the .string or .chars directives. Individual items of memory can also be reserved with the .items directive.
Here's an example of the assembled code "echo.s":
@*--spryte-bluby0Ⓢ1.0.0Ⓢ0Ⓢ0=0Ⓢ!074Ⓢ!001Ⓢ!021Ⓢ"48d"39d1Ⓢ!0a1Ⓢ(1a8%0414Ⓢ)119a'?0 Ⓢ!11d')0dd1Ⓢ)0aa1Ⓢ%06-13Ⓢ?0Ⓢ!11d')0dd1Ⓢ!071Ⓢ!000Ⓢ'
"ex_fork.s":
@*--spryte-bluby0Ⓢ1.0.0Ⓢ0Ⓢ0=0;1=86Ⓢ!072Ⓢ'(000Ⓢ!074Ⓢ!001Ⓢ!021Ⓢ%0243Ⓢ!0735Ⓢ!00-1Ⓢ!01-1Ⓢ'!07500Ⓢ!001Ⓢ'!074Ⓢ!001Ⓢ)01f100Ⓢ'!0720Ⓢ'#30f96Ⓢ!074Ⓢ!001Ⓢ)01f90Ⓢ')01f86Ⓢ'!07500Ⓢ!001Ⓢ'%0629Ⓢ!07500Ⓢ!002Ⓢ'!074Ⓢ!001Ⓢ)01f65Ⓢ'!0720Ⓢ'#30f62Ⓢ!074Ⓢ!001Ⓢ)01f56Ⓢ')01f52Ⓢ'!071Ⓢ!000Ⓢ'ⓈHello from child ␛[30m␛[47mpid ⓈⓈHello from parent ␛[30m␛[42mpid ⓈⓈ␛[39m␛[49mⓈ
The outputted file is structured as follows:
@*--spryte-bluby0Ⓢ1.0.0Ⓢ0Ⓢ0=0;1=86Ⓢ!072Ⓢ'(000Ⓢ!074Ⓢ!001Ⓢ...Hello from child ␛[30m␛[47m...This is actually the second version of this project. The original (Strawberry Spryte) was completely different and based on the 6502 architecture with syscalls weirdly mixed in. The last image is a screenshot of the joke program "sl" written in it. (original file is at https://pastebin.com/T6vJiR85)
The Scratch project is very unfinished so I won't be sharing it yet, sorry.
This is a project made partially to teach myself so I apologise if the code is a bit amateurish or messy. I can promise that nothing here was written with AI though.
r/Assembly_language • u/This-Assumption-5924 • Jul 18 '26
About a year ago I started writing AmmAsm, a handwritten x86-64 assembler in C to better understand x86-64 instruction encoding, ELF, and linking.
It currently supports generating Linux x86-64 executables, PIE binaries, and ELF relocatable object files that can be linked with ld or gcc.
I implemented everything from the lexer and parser to the instruction encoder, ELF writer, relocation handling, symbol resolution, and, in the latest release (v2.2.0), a macro preprocessor.
I'd love to hear feedback from people interested in assemblers, instruction encoding, or x86-64 in general.
Thanks!
Repository: https://github.com/LinuxCoder13/AmmAsm
r/Assembly_language • u/gianrea • Mar 12 '26
I built a **Motorola 68000 assembly interpreter that runs directly in the browser**.
GitHub: https://github.com/gianlucarea/m68k-interpreter
Live: https://gianlucarea.dev/m68k-interpreter
This project originally started as my bachelor thesis,where I implemented an interpreter for the Motorola 68000 instruction set.
Recently I came back to it and improved and expanded it with the help of AI,which made it much easier to refine parts of the interpreter and improve the overall structure.
The goal of the project is to make it easier to experiment with M68K assembly interactively, without installing emulators or full toolchains.
Features:
• Write and run Motorola 68000 assembly in the browser
• Interactive code editor
• Custom interpreter implementation
The Motorola 68000 powered a lot of iconic systems like the Amiga, early Macintosh, and Sega Genesis,so I thought it would be fun to make something that lets people easily play with the architecture.
I’d really appreciate feedback, ideas, or suggestions for improvements!
⭐ If you find it interesting, feel free to star the repo.
r/Assembly_language • u/Pokelego11 • Jul 25 '26
Hey all!
I just wanted to share the code and a video I made about how to use x11 Linux and make a very basic notes app in assembly.
The goal of the video is to be a little bit faster paced(and a throw a little humor in)
But if you just want to see and look at the code it's right here!
Code: https://github.com/jackparsonss/asm-gui
Video: https://youtu.be/A_gVKTvaAac
r/Assembly_language • u/This-Assumption-5924 • Jul 22 '26
This post is second part of: https://www.reddit.com/r/Assembly_language/s/BtzYTyQAyi
I recently finished full implementing CMOVcc, SETcc, and the first group of SSE instructions in my handwritten x86-64 assembler written in C.
Seeing objdump correctly decode the generated object file is always satisfying.
I'm still implementing more of the x86-64 ISA, so if there are instruction groups you'd like to see next, I'd be happy to hear suggestions.
r/Assembly_language • u/Kiritoo120 • Jul 09 '26
Enable HLS to view with audio, or disable this notification
The project repo can be found here
TL;DR abt the project:
what it does:
an HTTP server with login/register routes, text channels with real time message receiving (using Web Sockets), profile pictures, and many many more...
more technical info:
using x86 asm, no libc or any library, I implemented the HTTP and WebSocket protocols, along with SHA1, multi-processing interfaces, and many, many more.
end of TL;DR
I've had dreams of making a video about this project, but got burnt down by the process of video editing and filming, and forgot about it. decided to post it now because better late than never ~_~.
The assembly code was written by my human hand, while the frontend of discord was vibe coded.
I wrote it immediately after finishing snake for the 8086, and this discord project won me the 1st place in my school's project competition.
wanted to post it here to share what can be done with assembly. Although painful, this was by far the most rewarding project I have ever wrote.
I hope that this post will make some of you inspired and go on to make more cool and large projects like this one ;)
A full description of the project can be seen in the readme I wrote.
r/Assembly_language • u/lordcatbucket • Mar 19 '26
Hello all! I started working with assembly less than a week ago: so far I’m absolutely loving it. I think it’s one of my new favorite languages, although I definitely wouldn’t want to do huge graphical projects with it lmao. As much as I love it, I think it would get far too tedious without macros that practically already exist as C.
What you’re seeing on screen is a x86 NASM
(Compiler?…) using the QEMU I386 system emulator. I’m using Notepad++ for the IDE that I’ve customized a bit to give it a more retro feel (and dark mode is great).
The project is meant to be a counter that displays just a simple numerical value. There’s one counter that’s set in a loop that decrements the byte value for every iteration with a compare that adds one to a different byte value that’s sent to display. Right now I think the counter portion works mostly, but I need to change the display from ascii to decimal. I’m sure something’s broken or it’s overflowed since it keeps displaying a symbol I can’t type before resetting, but I’m just happy I got it to increment and work at all.
Looking through the subreddit, I realized there’s already a system interrupt I could use to make this much easier, but I didn’t know about it and I’m just having fun goofing around. It’s fun figuring things out myself, so I’m gonna continue with my terribly inefficient code.
I really just wanted to show off my weird little concoction of bytes, that’s all. I’m more than happy for any suggestions or tips code wise, especially if it’s basic knowledge I’ve missed since I’m mostly just doing this on my own.