Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [assembly]

An assembly language is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture's machine code instructions.

1
vote
1answer
58 views

X86-16 Function 01 -> Change destination and/or display pages

This code is intended to be included with X86-16 writing ASCIIZ strings directly to video and is dependent upon some of the declarations in that code. When combined with that code a string declared @ ...
12
votes
0answers
134 views

Multiplying big numbers using Karatsuba's method

The Karatsuba algorithm, first published in 1962, aims to speed up the multiplication of big numbers by reducing the number of 'single-digit-multiplications' involved. Because of its complexity (...
11
votes
0answers
145 views

Signed integer-to-ascii x86_64 assembler macro

I have implemented an algorithm which converts a signed integer to its ASCII equivalent string with the corresponding sign as a first byte. I have tested it on several numbers and it worked correctly. ...
5
votes
0answers
413 views

8-bit AVR delay using TIMER0 (8-bit)

Using an Atmega328P clocked externally @ 16 MHz, this procedure is analogous to delay routines that use instructions to consume clock cycles. The intent of this algorithm is not to advocate any ...
4
votes
0answers
69 views

Collatz Conjecture Disprover Unit - Googol Edition

The Wikipedia article about the Collatz Conjecture has these quotes: If the conjecture is false, it can only be because there is some starting number which gives rise to a sequence that does not ...
4
votes
0answers
250 views

Finding the length of arbitrary ASCII character strings

I have implemented this MIPS code to determine the length of given ASCII character strings. Is there a simpler way to implement this code? Is there is a built-in function in MIPS? Given String: ...
4
votes
0answers
106 views

Parallel popcount of packed bytes

I want to do a popcount of bytes in an array. Not a total popcount of everything, but lots of little popcounts for every individual byte to determine the neighborhood count in GoL. The following ...
3
votes
0answers
180 views

Implementing binary-heap in x86-64 assembly

I'm trying to implement some of the simplest classical data-structures in x86-64 assembly on linux. PRIMARY GOAL: Reduce memory consumption and increase performance (maybe using x86-64 architecture ...
3
votes
0answers
95 views

Rotate lit LEDs on a 7-segment display

I have written some Assembly code for an assignment, that has me activating the outer bounds of a 7-segment display. The toggle is every time there is a state change, so both when I flick a switch, ...
3
votes
0answers
78 views

FizzBuzz - A quartet of solutions

Since the FizzBuzz challenge is about developing ideas, I've added a third test case for which I chose divisibility by 7 and its accompanying tag "Go". This tag was purposely given a length other ...
3
votes
0answers
33 views

Using STORAGE macro using QSAM for input/output

I was wondering if you can help me out. I wanted to know if there is an easier way to do the following. My code works but I feel like there is a lot things going out with multiple loops and wanted to ...
3
votes
0answers
126 views

Porting x86 assembly that is used to increment a value

I'm working on a port of some existing inline x86_64 assembly code to AArch64 compatible assembly and would appreciate the feedback. I'll post below the original x86 and my ported AArch64 code. The ...
2
votes
0answers
70 views

x64 Windows Assembly - Structs in Assembly

I'm trying to code a simple person database using structs and arrays in assembly. Each person has a firstName, lastName, ...
2
votes
0answers
2k views

Bubble sort using user inputted numbers and size in MIPS assembly

I made this code to take user input, making a specific-sized array and printing user-inputted numbers after being sorted. It works well but I was wondering if there was a way to "shrink" it down. It ...
2
votes
0answers
33 views

Write 16x16 bitmap to frame buffer

The following code writes a 16x16 bitmap to a framebuffer using up to AVX2 instuctions. I'm sure it can be improved with AVX512 ...
2
votes
0answers
45 views

X86-16 writing ASCIIZ strings directly to video

While developing my OS, I decided there was a need to be more verbose about what was happening in real-mode. The idea of embedding non-printable characters in an ASCII string was born from knowledge ...
2
votes
0answers
42 views

String to long double conversion using FBLD

I always wanted to try fbld x87 instruction to aid to convert string to floating point value. I sure a chance to face this instruction in disassembly of all the ...
2
votes
0answers
30 views

Generic prologue/epilogue for interrupt driven Atmega328P system

My thinking is that with every application, there are a few fundamentals indicative of all interrupt driven systems. Contrary to popular opinion, assembly programs can be as maintainable as HLL's, ...
2
votes
0answers
361 views

Computing the square root of a number using binary search

This is implemented in MIPS assembly. I've hard-coded the initial guess, as I haven't figured out how to allow the user to input a negative or non-negative integer to then display the result back to ...
2
votes
0answers
751 views

A clock program in MIPS assembly that start ticking from 59:58

This is an assignment, a clock program which use MARS simulator, it starts ticking from 59:58. In this assignment I have implemented three functions ...
2
votes
0answers
69 views

Benchmarking function variations

I'm trying to benchmark two variations of one of my functions. Namely, these functions are for displaying integer values on the command line. The first of these uses my own implementation and prints ...
1
vote
0answers
15 views

Swapping variable length strings asynchronously with connected microcontroller (Byte-banging)

I have an AT89S52 and an AT89C4051 microcontroller (both in the 8052 family) in which the bit lines of the data bus, one control pin and one status pin are connected together. In code, the data bus is ...
1
vote
0answers
448 views

MIPS Assembly Program to access elements in the 4x4 matrix, row or column-major oder

This MIPS Assembly program will make you access the elements in the 4x4 matrix in either row or column-major order i.e. accessing all elements row by row or column by column. Output is posted below ...
1
vote
0answers
4k views

MIPS even or odd detection program

I am learning MIPS as a part of my Computer Organization class at school and I am writing a simple program that reads in a positive integer from the user and tells the user whether the number is even ...
1
vote
0answers
265 views

Assembly Language (AVR) Button Scanning/Debouncing Routine

So, I'm very new to assembly language programming for microcontrollers. I'm using an AVR XMega A3BU X-plained board, and I've got a program where I need to interface with 7 buttons. 3 of them are on ...
1
vote
0answers
18 views

Real-time timekeeping logic for ATmega16A

As part of a clock I'm building based on an ATmega16A, I wrote some assembly code to handle setting up the timer for a 32.768kHz crystal and handle second/minute/hour/day updates. Here are the ...
1
vote
0answers
85 views

Sending data from UART to microcontroller via AT89C2051 functioning as a UART/SPI bridge

I have an unusual setup. I have an AT89S52 microcontroller in which its UART is used by the PC. I needed a way to make a second UART based device work with it, so what I decided to do was make a UART ...
1
vote
0answers
49 views

RFID card reader validation routine in 8051 assembly

I came up with the following code to check to see if the last 2 bytes of a 12-byte value read in from a RDM6300 card reader is actually the checksum of the first 10 bytes. ...
1
vote
0answers
52 views

Legacy boot E820 entries written to low memory

In another post of mine, there was some discussion about a small area just above (see end of page @) BDA (500H - 534H) that handles DOS print screen. As not to ...
1
vote
0answers
58 views

The ubiquitous blink program on ATmega328P

Although there is a blinking LED, the way this comes about is quite a bit different. This could be called a dead man's switch because as long as you're holding the button down, the blinking doesn't ...
1
vote
0answers
2k views

Nand2Tetris Hack Assembler

Now I know the same type of question (same task) has been asked on this site before, but I recently wrote my C++ implementation of the Hack Assembler from the Nand2Tetris Chapter 6 course (defined ...
1
vote
0answers
256 views

Interpreter for an assembly language with variadic instructions

I am currently implementing a virtual machine that runs a programming language similar to assembly. The difference is that an instruction in this language can have any number of operands. and the ...
0
votes
0answers
202 views

64 bit binary to ASCIIZ conversion using NASM on Ubuntu 16.04

In addition to a review, if anyone would be inclinded to put this app through its paces, that would be appreciated Preamble & supporting subroutines ...