Click here to Skip to main content
15,888,579 members
Everything / Programming Languages / Assembler

Assembler

assembler

Great Reads

by CMalcheski
How to Create a Complete DirectX Game in Assembly Language
by Chris Boss
Why some prefer the BASIC language over others
by leon de boer
Introducing SmartStart something like a BIOS for the Pi
by Gregory Morse
UTM based on mov is Turing-complete paper x86 and x86-64

Latest Articles

by Jonathan Chapman-Moore
How to build Microsoft Disk Operating System 1.25
by Tasos Kipriotis
A quicker way to calculate the partial sum of binomial coefficients
by Andrea Simonassi
A simple subtraction algorithm for multiple precision arithmetic
by Andrea Simonassi
Showing algorithms and code used on this article series

All Articles

Sort by Updated

Assembler 

20 Jun 2015 by 0xF4
I put my question all wrong earlier, allow me to explain.I am struggling to write an assember for x86 processors. The x86 instruction set has different opcodes for the same instructions based on the operand sizes. What I want to know is that given a statement 'mov eax, 123' how do I figure out...
9 Jul 2015 by 0xF4
I have a major doubt it would be good if it is cleared.I am just writing what I know, please correct me if I am wrong.A 32bit register can hold 32bits or 4 bytes of data only, but when I write and execute the statement msg db 'Hello, world!',0xamov ecx,msgHow is it that it is...
9 Jun 2020 by A. B. Dinshaa
What do assembly language command: ADD AC, 001(MQ) when executed do? What is its addressing mode? What I have tried: In jupyter notebook when run this command after importing assembly it is constantly giving syntax error. I am not able to...
13 Aug 2019 by Advik Raj
According to my logic, I think it is possible to convert one language to another, without a transpiler. C code: #include int main(){ printf("Hello, world!"); return 0; } 1. I have converted C code into Assembly code using MinGW (GDB) in CMD. This C program is a simple Hello-World...
14 Aug 2019 by Advik Raj
so, I have this asm code with me and i wish to use it inline with c++, (a combo of asm and cpp) i have seen many links for this but none answer how to do this, the asm code is below .text .def ___main; .scl 2; .type 32; .endef .section .rdata,"dr" LC0:
27 Feb 2023 by Advik Raj
Self-explanatory. How does this work? I have a piece of assembly code, which I derived from another C code, using the MinGW compiler, and CMD. (Please do not ask why I derived it.) My goal is to convert this assembly code to C/C++ code, with the use of any application, like a decompiler? What...
12 Jul 2021 by Ahmet Furkan Sahin
write this program in MSP430 language : a- there is an array containing the average grades of 32 students which starts at the address 0x200 write a main program that converts the average grades to the letter grades using a LETTER...
28 Mar 2021 by Alessandro Dima
I am new to assembly and I have to write this program. The title says: Write a program in assembly 8086 language that ask the user to input a number. If the character read is '0' it executes a + 3, otherwise if it is '1' it executes a-3...
1 Nov 2018 by Alexander Eremeev
The Windows kernel-hacking library and development framework written on C++17
5 Jun 2019 by altomaltes
This code calculates square root of an integer on a few assembler code lines.
29 Oct 2015 by amin.j
I would like to ask how I can declare a string variable without initialization in MIPS assembly?for example:string judge;
30 Oct 2015 by amin.j
I want to write this code: y= 0.4*x+1 but I have some errors in MIPS assembly[Edit - Added from comment]I have an integer value in register $t1 and I want to multiply it with 0.4 but it has error in the second line:li.s $f0, 0.4mul.d $f1, $f0, $t1mfhi...
30 Oct 2015 by amin.j
I would like to ask how I can do floor and ceil functions in MIPS assembly??
9 Nov 2023 by Andre Oosthuizen
Hi Mike, great to see you on the Q&A side of the world for a change :)... I am not at all familiar with ZMAC at all and took the "easy but stupid" way out, sometimes it helps, sometimes it is a waste of time, your choice to try it - I have asked...
11 Jun 2022 by Andrea Simonassi
The simplest multiple precision sum algorithm
11 Jun 2022 by Andrea Simonassi
A simple subtraction algorithm for multiple precision arithmetic
11 Jun 2022 by Andrea Simonassi
The first and simplest of the multiplication algorithms, fast enough to multiply not too large numbers
11 Jun 2022 by Andrea Simonassi
Showing algorithms and code used on this article series
24 Dec 2015 by Andreas Gieriet
A simple task scheduler?A memory pool memory manager?A fixed-point arithmetic library, e.g. for add/sub/mul/div?A device driver for an SPI connected device?...CheersAndi
15 May 2016 by Anton Angelov
Describes how to improve even further the behaviours design pattern tests through new base classes and usage of Unity IoC container.
16 Sep 2023 by Atonix0
Fixed it by directly storing results in W1 like this add W1, W2, W3 Instead of add w3, w2, W3 str W3, [X1]
15 Sep 2023 by Atonix0
I am using GNU Assembler and I am trying to learn aarch64 assembly by making a simple calculator, I cannot store the result value inside a data called results .global main .section .data debug_msg1: .asciz "True" debug_msg1_len = . -...
9 Apr 2015 by BacchusBeale
One algorithm would be get integers A and B.make power be P=1while A is not zeroP= P times BA = A - 1print P
20 Oct 2021 by BeatsClub
windows32 assembly language recursive procedure. accept, from the user, an integer greater than 0. Guard against invalid values being entered using a loop. call the recurse sub-procedure using the cdecl protocol, receive the results of the...
3 Oct 2020 by Ben Hanson
Back in 1984, I wanted to write a Z80 assembler. At the time, this would have meant coding it in Z80 machine code, but due to the conveniences of modern technology, I have now done it in C++.
25 Oct 2021 by Berserker Knight
Hello everyone, the reason for this post is to see if something can be done regarding this code, what happens is that I cannot delete a file as long as the 3CH function to create it is executed with INT 21H. ;Enter the file name MOV AH, 0AH LEA...
5 Dec 2021 by Birddog112
If the input is a number, it should be converted from a character value to a numeric value and that value should be pushed onto the stack. If the input is either "+" or "-", the top two entries on the stack are to be popped to registers, the...
6 Jul 2021 by Bob Jason Tiamsic
I have a solution in VS2019 that I upgrade the .NET Core version from 1.1 to 2.1 However, I got a bunch of errors that I need to downgrade versions of System.net.socket, primitives and diagnostic tools. Here's one of the errors ...
7 Jul 2021 by Bob Jason Tiamsic
I added this PackageReference NuGet Warning NU1605 | Microsoft Docs[^]
13 Apr 2020 by BuildDrive
Need some help here, can't figure what's wrong. here is the error: LNK2005 "int_cded encryptData(char *,int)" (?encryptData@@YAHPADH@Z) already defined in main.obj LNK2005 "int_cded decrypttData(char *,int)" (?decryptData@@YAHPADH@Z) already...
9 Sep 2021 by Carles Cortés
Macros to help assembler programmers to improve source code
20 Sep 2021 by Carles Cortés
Macros to help assembler programmers to improve source code (continued)
2 Sep 2015 by chandrAN2&
In arm assembly code, I am seeing the below line where "=" is used. what exactly this operator is used in arm. ldr r0, =CONSTANTwhat constant we can use, like any address or a variable which holds the address or a value? shall i use it likeldr r0, =0x5 (5 is a value)...
8 Sep 2015 by chandrAN2&
I am working on a ARM xscale board, where for data abort exception there is an exception handler which is getting executed in the task context. Is this correct?whenever an abort happens,cpu will switch to Abort mode and use a separate stack and the handler will be executed in context similar...
16 Apr 2023 by Chidumebi Belonwu
Write a program in Assembly in Emu8086 language that allows you to enter a four-digit number from the keyboard, determines and displays on the screen: 1) the number formed by permuting the second and third digits of the four digit number...
23 Aug 2018 by Chris Boss
Why some prefer the BASIC language over others
12 Sep 2018 by Chris Boss
A short introduction to using the Powerbasic 6.0 console compiler with the Ontime RTOS-32 embedded operating system
14 Jun 2017 by CMalcheski
Part II - Laying the Foundation for the Migration to Assembly
4 Oct 2017 by CMalcheski
Ditching the slowdowns and applying a little elbow grease can create dramatic speed improvements in GDI image blending.
26 May 2019 by CMalcheski
Part 1 of this article discussed an algorithm for addressing all pixels within a circle with surgical precision, optionally expanded to filling in those pixels as required to create a color wheel; this is part 2 of 2, covering the actual implementation.
8 Jun 2017 by CMalcheski
How to Create a Complete DirectX Game in Assembly Language
10 Jul 2017 by CMalcheski
App Initialization and Main Window Creation
26 Jun 2018 by CMalcheski
A Full DirectX Sample Application Created in Pure Assembly Language
24 Aug 2015 by Coder1999
Hello. I can't find where the Nativewifi reference is in visual studio. Does someone know what reference NativeWifi is part of?
16 Jan 2018 by codestarman
This project describes an X86 assembler IDE for the MAC developed using JavaFX. The starting point was an X86 emulator developed by the author in C++, which was subsequently ported to C#.
21 Jun 2015 by CPallini
If you meant 'How could I establish if an int value would fit in a byte?' then the answer is yes, you may do it. A simple approach could be the round-trip:unsigned int a = 0xDEADBEEF; // see the nvr3 commentbool fit_in_a_byte = (a == static_cast(a));
24 Jun 2015 by CPallini
In order to output the number 11 to the display you have to call the interrupt 21h two times, providing the character '1' (that is the value 31h) as dl argument.Generally speaking, in order to ouput (in decimal representation) the content of a 8bit register you have to:divide (integer...
30 Oct 2015 by CPallini
Quote:mul.d $f1, $f0, $t1I guess you have to use a floating point (FPU) register (instead of $t1) as target.
12 May 2018 by CPallini
Did you see this: Is there a C compiler that targets the 8086? - Stack Overflow[^]? You may also choose to translate yourself the C program (if it is a simple one).
3 Dec 2018 by CPallini
Quote: I expected the register $v0 to store 32 (11 + 11 + 10) and $a0 to store 154 (79 + 75). Your assumptions are wrong. addi $v0, $zero, 11 could be written (pseudocode) v0
11 Aug 2019 by CPallini
Of course the best solution would be accessing the original C code form which the assembly was 'derived'. You could also use your assembly code together with other (C) source files, gcc handles both types. The last option is the most difficult, you have to understand what the assembly code does...
13 Aug 2019 by CPallini
Quote: I have converted C code into Assembly code using MinGW (GDB) in CMD. Nope, you didn't convert it. The gcc compiler compiled it to assembly. In any case, while converting a piece of code from a programming language to another, you should know well both of them, in order to fully understand...
18 Nov 2019 by CPallini
Have a look, for instance, at MASM - Arrays - Other Language Tutorials | Dream.In.Code[^].
5 May 2020 by CPallini
You know we will not do your homework for you. The right approach is: try (harder) yourself and post here only specific questions.
21 Oct 2020 by CPallini
The good news is that AVR assembly manuals are freely available at Microchip website: AVR Assembler[^] AVR Instruction Set Manual[^] The ldi and sts instructions look promising.
10 Nov 2020 by CPallini
As mentioned in the requirements, you have to use nested loops. Try, for instance .data InArr: .word 0x0eeeeeee 0xeeeeeeee 0xeeeeeeee 0xeeeeeeee 0xeeeeeeee 0xeeeeeeee 0xeeeeeeee 0xeeeeeeee .text .globl main main: li $s4, 8 # outer loop...
28 Dec 2020 by CPallini
Fast integer square root computation in 8051 assembly
12 Jul 2021 by CPallini
Start reading the MSP430 family documentation, with particular focus on the instruction set reference and assembler manual. Once you know the details of the chip assembly then the task becomes pretty trivial.
15 Sep 2021 by CPallini
Note, you don't have to use the multiplication. You know, the left shift...
27 Jan 2022 by CPallini
For such a task you clearly don't need assembly at all, so, I assume it is homework. In order to fulfill it, you should first gain knowledge of the assembly language featured by your own arduino board (probably AVR, see: AVR Instruction Set...
4 Jan 2021 by Cristina Dijmarescu
Can anyone please convert this C code in Mips for me? I haven't worked with Mips before and I really have no idea how to deal with it. Thanks a lot! #include #include static int aplica(int (*f)(int), int x) { return...
9 Nov 2020 by Cristopher Ureña
The assambly code has to be .exe and need at least 50 lines and a medium complexity, is for a university course What I have tried: I tried to search on internet but i couldn't find examples
24 Aug 2015 by Dave Kreskowiak
There is no assembly to add a reference to. NativeWifi is part of Windows and accessible through P/Invoking the various functions. There is no assembly in the .NET Framework that wraps that functionality.There is, however, a third party wrapper you can use here[^], though it hasn't been...
10 Jun 2016 by Dave Kreskowiak
There is no native syntax highlighting support for ASM in Visual Studio.There is an extension, AsmHighlighter extension[^], but it's not what I would call "production ready" quality. There are other extensions that it doesn't play nice with.
8 Dec 2016 by Dave Kreskowiak
I haven't touched a PDP-11 since 1986. It was obsolete even back then.IIRC, the assembler only looks at the first 6 characters of a label and they ARE case sensitive.Your labels that start with "nextMove..." is where the error is coming from. You've got two labels that start with the...
30 Dec 2017 by Dave Kreskowiak
First, STEP SCREAMING AT EVERYONE! Using all capital letters is the same as yelling at people on the web. Second, you're going to want to find a forum dedicated to AVR programming, like AvrFreaks | Atmel Community[^]. We don't get very much call for AVR questions here and the experience base...
20 Mar 2019 by Dave Kreskowiak
We're not here to do your homework for you.
21 Oct 2020 by Dave Kreskowiak
If you're looking for someone to write the code for you, you've come to the wrong site.
4 Jan 2021 by Dave Kreskowiak
This is not a code conversion service. You have to do the work yourself. It looks like you're going to have to learn MIPS assembly language.
27 Apr 2021 by Dave Kreskowiak
You might want to try forums dedicate to AVR if you're looking for someone to write code for you.
14 Jun 2021 by Dave Kreskowiak
We're not here to do your homework or tests for you.
28 Jun 2016 by David A. Gray
A reference chart that doubles as the engine behind a data structure mapper
3 Aug 2016 by deck_bsd
Hello,Somebody can explain me these lines ?buffer: db 'hello, world'times 64-$+buffer db '_'result : "hello, world____________________________________________________"I understand these lines below, it makes sense (addresse where we stand minus addresse of the beginning of...
11 Jan 2021 by den2k88
Hello, I have a Cortex M3 based SOC and I need to test the response to a RAM ECC error. To do that I would need to simulate the interrupt in some way, problem is it is an internal interrupt, so no pins to drive manually, and apparently there is...
5 Jan 2024 by desanti
I have to cacluate the given expression F= (A+B)^2*C-A on a 0,1,2,3 address machine. I need help for 0 address machine , and if the code for other machines are correct ? What I have tried: 0 address machine Need help ?????? ...
6 Jan 2024 by desanti
Hello ! Let's suppose that we have a stack based processor , 0-address machine. We want to calculate A/B or A-B. So which is the order that arguments should be pushed on stack ? What I have tried: 1. PUSH B PUSH A DIV PUSH A...
13 Jan 2024 by desanti
We assume that the values of the variables A, B, C, D, F are located in the central memory of the computer. All variables are 4 byte integers. Opcodes are 1 byte, except push/pop operations which are 2 bits. Memory addressing is 16 bits and...
26 Oct 2020 by deXo-fan
Hello, Well, the title of this question is perhaps self explanatory, but at the same time I already know the answer to that question is "No". So allow me to elaborate my question and goal a bit. There used to be a 12-byte integer type in C++ a...
5 Mar 2020 by dexter4life
I have this program build before, and exe for windows. There's this function I want to execute when I am done modifying it. I saw a way of calling a function of such using Asmjit. So I am new to this asmjit, and I want to know if it's possible to...
7 Oct 2016 by digital performance
This article shows how to access Windows API with plain x64 assembly programming language (MASM style). It shall also give an overview, how to apply some programming techniques like OOP and multithreading on a low level.
10 Jun 2016 by E.F. Nijboer
The difference is between using the value directly or from memory address.mov esi, OFFSET byteValHere the address of byteVal will be put into register esi (assume 00404000 as in the example)mov al, [esi] ; AL = 10hHere the esi is put between brackets, like [esi], meaning not to use...
23 Apr 2016 by ed welch
How well does XCode's auto vectorization work in practice?
9 Jul 2015 by F-ES Sitecore
msg db "ABC"the above places "ABC" at that memory address and that memory address is labelled as "msg". So if my code is at memory address 10000 then the following assemblymsg db "ABC"NOPwill result in10000 A10002 B10004 C10006 00 (00 being the NOP)Memory address...
14 Oct 2015 by Farhad Reza
Here, we will design a clock frame with Assembly Language and GDI32
6 Dec 2016 by FellippeHeitor
IF Solutions are ok.Bashing BASIC without knowing about QB64 is not ok.QB64 is a modern extended version of the Basic programming language that retains QB4.5/Qbasic compatibility and compiles natively for Windows, Linux and macOS.www.qb64.org
21 Dec 2021 by Firdaus Nandu
can anyone help me fix this program or give any suggestions? a program to calculate the volume of a sphere with the input radius (r) I tried it but it's an error, Eror: when I give input, the program doesn't run thank you What I have tried: ;...
19 Jul 2015 by Frankie-C
OK now it makes a little bit more sense.To write an assembler is not such an easy task, at least to encode correct machine code.In some cases even if a full specified instruction is present there could be more than one legal encoding.Anyway going back to your question consider that in...
24 Sep 2016 by G-MINOR
I'm currently a senior in HS learning QB64... in school. I've only been programming for a several weeks and absolutely love it. Sucks I waited till senior year to take a programming class. Anyway here is my code. It is supposed to input three numbers and then output the largest number in circles...
26 Sep 2016 by G-MINOR
So I had a problem on a hw assignment that told me to print a triangle out of stars.I ended up guessing and checking and pulling out this.DIM LINES AS INTEGERCLSINPUT "How many lines will your triangle be: ", LINESFOR x = 1 TO LINES PRINT FOR y = 1 TO x PRINT...
7 Oct 2016 by G-MINOR
So I have a question for my programming class. Question Below. Cant figure out how to do it. My teacher said to use an array but I don't know how.Write a program which picks 20 random numbers between 10 and 99 inclusive. The numbers are then printed out with all the evens on one line and...
12 Oct 2019 by g0dafk
Let's take for eg. the address 010h and register DS. How can i access their values? I have a function that prints numbers as a binary code ( because that's what i want ). I want to print the content as a binary and decimal code. Leave alone the decimal code, i will figure that out later. How...
26 Sep 2016 by Garth J Lancaster
I would have started on a piece of paper, since you only have 3 variables, LINES, X, YI'm going to use a notation a
7 Oct 2016 by Garth J Lancaster
I'd chuck out the GOTO's and rethink the approach .. what about 1) generating an array of 20 random numbers RANDOMIZE TIMER' Declare an array to hold all the random numbersDim AllNumbers As INTEGER' Generate 20 Random numbers in the correct rangeFOR x = 1 TO 20 z = INT(RND *...
5 Feb 2017 by Gregory Morse
UTM based on mov is Turing-complete paper x86 and x86-64