(1) I wonder if the is register the only place the arithmetic calculation can happen? It looks like: add BYTE PTR [var], 10 — add 10 to
I've been writing assembly on linux for a while and I often find myself in need of including C headers which contain macro, enum and struct definitions (but cle
I'm learning how to use masm using MS's official docs, but there's almost nothing written on the option directive (https://docs.microsoft.com/en-us/cpp/assemble
#include <stdio.h> extern int count(char *string, char c); int main(void) { char s[100]; char c; printf("Enter a string of characters:\n"); scanf
I've been writing some x64 assembly on linux - exactly what it is is not relevant - and I've come across a strange problem. In my assembly code, I've declared p
What exactly is Program Segment Prefix (PSP)? I searched in Google but couldn't find any clean and straight answers to help me completely understand it. What d
#include <stdio.h> #include <iostream> #include <string> #include <chrono> #include <memory> #include <cstdlib> #include <
I downloaded a modification for a 20+ year old game I play, which is written in assembly code. It adds a fog effect, and then varies the grip levels based on th
Our internal program is written in C and makes extensive use of snprintf() for many pieces, and I noticed that during debugging with perf record/report, it's sp
I'm taking a course on computer structure and I'm lost. I was given the following file: Hello.s: #This is a simple "Hello World!" program .section .rodat
I was reading this article " assembly-challenge-jump-to-a-non-relative-address-without-using-registers ". I need to do exactly what he suggests here (Jump to a
Hi all i am converting my C code to MIPS but problem is here i couldn't make correct logic for this for (int i=0;i<count;i++) { h[a[i]]++; } as
When studying assembler at the university, I encountered the following problem: I have 3 files (all of them oversimplified, they were much bigger): main.asm .58
I'm developing a microkernel for my personal research. I have chosen to run my kernel at 0xf0000000, leaving 3.75 GiB for user space programs. When my kernel st
I try to call my function just like the example code: use std::arch::asm; extern "C" fn foo(arg: i32) -> i32 { println!("arg = {}", arg); arg * 2 }
I couldn't find much information or specification that suits me, so I have no choice but to ask here. When we call some function with the call instruction and t
as a task I have to find the maximum number in the RAM locations 10 to 20 and we have to write the solution into RAM[0]. I have a big problem with getting the i
I have a simple C++ program that calls some NASM code: main.cpp: #include <iostream> extern "C" int foo(); int main() { std::cout << "The result
I'm creating an application to view the current time and I created a loop to update the time each second. The loop looks like this UPDATE: ;The code to be re-
How to fix this one: I don't know why both the quotient and the remainder are wrong. My DOSBox Code: .model small .stack 100h .data Dividend db 0dh,0ah,