Skip to main content

Questions tagged [nasm]

NASM is the Netwide Assembler, an open-source x86/x64 assembler. It aims at being portable, modular and at having a simple syntax.

1 vote
1 answer
86 views

An example of a bootloader that changes color in a loop in assembly x86

In short, this bootloader code loads sectors from the disk into memory, sets the video mode and prints a message on the screen. After that, it goes into an infinite loop, keeping the system running. <...
Bruno Ciccarino's user avatar
6 votes
1 answer
634 views

x86 assembly program to compute some random function

As a way to refresh my knowledge on assembly, I tried to compile the below C program to x86 assembly by hand. ...
The Rizzler's user avatar
3 votes
2 answers
145 views

Functions to simplify printing strings and numbers in amd64 Assembly

I'm new to Assembly, and this is my very first "project" in Assembly. I wanted to store data (numbers) on the stack, then access and display them. Eventually, this "experiment" of ...
ghost's user avatar
  • 31
3 votes
1 answer
196 views

`strdup` re-implementation in assembly

I am posting a message here because I am new to assembly programming. My goal today was to re-code strdup in assembly, so to save my first parameter which is a ...
knocknock's user avatar
4 votes
2 answers
305 views

Print decimal integer

This is an x86-64 Linux program to print a non-negative decimal integer. I would appreciate any simple optimizations for size and readability. I am aware that division by a constant is usually done by ...
qwr's user avatar
  • 1,233
-1 votes
2 answers
142 views

Optimizing Netwide Assembler codes in Microsoft Windows

I am a novice in assembler programing, I will will appreciate if someone could review these NASM assembler code for me. Is about encoder decoder. The encoder performs the following: pads the ...
Ben kubi's user avatar
3 votes
1 answer
1k views

"Hello world" in x64 assembly for Windows - Shadow space / Stack alignment

I`m currently trying to delve into x64 assembly under windows using NASM, and created a minimalistic "Hello World" application. It is mainly meant as an educational resource for me and ...
RaphM's user avatar
  • 98
1 vote
1 answer
383 views

File dump in assembly

This is a file dump program written in assembly that displays 320 bytes at a time in 20 lines. It shows the hex code for each character and also the string At the start of the program it asks for the ...
user259137's user avatar
6 votes
1 answer
454 views

Assembler. Algorithm for incrementing a decimal number

I share an algorithm that I have written myself. It is useful for incrementing any digit of a decimal number. That way, a conversion to decimal is not necessary. Please excuse the mistakes. I am ...
FER31's user avatar
  • 63
5 votes
2 answers
1k views

x86_64 nasm criticism on malloc and free implementation

I have made my own malloc implementation using this resource as a guide https://danluu.com/malloc-tutorial/ I was hoping to receive some feed back on how I can improve upon it, and If I did any major ...
CLox's user avatar
  • 419
1 vote
1 answer
133 views

Criticism on x86_64 nasm printBigInt and bigPow implementation

The first "method" I have coded is _bigPow which can pow(x, y) on any number which is really big. And the _printBigInt prints a very big integer. Plus I have tried to comment most parts of ...
CLox's user avatar
  • 419
6 votes
1 answer
534 views

CodeWars - Assembly Language - Check List For Value

I'm doing assembly language problems on CodeWars, a website with practice problems. Problem https://www.codewars.com/kata/545991b4cbae2a5fda000158/train/nasm Create a method that accepts a list and ...
RedDragonWebDesign's user avatar
4 votes
2 answers
399 views

Criticism on x86_64 nasm assembly strToInt and printInt implementation

I am pretty new to assembly I would like criticism on two "methods" I have written. One converts string to int and the other prints an int to stdout. Any advise helps out. ...
CLox's user avatar
  • 419
2 votes
2 answers
172 views

Exponentiation by squaring in x64 Linux Assembly

I am learning some assembly for a compiler project I am working on and I have come across the Exponentiation by Squaring algorithm when it came to calculating x ^ n. To get a grasp on how the ...
Rob's user avatar
  • 63
5 votes
1 answer
136 views

Hailstone Sequence in NASM

For practice, I wrote some NASM code that prints out the hailstone sequence of a (unfortunately, hardcoded) number. This is by far the most complex code I've ever written in NASM. I'd like advice on ...
Carcigenicate's user avatar

15 30 50 per page