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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
33 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 ...
user avatar
6 votes
1 answer
178 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 ...
user avatar
  • 63
4 votes
2 answers
536 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 ...
user avatar
  • 403
1 vote
1 answer
73 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 ...
user avatar
  • 403
6 votes
1 answer
239 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 ...
user avatar
4 votes
2 answers
199 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. ...
user avatar
  • 403
2 votes
2 answers
106 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 ...
user avatar
  • 63
5 votes
1 answer
88 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 ...
user avatar
5 votes
0 answers
58 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 ...
user avatar
3 votes
1 answer
201 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 ...
user avatar
2 votes
1 answer
527 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 ...
user avatar
  • 123
5 votes
1 answer
1k 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 ...
user avatar
3 votes
1 answer
55 views

Key-scanning macro in NASM Win16 against DOSBOX (Intel 8086)

Supports backspacing, but not wrapped backspacing. ...
user avatar
  • 2,907
6 votes
1 answer
200 views

Multitasking in NASM Win16 Assembly

Requirements (Installed using Scoop) scoop install nasm dosbox Build (Using NASM) nasm -g tasks.asm -o tasks.com ...
user avatar
  • 2,907
4 votes
1 answer
682 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. ...
user avatar
  • 2,907
6 votes
2 answers
423 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 ...
user avatar
  • 2,907
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 ...
user avatar
  • 2,907
24 votes
3 answers
6k 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: ...
user avatar
  • 2,907