The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [assembly]

Tag for questions regarding the wide family of assembly languages both low and high level. It should be used for both the languages themselves as well as their assemblers.

Filter by
Sorted by
Tagged with
6
votes
1answer
125 views

How to understand this TMG's assembly code from the Version 6 Unix?

Early versions of Unix included Doug McIlroy's tool tmg ("transmogrifier"), an early compiler-compiler. TMG was implemented in Dennis Ritchie's assembly language as well as in TMGL itself (the ...
0
votes
1answer
154 views

How is the Linux kernel partially written in assembly when system calls are required? [closed]

Does the kernel just not use system calls, or is the assembly being assembled before being on a new system? I might need some more info on assemblers, but I'm just confused that if instructions such ...
2
votes
1answer
40 views

What the branch machine op-code means (X86 architecture)?

I have a simple c code which is compiled and then the text code extracted using objdump utility. here is the dump file (A piece of dumped file): 0804841b <main>: 804841b: 8d 4c 24 04 ...
0
votes
0answers
24 views

compile assembly code with arm-none-androideabi-as

I have an assembly code and need to compile with "arm-none-androideabi-as" the documentation mentioned compiling like this arm-none-androideabi-as -o /dev/null -f=tmb.lst tmb.asm I want a compiler ...
1
vote
1answer
99 views

How to build and run the GNU GAS assembler test suite?

I'm at Binutils tag binutils-2_31, and there is a directory: gas/testsuite with some tests that I'm interested in. I've compiled the entire binutils with: ./configure make but the directory gas/...
0
votes
1answer
51 views

What software that I run uses AVX (or a specific assembly instruction)?

Let's say I want to find any libraries that use AVX, or the VZEROALL instruction? How could I go about doing that? I don't care if the AVX was hand written or compiled, I'll look that up later. I'm ...
2
votes
1answer
1k views

Why can the kernel not use SSE/AVX registers and instructions?

This post from StackOverflow has this, In some environments there there is a restriction on certain instructions or using certain registers. For example, in the Linux kernel, use of SSE/AVX or FP ...
1
vote
1answer
126 views

What does SYSENTER do in 64-bit Long mode on Linux?

There is an x86 instruction sysenter. This seems to be the Intel fast-system-call method. SYSENTER seems to be valid in LONG mode (64-bit) on Intel processors. This seems to have fallen out of favor ...
0
votes
1answer
538 views

Running a custom-compiled executable returns “No such file or directory”

I have an executable but when I run it I get "No such file or directory" $ chmod a+x bin $ file bin bin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/...
0
votes
1answer
140 views

Does GCC generate Bit Tests (x86 BT)?

Seaching through the GCC source, I see things like X86_TUNE_USE_BT TARGET_USE_BT My goal is to get an answer for myself whether or not GCC generates BT, BTS, BTR, and BTC. I started with BT and I ...
2
votes
1answer
44 views

Issues with cross-compiling and “as”?

I'm trying to compile source for a utility for an ARM system (host machine: x86_64, Debian, uname -v reports version as "Debian 4.9.110-3+deb9u1") but when it tries to pack the file into a final ...
1
vote
1answer
78 views

Where is start symbol in cat executable?

In my Ubuntu 18.04, when I disassemble /bin/cat or the one in coreutils using IDA Pro there exists "start" symbol, usually found with name "_start" in other programs such as gimp. However, when I use ...
2
votes
1answer
531 views

What do you call the calling convention behind `int 0x80`?

I know there is a syscall convention but what do you call the calling convention that precedes it that you see when you call to int 80 rather than syscall, like this. mov rax,4 ; system call ...
1
vote
1answer
507 views

Kernel initialization in UEFI mode

When using old legacy BIOS (consider X86 architecture), the boot loader jumps to a location at the real mode kernel (offset 512 which is defined in header.S assembly file) and starts the real mode ...
-1
votes
1answer
279 views

How does the processor determine each instruction's opcode and operands: looking into binary file with VIM [closed]

I run the command view /bin/ls on FreeBSD 10.3 and I can see the binary file unmodified: Then on vim/view I run the command :%!xxd and I can see the file in hex format as follows. I notice at the ...
2
votes
1answer
437 views

Z80 CPU cross-assembler for the MSX standard

I'm trying to program for the old eighties MSX standard that used a Z80 CPU. My problem is that I can't seem to find a cross-assembler for this CPU using the MSX standard. Is there any Z80 CPU MSX ...
2
votes
0answers
66 views

perf-like assembly reading tool

perf has a very friendly terminal interface for performance analysis. It has a very helpful feature that the branch target is annotated with beautiful arrows, showing where this branch is going to (if ...
0
votes
1answer
341 views

x86 Emulator for Linux with detailed debugging

I am looking for a x86 emulator so that I can run my Linux kernel inside it. I am specifically looking for an emulator that shows all the function calls in C/Assembly level from bootloader, all the ...
0
votes
2answers
3k views

Any x86-64 Linux assembler?

I want to start learning assembly language, but all the googling didn't make any sense. I got some Exec format error and even used wine which is not good for understanding. So I wonder if anyone can ...
0
votes
1answer
401 views

Incompatibility of High Level Assembly on Kali Linux Rolling

After reading the "Art of Assembly Language", I obtained the High Level Assembly language from the website listed in the book. After editing my .bashrc file, I compiled my canonical "Hello world!" ...
45
votes
11answers
173k views

How to view a binary file?

From what I understand, a compiler makes a binary file that consists of 1's and 0's that a CPU can read. I have a binary file but how do I open it to see the 1's and 0's that are there? A text editor ...
2
votes
1answer
3k views

Compile shared library from asm code with current sources

I just did some basic functions in asm that I compile in a shared library. Like : BITS 64 global foo section .text foo: mov rax, 1 ret I compiled with ...
2
votes
1answer
152 views

Is there a reference for the assembler-like output produced by `awk -W dump`?

The command awk -W dump ... produces a dump of "assembler-like" code (as shown here [link], or by reading the man). Some of the instructions are easy to guess at their meaning such as jz, which is ...
0
votes
1answer
4k views

Permission denied when I try to run a program assembled with the GNU assembler

I was testing the GNU assembler using intermediate code generated by gcc. I don't really understand the GNU assembly syntax at all, though I could learn it at some point. I ran the command as hello....
2
votes
1answer
615 views

CLFS for ARMv7 neon

I am following CLFS book (GIT-20140613-arm version), and I have a issue when building GCC with armv7 and neon combination. Target info here. My host is a clean Debian 8 with gawk, build-essential, ...
11
votes
1answer
412 views

Where in GRUB2 source code is the handover/jump to kernel code?

I'm looking for the line of code where GRUB2 finally jumps to kernel code and thus hands over execution on x86 systems? I guess it's in an assembler file since this is very low architecture stuff. I ...
0
votes
1answer
81 views

Where is RAX-ARGOFFSET defined?

In Linux 3.16, in asm/x86/kernel/entry_64.S, the following line references RAX-ARGOFFSET (also see [src]): 424 movq %rax,RAX-ARGOFFSET(%rsp) But I can not find where RAX-ARGOFFSET is defined ...
7
votes
1answer
1k views

Unable to run an executable built with NASM

I am attempting to assemble the assembly source file below using the following NASM command: nasm -f elf -o test.o test.asm This completes without errors and I then try to link an executable with ld:...
17
votes
4answers
2k views

Why some operating systems event handling is written in asm instead of c?

My question is why nowadays some operating system event handling is still written in assembly language instead of a higher level language such as C, when the kernel itself is written mostly in C?
1
vote
1answer
143 views

How to write a program which can run on a computer without a operating system? [closed]

If there is a computer without operating system, then we can install one on it using a floppy disc or usb stick. While the computer is booting, we push F11 or some other button, then the computer ...
10
votes
1answer
20k views

How do I cross-compile Chromium for ARM?

Goal I need to install Chromium on FriendlyARM mini210s running Linux 3.0.8 armv7l Environment Vagrant box with Ubuntu Precise64 Installed depot_tools following these guidelines Get-the-code and ...
1
vote
1answer
538 views

Obtaining a code dump from a binary

Is it possible to dump the assembly language code of a binary using GDB? I tried to use the "l" command but it says No symbol table is loaded. Use the "file" command.. I use the file command and it ...
5
votes
3answers
12k views

Generate MIPS architecture assembly code on a X86 machine

I need to generate MIPS specific code on my machine when I run my C program. When I simply run, gcc -O2 -S -c hello.c On my system, I get the hello.s which seems to generate some assembly code but ...
0
votes
0answers
919 views

Resume from Suspend/Hibernate issues

I have a peculiar problem while trying to resume from both suspend and hibernate. I believe the problem to be within the kernel itself since I have tried different distros (Ubuntu, Suse, Mageia) on ...
2
votes
1answer
544 views

Can't build QTAV for cubieboard2 on Cubian

I’m trying to make QTAV lib for cubieboard2 environment and experiencing problems. Could you please help. Here is what qmake says: cubie@Cubian:~/QtAV/output$ qmake ../QtAV.pro Project MESSAGE: ...
1
vote
2answers
1k views

Running assembly program as ring 0

I'm writing an application which reports back readings from CPU temperature sensors, and the fan speed monitor. However, according to the Intel documentation on PECI, the instructions required must be ...
3
votes
1answer
1k views

Can't compile glibc for 64 bit system

I'm trying to compile glibc-2.16 statically for x64 system, ../configure --enable-kernel=2.6.9 --prefix=/run/shm/libc-static-64 --enable-static --enable-shared --host=i486-linux-gnu --build=i486-...
4
votes
1answer
171 views

What is not accessible from userspace?

I read somewhere (3.1.3) that there's a high ring (supervisor mode) and a low ring (user mode) and that some "things" can be run only from the highest ring. What do they mean by "things"? I'd guess ...
2
votes
1answer
834 views

Problem in Cross compiling TinyCC with CodeSourcery

I am trying to cross compiling homas Preud'homme's version of TinyCC by using following command ./configure --cc=arm-none-linux-gnueabi-gcc --prefix=/home/shushant/tinycc/tc and it shows following ...
0
votes
0answers
1k views

gdb-multiarch command not found

I have installed QEMU in RHEL for running the assembly programs in ARM. I have successfully installed QEMU and ARM. However, for debugging we are thinking to use GDB. I want to install the GDB-...
2
votes
0answers
99 views

GNU MIX Development Kit build error

I am trying to compile the GNU MIX assembly development kit on Mac OS X 10.8.4. I've installed the dependencies through homebrew, and when I run configure in the mdk directory, I get a success message:...
4
votes
1answer
706 views

QEMU for ARM programs with GDB [closed]

I want to emulate an ARM processor for running the assembly programs using QEMU in RHEL. I have installed QEMU but I still have problems in running the assembly program. I got the assembly program, ...
4
votes
3answers
3k views

8086 emulator for unix-like OSs?

Is there any 8086 emulator (free or paid) for Fedora 17? I am learning assembly language using AT&T style.
3
votes
2answers
2k views

Moving compiled assembly code to the boot sector of a USB device

I have written a simple operating system and I am trying to test it. I have VirtualBox installed and an eight GB flash drive, so I thought I would just use those. I am not sure how to make the USB ...
1
vote
1answer
4k views

Assembly files in obj-m list when building kernel modules

I'm trying to build kexec as a module, but I'm running into a weird problem. My obj-m is: obj-m += kexec.o machine_kexec.o relocate_kernel.o When I run the makefile, it complains that there's "no ...
1
vote
1answer
445 views

Linux kernel 3.2 syscalls [closed]

Just trying to get the assembler instructions for <__execve> of the code below because i want to build the shell spawn opcode list: #include <stdio.h> int main() { char *happy[2]; ...
1
vote
1answer
3k views

Fatal error: No compiled in support for x86_64

Can't use gcc on x64 debian: $ gcc a.cpp Assembler messages: Fatal error: No compiled in support for x86_64 what should I do? Some people propose installing binutils, but they are already there. (...
1
vote
2answers
999 views

Running the linux kernel and Ubuntu on custom processor

This is hardly a theoretical question as many have done this, albeit there's very little information on the underlying processes. I'm developing a custom MIPS-based processor on which I would like to ...
2
votes
2answers
488 views

Is there a good FOSS utility for converting machine code to assembly or even C?

If I buy a piece of x86 32-bit or 64-bit software but I don't receive the source code, and I need to modify the software, I'll need to convert the machine code back into a high level language or at ...
2
votes
1answer
1k views

VNC from host PC to Android phone running Ubuntu

While I know how to do this from my phone itself, where it loads the GUI on Ubuntu and I have a desktop environment, it's not as useful for what I'm trying to accomplish, which is to have a ...