r/Assembly_language • u/chancemixon • 7h ago
r/Assembly_language • u/RainMeru • 14h ago
Question I need help to make a minimal assembly setup
I began learning assembly some time ago and it's been a pleasant experience so far. I've been using online resources (tio.run x64 with nasm) to try it out and now would like to install a developer environment on my machine (Windows 11, x86-64). However, most setups either require large libc (GNU via MinGW or LLVM) ecosystems or msvc. I would like to avoid both of them. Ideally, I'd like to use cross platform foss to be able to assemble and link programs (as in output executables for multiple target architectures and the tools are cross platform themselves). I do want to be able to link C libraries, but I don't want to be dependent on them (writing my own _start if needed). I've already installed nasm (x86, x64 only but it's ok for now), but I'm missing a linker now.
Also how do I do dynamic linking?
r/Assembly_language • u/WritHerAI • 1d ago
Project show-off Pithos CORE: LiquidAI LFM3-1.7B and LFM2.5-350M inference in x86-64 NASM assembly, on Linux and as a standalone OS that boots from BIOS or UEFI into a Unicode chat console. No libc.
youtu.ber/Assembly_language • u/kroggens • 1d ago
54% faster generation by removing the Linux OS and llama.cpp
reddit.comr/Assembly_language • u/WellesleySensible • 4d ago
Help Project Research
Hi there,
My son is currently working on a Computer Science project and is trying to source some research around his proposed 6502 development toolkit. He's got a series of questions and I was wondering if anyone out there might be willing to just give us some insight that we might be able to use as research.
The questions he has laid out are...
- How familiar are you with assembly programming?
- Have you ever used a CPU simulator, emulator, or debugger?
- Which features would you consider most important in a 6502 development environment?
- How useful would the ability to execute instructions one by one be?
- How important would it be to view the CPU's internal registers (A, X, Y, PC, SP and status flags) while a program executes?
- Which memory inspection features would you find useful?
There is an actual survey form here...
Any input or feedback would be hugely appreciated. It's a topic that he's finding hard to get input on, but is super keen on it and trying to do some really good work.
Thank you
r/Assembly_language • u/OliveScott200 • 6d ago
Project show-off Did my first Rainbow Hello World in pure x86 asm!
r/Assembly_language • u/idkilikephilosophy • 6d ago
Countinuing from previous post:
If you hadnt heard i made a post on whether i should learn assembly, and im honestly gonna do it
Im coming from c# and im already learning some shit, its interesting to see how a computer works in the background but its unbelievably complicated, it would be nice to create a project in assembly like a OS or custom language which i only dream of in the process, (for that i shouldve probably learnt C but assembly is harder which is why i did this)
Heres some questions:
What is the optimal way for learning assembly?
What use cases did you use assembly for?
Was it worth it?
r/Assembly_language • u/thecodegangster • 5d ago
Question What if a computer used bf for it's assembly language
reddit.comr/Assembly_language • u/tinymoat • 7d ago
Solved! Can't call subroutine from a linked in object file in GBA assembly
Hello, I recently decided to start learning assembly by programming the game boy advance. Most of the information about programming the gba I've found are for C programming so I'm trying to learn assembly by translating them to assembly. I'm specifically following the tonc turorials, with a development environment I mostly copied from the gba-bootstrap repository.
I got the first example from the tonc tutorial running on mgba (a gba emulator), but I did it with a unity build. The tonc book strongly advises against this and instead recommends you assemble the files separately and link them together instead.
Right now my working code looks something like this (shortened for brevity):
// src/header.s
// copied almost verbetim from gba-bootstrap
.section .gba_crt0, "ax"
.global entrypoint
.cpu arm7tdmi
.arm
entrypoint:
/*
* gba header boilerplate
* initialize the cpu and switch to thumb mode
*/
bl main
// If main returns, reboot GBA using SoftReset
swi #0x00
// src/main.s
.include "src/header.s"
.section .text
.global main
main:
/*
* Draw colors on the screen
*/
// while(1)
1:
b 1b
// unreachable
bx lrHere's the Makefile in it's entirety because I suspect the problem is there:
NAME := main
GAME_TITLE := "GBA_TEMPLATE"
GAME_CODE := "00"
UNAME_S := $(shell uname -s)
MAKEFLAGS += --no-print-directory
PREFIX := arm-none-eabi-
AS := $(PREFIX)as
LD := $(PREFIX)ld
CC := $(PREFIX)gcc
CXX := $(PREFIX)g++
OBJDUMP := $(PREFIX)objdump
OBJCOPY := $(PREFIX)objcopy
MKDIR := mkdir
RM := rm -rf
ELF := $(NAME).elf
ROM := $(NAME).gba
MAP := $(NAME).map
GBAFIX := gbafix/gbafix
ASFLAGS := -x assembler-with-cpp \
-mthumb -mthumb-interwork \
-ffunction-sections -fdata-sections
LDFLAGS := -mthumb -mthumb-interwork \
-Wl,-Map,$(MAP) -Wl,--gc-sections \
-specs=nano.specs -T src/gba.ld \
SOURCEDIR := src
BUILDDIR := build
SOURCES := $(wildcard $(SOURCEDIR)/*.s $(SOURCEDIR)/**/*.s)
OBJS := $(patsubst $(SOURCEDIR)/%.s,$(BUILDDIR)/%.s.o,$(SOURCES))
$(BUILDDIR)/%.s.o : $(SOURCEDIR)/%.s
@echo " AS $<"
@$(MKDIR) -p $(BUILDDIR)
@$(CC) $(ASFLAGS) -MMD -MP -c -g -o $@ $<
$(ROM) : $(ELF) $(GBAFIX)
@$(OBJCOPY) -O binary $< $@
@echo " GBAFIX $@"
@$(GBAFIX) $@ -t$(GAME_TITLE) -c$(GAME_CODE)
$(ELF) : $(OBJS) src/gba.ld
@echo " LD $@"
@$(CC) -o $@ $(BUILDDIR)/main.s.o $(LDFLAGS)
@#$(CC) -o $@ $(OBJS) $(LDFLAGS) #DOESN'T WORK
$(GBAFIX) : gbafix/gbafix.c
@echo " building GBAFIX"
@cd gbafix && make
.PHONEY: clean dump
clean:
@echo " clean"
@$(RM) $(ROM) $(ELF) $(MAP) $(BUILDDIR)
@cd gbafix && make clean
dump: $(ELF)
@$(OBJDUMP) -S $(ELF)
ifeq ($(UNAME_S), Darwin)
.PHONEY: run
run: $(ROM)
@echo " RUNNING $(ROM)"
@open -a "mgba" $(ROM)
endifThe linker script is copied verbatim from gba-bootstrap because I don't really understand linkers.
When I switch to linking together all the object files and don't include header in main I still get a main.gba file that runs in the emulator, but it doesn't run the code at my main label.
I don't know if I'm doing something wrong with assembly or if this is a game boy specific problem. What confuses me though is when I objdump my linked file I see the bl main call from the header file has the same address as where my main label ended up.
Any help at all with this would be appreciated! Thanks
r/Assembly_language • u/c-cul • 7d ago
why it's so hard to make cuda SASS assembler?
redplait.blogspot.comr/Assembly_language • u/idkilikephilosophy • 10d ago
Solved! Should i learn assembly?
Im learning assembly because of shits and giggles, i have no serious background and im a beginner.
Heres some questions:
- What am i getting myself into?
- Is it actually worth it? (I dont think ill use assembly much)
r/Assembly_language • u/Thejuzzz • 11d ago
Question Why do Assembly programmers still put all labels at column 0, instead of nested blocks? Which is easier to manage
I know modern assemblers don't care whitespace and this comes down to redabality and the style.
In almost EVERY assembly code I've seen, the format is label at col 0 (every label) and the instructions are nested to the label. Local labels coming in? Still at col 0.
Like, compare these codes:
# size_t strlen(const char *str)
.global strlen
.type strlen,
strlen:
# %rdi: const char *str
xorq %rax, %rax
movq %rdi, %rsi
1:
cmpb $0x00, (%rsi)
je 2f
incq %rax
incq %rsi
jmp 1b
2:
retAnd this
# size_t strlen(const char *str)
.global strlen
.type strlen,
strlen:
# %rdi: const char *str
xorq %rax, %rax
movq %rdi, %rsi
1:
cmpb $0x00, (%rsi)
je 2f
incq %rax
incq %rsi
jmp 1b
2:
retFor me, the indented version seems waaaayyy better. Like, it's easy to manage.
However, still I am not advanced assembly programmer and hadn't coded large codebases in assembly, so... I am not sure which is better.
Which is ACTUALLY BETTER? All at 0 or INDENDED for loops and sub tasks for a label???
r/Assembly_language • u/No_feeer_Nordik • 10d ago
Intel versus AT&T syntax
Hi everyone! I am back two Assembly after three decades and I would appreciate some input. At the time, I programmed x86 using TASM in a DOS environment for finance (valuation of derivatives when that was a thing...). I never programmed in a windows environment nor in an ARM CPU. Now in my first attempt to catch up, I am reading a book called "Programming from the ground up" which I like very much but the syntax used is AT&T. I didn't even know there was such a thing...Bottomline: what should I take into account when deciding what syntax to use? I work with macOS, Windows and Linux. What I'm looking for is to be able to program in a "modern" assembly that works in contemporary x86 CPUs with Windows or linux and maybe later, learn ARM assembly. Any suggestion regarding the path I should take to is welcome. Thanks!
r/Assembly_language • u/LabAdministrative760 • 10d ago
Assembly Aula 33Assembly x86_32 no Linux: Leitura de String, Buffer e Limpeza de Overflow (NASM)
youtube.comAssembly x86_32 no Linux: Leitura de String, Buffer e Limpeza de Overflow (NASM)
r/Assembly_language • u/Background_Shift5408 • 13d ago
Project show-off Forth interpreter for the ZX Spectrum
r/Assembly_language • u/flickerflak • 15d ago
How can I start programming an ARM processor completely from scratch?
reddit.comr/Assembly_language • u/DeltaSucksAtMC • 16d ago
Should I learn
Hey guys, should I learn ASM? I have pretty decent skill in c and c++, im better at memory stuff then complex math, and I wrote a basic malloc using windows and linux ram allocator.
r/Assembly_language • u/Adorable_Crazy_7281 • 16d ago
Sources for good assembly tutorials/begginers?
I am looking specifically for something like Geekforgeeks or Sololearning. Obviously for assembly it would be a more niche one but you get the idea. If its a book it would be okay too. Also can assembly be useful for cyber security/ red teaming since its attacking the base code of it all?
r/Assembly_language • u/-Ahsa- • 16d ago
Nuevo en assembly
Estoy queriendo aprender assembly pero no se por donde empezar ni que deberia de hacer para practicarlo (que instalar o que pagina ir para aprenderlo), alguna recomendacion? Gracias
r/Assembly_language • u/Hefty_Brother_5886 • 16d ago
Que opciones laborales puedo tener si aprendo Assembly?
Lo que dice el título, busco una forma de ganarme la vida.
r/Assembly_language • u/Mindless-Item-5136 • 16d ago
My first assembly program
// Multiplies R0 and R1 and stores the result in R2. // (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.) // The algorithm is based on repetitive addition.
@R0
D=M
@10
M=D // counter
@R2
D=0
M=0(START) @10 D=M @END D;JLE // end the loop if counter <= 0
// R1 + R2
@R1
D=M
@R2
D=D+M
@R2
M=D // current result
@10
D=M
M=D-1
// jump back to the loop start for new iteration
@START
0;JMP(END) @END 0;JMP
r/Assembly_language • • 16d ago
Help Can someone help with a program?
I’m not good at assembly but I want to learn it and have been trying to make a program with it. The program is just supposed to square a number (read user input, multiply the input with itself, and print the result).
I’m on Linux and have no idea how to fully accomplish this. My biggest struggle is figuring out how to multiply the user input and work it into a write syscall. Help would be appreciated.
r/Assembly_language • u/Educational_Bed6462 • 17d ago
Question Embarking on OS-development, any tips?
My goal is to go through the strenuous journey of creating an entire operating system within x86 assembly, no higher level of programming language; just assembly.
This started as a hobby when I learned C a year back and ended up branching off and learning more about how C compiled to assembly and I have been doing handwritten compilation attempts of C on paper. This has ranged from typical notebook activity to as far as writing down these sequences of programming on spare receipt paper at my job during dead times on a shift. From time to time as my knowledge is practiced or when it drifts out of practice, I may tend to write out the opcodes in hexadecimal then write it additionally in binary just to feel a little bit less bored.
I ended up watching a few YouTube videos for being able to form something greater with the little bit of assembly and computing knowledge I have, and learned how to make my first boot loader with netwide assembler and QEMU!

I do not have an incredible amount of knowledge in assembly despite my description of what I do in my free time, and so I ask; where can I look to find more resources or "hidden-gems" of knowledge regarding OS development?
Thanks!