For my assembly language class, we're writing DOS programs using DPMI. Unfortunately, I don't have access to a 32-bit windows machine all the time. I do have a Debian virtual machine installed on just about every computer I do use.
I've got both DOSBox and DOSEMU installed. Is there any way that I can assemble and compile the program...
I like programming challenges, and writing a kernel seems a programming challenge.
Unfortunately, kernels are particularly hard to test because they are basically the core of operating systems and so they can't be easily ran on top of an operating system.
However, I know about applications called Virtual Machines that can emulate compu...
I have found lock inc addr but that doesn't keep a copy of the stored value around and even a read immediately after it in the same thread could come after a competing write.
The best solution I have found is a load/inc/cas loop.
...
Just wondering how the world of assembly works, and I was reading about the assembly language on wiki and this quote struck me:
It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture.
I always thought assembly was a fixed language based on your CPU (w...
How can I shutdown the computer using only assembly code?
...
Consider the following assembler output:
START 100
MOVER BREG, ONE 101) + 04 2 105
MOVEM BREG, RESULT 102) + 05 2 106
PRINT RESULT 103) + 10 0 106
STOP 104) + 00 0 000
ONE DC '1' ...
I am trying to write a statistics tool for a game by extracting values from game's process memory (as there is no other way). The biggest challenge is to find out required addresses that store data I am interested. What makes it even more harder is dynamic memory allocation - I need to find not only addresses that store data but also poi...
It is possible for an operating system to determine whether a page of memory is in DRAM or in swap; for example, simply try to access it and if a page fault occurs, it wasn't.
However, is the same thing possible with CPU cache?
Is there any efficient way to tell whether a given memory location has been loaded into a cache line, or to ...
I'm reading "The Art of Assembly - Chapter 11. The MMX Instruction Set"
After executing some MMX instructions, the EMMS instruction needs to be executed to reset the FPU. It states the EMMS instruction is quite slow.
However when I profiled the EMMS execution time to see just how slow it was, (using RDTSC to count clock cycles), it ap...
In assembly language if we use
mov eax, dword ptr[ebx]
then it means copy the value pointed by ebx (ebx contains the address value, not the actual value, this instruction copies the actual value in the address)?
If we use
mov eax, dword ptr[some_variable]
then it means copy the value of variable "some_variable" itself to eax, not ...
In different assembly languages MUL (x86)/MULT (mips) refer to multiplication. It is a black box for the programmer. I am interested in how actually a CPU accomplishes a multiplication regardless of the architecture. Lets say I have two 16-bit values in my registers and I am the cpu, so I have to implement MUL using the other bit-fiddlin...
Hello everyone,
I heard there is Intel book online which describes the CPU cycles needed for a specific assembly instruction, but I can not find it out (after trying hard). Could anyone show me how to find CPU cycle please?
Here is an example, in the below code, mov/lock is 1 CPU cycle, and xchg is 3 CPU cycles.
// This part is Platfo...
Duplicate
What is a Good x86 Assembly Book?
Could someone point me to a book/tutorial which is best for x86 asm on linux. I know there are threads that exist for this already, and probably some books even.
...
Hello,
What are the most highly regarded books on optimization / performance tuning of C/C++ code?
...
'I've interned at a company that does a lot of mainframe work. Most of my mainframe experience has been using Java and Unix System Services. I've had some experience with the ISPF interface and C but none with assembler. I’m graduating shortly and will be taking an independent study my last semester. I’d like to stick with the mainframe ...
I am an electronics student and I have programmed mostly in Assembly. Last night I saw an amazing article that discussed writing a compiler in Ruby. What the author had done was use GCC to peek how the C translates to Assembly. That resonated a lot for me. I could finally see how the C program translated to Assembly.My question/request t...
How does one implement alloca() using inline x86 assembler in languages like D, C, and C++? I want to create a slightly modified version of it, but first I need to know how the standard version is implemented. Reading the disassembly from compilers doesn't help because they perform so many optimizations, and I just want the canonical f...
Whilst learning the "assembler language" (in linux on a x86 architecture using the GNU as assembler), one of the aha moments was the possibility of using system calls. These system calls come in very handy and are sometimes even necessary as your program runs in user-space.
However system calls are rather expensive in terms of performanc...
Hi, I'm wondering if it's possible to use inline assembly with the intel syntax in c, using tcc (not gcc)
thanks
...
Why
I'm "porting" a NASM source to GAS and I found the following lines of code:
push byte 0
push byte 37
GAS doesn't allow "push byte" or "pushb".
How should I translate the above code to GAS syntax?
Thanks
...