Click here to Skip to main content
15,884,043 members
Everything / Programming Languages / ASM

ASM

ASM

Great Reads

by codestarman
X86/ARM emulator written using C++ and assembler for the .NET environment.
by Ryan Scott White
CudaPAD is a PTX/SASS viewer for NVIDIA Cuda kernels and provides an on-the-fly view of your Cuda code.
by Dr. Song Li
This is a note on how compilers implement function calls to pass the parameters to and get the return value from the called functions.
by Jose A Pascoa
Rolling up a practical solution

Latest Articles

by shunninghuang
C# arcade emulator, ROM hacking
by Jonathan Chapman-Moore
How to build Microsoft Disk Operating System 1.25
by Dr. Song Li
This is a note on how compilers implement function calls to pass the parameters to and get the return value from the called functions.
by Sarthak S
Assembly inspection and hacking with windbg

All Articles

Sort by Updated

ASM 

18 Feb 2024 by shunninghuang
C# arcade emulator, ROM hacking
15 Feb 2024 by Jonathan Chapman-Moore
How to build Microsoft Disk Operating System 1.25
30 Oct 2023 by Kinke Kabingila
By the way, this is 64 bits version of your program. It will work only on Windows because Windows and Linux 64 bits assembly have different calling convention. In addition, Windows requires shadow space on stack before calling another function. ...
24 Oct 2023 by Shobhit_23
I am trying to use subroutine calls using msvc inline assembly. This is the code: int main() { int a = 4, b = 2, c = 1; __asm { LOC_FUN: mov eax, 6 mov ebx, 21 mov ecx, 32 ret MAIN : xor eax, eax xor ebx, ebx xor ecx, ecx...
21 Oct 2023 by OriginalGriff
First off, you don't need to clear eax, ebx, or ecx - your function always overwrites what is there so it's irrelevant what they contain on entry. Secondly, your assembly code is within a function body, so the assembler label LOC_FUN just marks...
28 Jun 2023 by Dr. Song Li
This is a note on how compilers implement function calls to pass the parameters to and get the return value from the called functions.
21 Jun 2023 by terrable
I have a project that I've been struggling with. Half of my program works and the other half doesn't but there aren't any errors.Process A and B work but C D AND E do not. Can someone please help me. Here is what i'm trying to doPerformance RequirementsWrite a program that will perform...
19 Jun 2023 by Rick York
There are lots and lots of tutorials available. Here are some : assembly language at DuckDuckGo[^]
19 Jun 2023 by musab ahmed 2023
Using two file select registers, Write a program in assembly language to copy a block of 12 bytes of data from RAM locations starting at 044h to RAM locations starting at 062h. After each instruction, write a comment that explains clearly what...
19 Jun 2023 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
19 Jun 2023 by Richard MacCutchan
This assignment is given to you in order to test your understanding of what you have been taught. Not in order to test the abilities of people on this forum. If you need specific help then use the Improve question link above, and add complete...
31 May 2023 by Sarthak S
Assembly inspection and hacking with windbg
7 May 2023 by WOLF 2018
So I have been working on learning the windows low end side of thing and I created some asm to access the peb without using any library's. This is because my project has /NODEFAULTLIB on and no inputs in Visual Studio So my project is about...
7 May 2023 by merano99
As Richard already pointed out, there are quite a few Windows system calls in the rest of the code and it would certainly be possible to get the pointer without assembler, but if you really want to, you can do it with VisualStudio and assembler. ...
6 May 2023 by Richard MacCutchan
Why not use the features provided: NtQueryInformationProcess function (winternl.h) - Win32 apps | Microsoft Learn[^] ?
18 Apr 2023 by InvisibleMedia
This article describes how to divide two polynomials and shows the source code to calculate this division. There is also code to add, subtract and multiply two polynomials.
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...
16 Apr 2023 by OriginalGriff
Assembling without error does not mean your code is right! :laugh: Think of the development process as writing an email: assembling successfully means that you wrote the email in the right language - English, rather than German for example - not...
12 Apr 2023 by User 13703492
Hi all Does anyone if it is possible to convert C source code into 16-bit 8086 assembly (for use with EMU8086)? Thanks What I have tried: Tried using the assembly code emitted by Visual Studio but it is 32-bit and won't work.
4 Apr 2023 by Tough Developer
How to power off a computer using ACPI from DOS
28 Mar 2023 by Ryan Scott White
CudaPAD is a PTX/SASS viewer for NVIDIA Cuda kernels and provides an on-the-fly view of your Cuda code.
25 Dec 2022 by InvisibleMedia
This article is written right after a new conversation with ChatGPT (chat.openai.com). This conversation is the next step in writing a new algorithm that sorts numbers into o(n). And, ChatGPT says that it is possible to compute a sorting algorithm to have the complexity in o(n).
24 Nov 2022 by Richard MacCutchan
It looks like you have created a 64-bit object module from the assembly code. And you hve created a 32-bit module from the C code. When you try to link the two the addresses in the assembly portion are too long. Change the assembler to generate...
24 Nov 2022 by CodeSie Programming
This is the assembly: extern printf global hello section .text hello: push message call printf add esp, 8 ret section .data message: db 'Hello, World', 10, 0 And calling: nasm -f...
24 Nov 2022 by Rick York
Try this : db 'Hello, World', 12, 0 I am guessing the problem is the string is twelve characters long, not ten.
23 Nov 2022 by CodeSie Programming
I am using NASM on Windows, and was following a tutorial. maxofthree.asm: global _maxofthree section .text _maxofthree: mov eax, [esp+4] mov ecx, [esp+8] mov edx, [esp+12] cmp eax, ecx cmovl ...
23 Nov 2022 by k5054
your subroutine in asm file is _maxofthree, but your C program is looking for maxofthree, with no leading underscore. You should be able to get a clean link if you change the name of one or the other.
8 Oct 2022 by reverser69
hi all i want to do an inline asm and i want to see if a given location of memory is non-writable-executable code or its writable data; if its data, skip the overwrite. i want to do it in pure asm + win api. i partially achieved it by checking...
8 Oct 2022 by merano99
Access to main memory is usually realized with an MMU. Since the MMU is a critical resource, the operating system takes care of it. Access to the MMU requires operating system rights and good hardware knowledge. If you had access to the MMU, you...
30 Sep 2022 by Yount_0701
#define multi_max(a,b,c) (c)=(a>b)?(a):(b) int __fastcall multiparam_fastcall(int a,int b,int c,int d,int e,int f,int g,int h,int i,int j,int k,int l,int m) { int tmp1=(a>b)?a:b; multi_max(tmp1,c,tmp1); multi_max(tmp1,d,tmp1); ...
11 Jul 2022 by merano99
first sol : - This is x86 assembler, known as "mov ax,data". (Probably from the DOS days, which you can see from "int 0x21".) second sol : - This is the ARM instruction set, as you can see from "mov r0, r3". third sol and 4th sol : - This...
11 Jul 2022 by Hamza Abd
the problem is: In this Question , you need to implement a simple encryption and decryption algorithm in ARM assembly. Given a text message (string) stored in the memory, the encryption program gets the ASCII code of each character and apply...
10 Jul 2022 by OriginalGriff
Quote: I am sorry for my bad question .. but I really don't know where or how to ask since I have to solve this question but I don't know anything about the language because they just teach us theory classes and I don't have time to study it ... ...
1 Jul 2022 by Michael Chourdakis
Try deep CPU features
22 Jun 2022 by reverser69
hi after searching for a month or two, I finally found out the solution: in x86 code, APIs must be prefixed with underscore and called by their decorated name. e.ge i must call like: calll _MessageBoxA@16 16 being the number of bytes of the...
22 Jun 2022 by reverser69
hi after solving my problem that i had here [^], now, i have another question and that's how can i find all decorated API names or is there a function that returns the decorated name of an API. What I have tried: googling trying some functions...
22 Jun 2022 by merano99
The export with dumpbin works with User32.Lib as well as libuser32.a. The function MessageBox is included in both, but in the VS version in the User32.Lib with underscore and with gcc in libuser32.a without underscore. In addition, the functions...
21 Jun 2022 by Richard MacCutchan
The DUMPBIN Reference | Microsoft Docs[^] utility can do it for you.
21 Jun 2022 by reverser69
hi all i want to learn asm inlining using codeblocks+GCC(MinGW32) and i came across this problem. this is my code: #include #include #include char * msg = "Hello, World!\n"; char * wMsg = "Content of the...
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
The simplest multiple precision sum algorithm
9 Apr 2022 by Student1122
Implement a Mano Basic Computer assembly program to copy ArrayA of length 10 bytes to ArrayB of same length in the RAM memory of the Mano Basic Computer main memory. During the moving process, the program must clip the values between 100 and...
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: ;...
21 Dec 2021 by OriginalGriff
"It doesn't work" is probably the most useless problem report we get - and we get it a lot. It tells us nothing about what is happening, or when it happens. So tell us what it is doing that you didn't expect, or not doing that you did. Tell us...
10 Dec 2021 by Stukeley
Hello, I have an issue with my C# code that calls an external procedure written in x64 ASM. [DllImport("...", CallingConvention = CallingConvention.StdCall)] public static extern IntPtr ApplyFilterToImageFragmentAsm(IntPtr bitmapBytes, int...
10 Dec 2021 by Richard Deeming
As I suspected, the problem is that your unmanaged code is running outside of the fixed blocks, so the CLR is free to move the memory around. The pointer you pass in will be pointing to the wrong thing. Since you can't await inside a fixed...
4 Dec 2021 by Oso Oluwafemi Ebenezer
Trying my hands out in the world of assembly and will like to ask some few questions about FASM before I waste my time and sanity in learning it.1. I read that FASM can output COFF .obj file. Can this .obj file be linked together with other .obj files generated from other programs like GoRC...
4 Dec 2021 by OriginalGriff
Personally, I have never even heard of FASM - I don't even know what processor it targets! I can find out with Google, but ... that's irrelevant, because it's indicative of the problem: this isn't a FASM support site, and it's very unlikely that...
4 Dec 2021 by Shao Voon Wong
Guess what these assembly instructions with the same source and destination operands do?
27 Oct 2021 by Jeson 2021
So, did caeser cipher, but I have problem on string 68 What I have tried: ’’’ IDEAL MODEL small STACK 100h DATASEG MSG1 DB 'ENTER FIVE CHARACTER : $' MSG2 DB 10,13,'RESULT : $' ARR1 DB 5 DUP (00) ARR2 DB 5 DUP (00),'$' CODESEG start: MACRO...
27 Oct 2021 by OriginalGriff
Getting your code to assemble is not the end of the process: it is followed by testing and debugging (and normally this proceeds in a loop: code, test, debug, re-code, re-tect, debug again, ...). So now you have reached the next stage - you have...
23 Oct 2021 by OriginalGriff
Quote: I have reformulated the question Quote: I need project for tasm and i dont no how write it So you haven't tried at all? While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for...
20 Oct 2021 by merano99
You can set compiler flags and get an assembly output. If you also set the debug info flag, comments are also displayed. The code would be greatly simplified if you use C instead of C ++ as the basis.
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...
20 Oct 2021 by Hamza Javed
Hi,i'm writing a program that prompts the user to enter two binary numbers of up to 8 digits each, and print their sum on the next line in binary. If the user enters an illegal character, he or she should be prompted to begin again. Each input ends with a carriage return. i wanna know how to...
20 Oct 2021 by OriginalGriff
Recursion is recursion: it doesn't matter what language you write it in, it's the same process. All you need to do is write a subroutine (a label that you can CALL and which will hits a RETURN instruction at some point, and have it call itself...
20 Sep 2021 by Carles Cortés
Macros to help assembler programmers to improve source code (continued)
9 Sep 2021 by Carles Cortés
Macros to help assembler programmers to improve source code
10 Jun 2021 by OriginalGriff
If you don't understand it, how did you write it? Do you have any idea how much work explaining code line by line is? Every single line needs a paragraph of explanation! For example: CMP AL, "e" Compare the content of the AL...
3 Jun 2021 by matr095
Is it possible to display pixels to the screen or play a beep in the speakers to screen in ASM language, without using BIOS/DOR/... interrupts ? What I have tried: I found that I can display pixel passing elems to registers and then call...
3 Jun 2021 by CPallini
You could find this page interesting ms dos - How to write directly to video memory in MS-DOS? - Retrocomputing Stack Exchange[^].
28 May 2021 by Darji Nirali
Hello Guys Help me error is: android.database.sqlite.SQLiteException: no such table: employees (code 1 SQLITE_ERROR): , while compiling: INSERT INTO employees (name, department, joiningdate, salary) VALUES (?, ?, ?, ?); What I...
28 May 2021 by Richard Deeming
Quote: no such table: employees You are trying to INSERT into a table which does not exist. The code fragment you've shown is not the code which is generating the error. Debug your code to find out why your createEmployeeTable method is not...
11 May 2021 by Octavio Sanchez Huerta
Building a robotic arm with 4 degress of freedom using PIC16F628A and Servo's
11 May 2021 by Vee Jay Recana
Hi Everyone, can you help me in getting the remainder and the quotient and display it together? I really don't know how to code it in assembly language as I'm a beginner. In the code below, I created a program that will add two numbers and...
11 May 2021 by Richard MacCutchan
Why have you reposted this question? I already gave you some suggestions at Program to calculate base 7 to base 9 in assembly language[^].
11 May 2021 by OriginalGriff
Quote: ... can you help me in getting the remainder and the quotient and display it together? I really don't know how to code it in assembly language as I'm a beginner. And that's the point: that you learn how to do it, by applying what you have...
11 May 2021 by Vee Jay Recana
I have a project that I need to create a program in assembly language that will perform addition, subtraction, multiplication and division of base 7 to base 9. I have no idea on this as I'm a beginner in assembly language. My main problem on this...
11 May 2021 by Richard MacCutchan
See x86 instruction listings - Wikipedia[^].
2 May 2021 by Michael Chourdakis
All in one: x86, x64, Virtualization, multiple cores, along with new additions
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...
28 Dec 2020 by CPallini
Fast integer square root computation in 8051 assembly
20 Dec 2020 by Richard MacCutchan
_hell: mov rax,1 mov rdi,1 mov rsi,hell mov rdx,6 syscall ret You jump into this code from _start. After the syscall you then do a ret, but you have nowhere to return to since this code was not called as a subroutine. You need to use a call...
20 Dec 2020 by Patrice T
Quote: I have no clue why I am getting this error.Why is it giving the Segmentation fault (core dumped) error and how to fix it? I fear you need to go to debugger, and for 'core dumped' I think it is postmortem debugger. The first thing you will...
20 Dec 2020 by Dev Parzival
section .data hell db "Hello",10 bye db "Bye",10 section .text global _start _start: mov r10,1 cmp r10,1 je _hell cmp r10,0 jne _bye mov rax,60 mov rdi,0 syscall _hell: mov rax,1 mov rdi,1 mov rsi,hell mov rdx,6 syscall ret _bye: mov rax,1...
3 Apr 2020 by Nabiev Anush
I use another way how to find max value in array. I used MS Visual Studio. include define LEN 6 using namespace std; int task1(); int main() { cout
3 Apr 2020 by Nabiev Anush
Hi, I have some problem when I'm using 'asm' in C++. I need to find max value in array, I wrote the code but it doesn't compare. What I have tried: void func1(int x[],int lenght){ // Find MAX int max, z = x[0]; //Make first elem is...
26 Mar 2020 by Richard MacCutchan
loop L3 mov ecx , count loop L1 call dumpregs main endp end main You are missing loop L2
26 Mar 2020 by Member 14784282
Include Irvine32.inc .data count dword ? string byte 0ah , "it is internal loop",0ah,0 string1 byte 0ah , "it is middle loop",0ah,0 string2 byte 0ah , "it is external loop",0ah,0 .code main PROC mov ebx,0 mov ecx,3 ;external loop value L1: mov...
26 Mar 2020 by CPallini
That's assembly code, not C++. And you may run it yourself: there are tutorials available on using the Irvine32 library.
25 Mar 2020 by steveb
Totally compiler dependent. Your case seems like the GCC. In MSVC it will be more like: __asm { mov al, 2 mov dx, 0xD007 out dx, al };
18 Mar 2020 by AshakiranBhatter
Hi,I am trying to learn ASM programming on MS-DOS to get a string from User.But during the run-time it reboots the OS automatically or hangs or misbehaves while the same program is executed on Windows-XP it does not give any run-time errors.Could you please help me in this regards as to...
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...
5 Mar 2020 by Richard MacCutchan
There are links at GitHub - asmjit/asmjit: Complete x86/x64 JIT and AOT Assembler for C++[^] to the blog and chat spaces, so you would probably get better information there.
15 Feb 2020 by zahlambo
.MODEL SMALL .STACK 50H .DATA NL DB 0DH, 0AH, '$' ; NL = NEXT LINE .CODE MAIN PROC MOV AX, @DATA MOV DS, AX MOV CX, 5 MOV BX, 1 FOR_1: PUSH CX MOV DL, 20H ; 20H IS ASCII CODE FOR SPACE ...
15 Feb 2020 by amn.bassam
" - " ; mean Spacen=3--*-*****n= 5----*---**--***-*********
17 Dec 2019 by Alexandre Bencz
With this new OrangeC/C++ compiler back-end, you can compile your C code to .NET
14 Dec 2019 by Alexandre Bencz
With this new OrangeC/C++ compiler back-end, you can compile your C code to .NET.
20 Nov 2019 by Jeremy Likness
Blazor and WebAssembly examples (part of a Blazor presentation)
14 Nov 2019 by CPallini
An assembly implementation of the AES-128 cipher algorithm for the 8051 microcontroller
6 Nov 2019 by Member 11004573
Hello Everyone!i am Trying to Sort The Array In Descending Order In Assembly Language But i Got Still Two Error 1:**Error** Array123.asm(12) Relative jump out of range by 007Fh bytes2:**Error** Array123.asm(119) Relative jump out of range by 0080h bytesBoth Error About the Loop...
5 Jun 2019 by altomaltes
This code calculates square root of an integer on a few assembler code lines.
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.
23 Apr 2019 by Member 13737597
This article shows how to automatically catch memory access (read /write) for some memory region and log these changes into file
11 Apr 2019 by Jose A Pascoa
Although most Windows programmers have already used the RichEdit Control, many of them are not aware of all its capabilities. One such capability is image embedding.
10 Apr 2019 by Rob Philpott
Here's a short program.... int main() { _asm { push al; pop al; pop al; }; return 0; } which doesn't do much but it works. But I don't think it should, as I push 'al' onto the stack then try and pull it off twice, hence knackered stack. It seems that the push is actually moving...
10 Apr 2019 by Patrice T
Quote: It seems that the push is actually moving the stack pointer by 4 bytes, whereas the pop is only moving it back by 2, yet the register is supposed to be a single byte, the lower half of a 16bit thing. What's going on? al register is 1 byte, so push and pop are moving stack pointer 1 byte....
10 Apr 2019 by OriginalGriff
Popping the value off an empty stack doesn't necessarily do anything "bad", it just retrieves a value at an address, and decrements the pointer. It's only if that address is outside the memory space for the process that you will get an error. In theory, you could get a problem from the "return...