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.
23
questions
3
votes
2
answers
76
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 ...
3
votes
1
answer
63
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 ...
3
votes
2
answers
168
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 ...
-2
votes
2
answers
102
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 ...
1
vote
1
answer
551
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 ...
1
vote
1
answer
127
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 ...
6
votes
1
answer
357
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 ...
5
votes
2
answers
963
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 ...
1
vote
1
answer
85
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 ...
6
votes
1
answer
423
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 ...
4
votes
2
answers
278
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.
...
2
votes
2
answers
129
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 ...
5
votes
1
answer
105
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 ...
6
votes
1
answer
1k
views
Printing a number from memory in assembly
I'm trying to work up to being able to print the hailstone sequence in assembly. To do that though, I first needed to learn how to actually print a number out using the ...
3
votes
1
answer
491
views
Simple program to print from a buffer until a newline is found
For practice, I wrote a small program that goes through a string in the data section (although, it could be easily adapted to take user input), and print out the characters in the string until it ...
2
votes
1
answer
1k
views
Is this the rigth way to write power and factorial functions with nasm?
I wrote factorial and power functions with nasm but I don't know if it is the right to write assembly code. For example, by executing the functions I make some changes in the registers and I don't ...
5
votes
1
answer
2k
views
Program for string length in x86
It takes in a string from the command line. prints out the length of the string.
I'm mostly looking for tips and general convention suggestions
But I'm open to any other criticism also.
Roast it ...
3
votes
1
answer
68
views
Key-scanning macro in NASM Win16 against DOSBOX (Intel 8086)
Supports backspacing, but not wrapped backspacing.
...
6
votes
1
answer
270
views
Multitasking in NASM Win16 Assembly
Requirements (Installed using Scoop)
scoop install nasm dosbox
Build (Using NASM)
nasm -g tasks.asm -o tasks.com
...
4
votes
1
answer
1k
views
Printing a string in NASM Win16 Assembly
A small script that simply prints a given string. It's an improved snippet that combines some recommendations given in my post on string helper functions.
...
6
votes
2
answers
528
views
String helper functions in NASM Win16 Assembly
Environment
NASM is required to build this program, and DosBox is required to run it. I'd recommend installing these using the Scoop Package Manager. Feel free to ignore install statements for any ...
7
votes
1
answer
1k
views
Tower of Hanoi in NASM Win64 Assembly
This program is an implementation of the classic puzzle Tower of Hanoi! This is my first mostly recursive Assembly program. Any advice and all topical comments on code optimization and conventions is ...
24
votes
3
answers
7k
views
Checking if a number is prime in NASM Win64 Assembly
I'm just learning Assembly. This program is a simple attempt to determine if a given number is prime or not.
Compiled as follows using VS2019 x64 Native Tools Command Prompt:
...