Assembly Language Square Values
What would be the most efficient way to take an input 'x' and find the respective 'x^2' (of which is stored in another variable) with only the basic assembly operators? (Add, Sub, Store, etc.)
See also questions close to this topic
Print prime numbers with NASM
I am struggling (don't even know where to begin) with an exercise for a class, printing the prime numbers under 200 using NASM and intel 32, where i have to check only odd numbers wether the are prime or not. It has to start with number 2 and be generated and printed on a new line. I am very bad at NASM and I was wondering if someone could help me out with it
NASM automatically escaping shellcode initialized in .data
I am attempting to write a piece of assembly code which will perform operations on some shell code I have initialized in .data
My initialization is as as follows:
section .data shellcode: db "\x31\xc9\xf7\xe1\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xb0\x0b\xcd\x80", 0
When I attempt to load the array holding the shell code into a register, it is automatically escaped, breaking my program:
I assembled and linked as follows:
nasm -f elf32 -g encryptor_assembly.asm -o encryptor_assembly.o gcc -m32 -g encryptor_assembly.o -o encryptor_assembly
Is there a way to avoid this from happening? Thanks for your help.
Draw 1bpp Image using x86 Assembly
How do I draw a 5x8, 1bpp image using x86 Assembly?
- Windows 10 x64 (so no NTVDM)
And the code is available at: https://gist.github.com/iProgramMC/61d8aee14020a8ee045d486b85ba4b24
What I want to achieve:
Draw a 1bpp image on the screen at an arbitrary position, represented by 5 bytes (each column coresponds to 1 byte).
My current approach either freezes out or does nothing.
I'm open to suggestions.
Using LMC to solve algebraic equations
I am getting stuck on writing a program for the following, help would be appreciated. a_squared + (b x c). There appears to be a problem with my loops, but i cannot solve it. Can do a_squared and multiplication, but when I try to combine the 2 it just keeps asking for inputs over and over again.
I have a homework problem that wants me to emulate a traffic light system
My question is, how do I keep track of the on/off status of the lights? This class isn't about Assembly languages, it just uses it to show how a CPU and Memory work, so the support for this sort of problem is scant. Would appreciate a push in the right direction.
LMC program to check if a number is a Fibonancci number based on the formula (5*n2 + 4) or (5*n2 – 4)
Please help. I am really stuck with this question. I need to write a Little Man Computer program to check if a number is a Fibonacci number. I know to print the Fibonacci sequence on LMC but I just cannot work out how to check if a number is Fibonacci. Any advice will be hugely appreciated. Thank you