Skip to content
Advertisement

Tag: assembly

Assembly NASM x86 – Simple Stack Project

I’m writing a subroutine to simply reprint decimal numbers as strings using the stack, but not getting the values I expected. When I run it through the debugger I see that I can’t get the value from esi into al. I suspect that I’m not allowed to use esi in the manner that I am, but I’m not sure on

GCC compiled code: why integer declaration needs several statements?

I’m learning AT&T assembly,I know arrays/variables can be declared using .int/.long, or using .equ to declare a symbol, that’s to be replaced by assembly. They’re declared insided either .data section(initialzed),or .bss section(uninitialzed). But when I used gcc to compiled a very simple .c file with ‘-S’ command line option to check the disassembly code, I noticed that: (1) .s is

About the memory layout of programs in Linux

I have some questions about the memory layout of a program in Linux. I know from various sources (I’m reading “Programming from the Ground Up”) that each section is loaded into it’s own region of memory. The text section loads first at virtual address 0x8048000, the data section is loaded immediately after that, next is the bss section, followed by

Differing CPUID usage from high-level languages

I’m attempting to utilize an x86 ASM function that requires certain processor architecture. I understand that I need to check a specific bit after calling “CPUID standard function 01H”. Below is a C implementation from the CPUID Wikipedia page for calling CPUID: Though the Linux kernel uses the function below: Which one is better? Other they essentually equivalent? Answer As

Is there any merit about assembly language? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago. Improve this question I heard some of developers use assembly language in embedded system. I wonder what merit they have from learning assembly language

Converting User Input Hexadecimal to Decimal in Assembly

I am trying to create an assembly program that takes a user input hexadecimal number no greater than 4 digits and outputs the same number in base 10. This is being done using NASM on a Linux install. Using some tutorials I’ve found and my very limited understanding of this language, I have come up with this. It should be

Behavior of fgetc() function in C

I am looking for an easy way to manage file opening and closing in x86-64 assembly on linux. I thought the easiest way would be to write a c file containing functions that I could call without having to worry about stability. So I wrote this function : And then I read the port like so: Where PORT.p is a

Advertisement