Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
106 views

I am following an assembly tutorial where they use NASM. They manage to compare a register to a variable's address with cmp rcx, digitSpace, but how can I do the same with GAS? As you know this ...
mx14slh's user avatar
  • 37
2 votes
1 answer
72 views

Using clang on macOS with Xcode, the following x86_64 assembly code compiles successfully, which does NOT use Intel Syntax. The jmp instruction jumps to a displacement of 0x1234 bytes from the current ...
user12280249's user avatar
3 votes
1 answer
216 views

I tried to compile a very simple program using gcc with -masm=intel option. But instead "Error: invalid use of register" appears. // test.c #include <stdio.h> size_t offset; int main(...
XiaozaYa's user avatar
2 votes
1 answer
85 views

With GNU as .intel_syntax, some identifiers apparently become keywords, and writing e.g. call and to invoke a function called and results in Error: invalid use of operator "and" How do you ...
Tau's user avatar
  • 699
3 votes
0 answers
64 views

I'm writing a compiler, and it emitted the following (Intel-syntax) assembly code for Linux (x86-64): lea r13, _s1 mov qword ptr [rbp + -2*8], r13 mov r10, qword ptr [rbp + -2*8] lea r13, qword ptr [...
laptou's user avatar
  • 7,107
0 votes
0 answers
84 views

This code works as a IN func for i/o ports in inline c: int func(short port) { short data; __asm__( ".intel_syntax \n\t" "in byte %0, %1\n\t" "...
Programmerabc's user avatar
0 votes
0 answers
27 views

In the x86 intel syntax, global variable values can be accessed with [rip+a], but when I try to assign a new value to a global variable address, like mov [rip+a], 4, a Segmentation Fault occurs. I was ...
go horikoshi's user avatar
2 votes
2 answers
556 views

I trying to convert function "__cpuid" from С language to C++. I have a problem that the g++ compiler does not work with Intel assembler. I'm trying to translate this code: __asm { ...
Star Butterfly's user avatar
1 vote
2 answers
438 views

I tried to convert and interpret C language code into assembly language with GCC -S option. What is the difference between push %rbp and push rbp?
김우진's user avatar
0 votes
1 answer
523 views

I am tasked to write a GNU assembly program using Intel syntax which counts numbers in array which are <= 6 I came up with the following code: .intel_syntax noprefix .data n: .word 5 a: ....
H4kt's user avatar
  • 143
2 votes
1 answer
1k views

My perf report shows everything in AT&T syntax: ... 0,18 │ pop %rax 0,14 │ ← retq 0,18 │a9: vmovsd -0x8(%rdi,%rsi,8),%...
Alex Zhukovskiy's user avatar
3 votes
2 answers
1k views

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 non-relative address without ...
ChrisMan's user avatar
3 votes
1 answer
2k views

I'm learning assembly using GNU Assembler using the Intel syntax and there is one think that I don't really understand. Say for example this code right here : .intel_syntax noprefix .data string: ....
Liwinux's user avatar
  • 109
0 votes
0 answers
2k views

I'd like to use intel syntax gcc inline assembly, leaving gcc's default -masm=att dialect untouched. The following code works fine: #include <stdio.h> int main(int argc, char *argv[]) { int ...
Wot's user avatar
  • 102
0 votes
0 answers
655 views

For an indirect jump to the address stored in L + 8 in 64-bit mode, nasm accepts, jmp [L + 8] jmp qword [L + 8] GNU as accepts, jmp [L + 8] jmp qword ptr [L + 8] and also, jmp [[L + 8]] jmp [qword ...
xiver77's user avatar
  • 2,342
1 vote
0 answers
46 views

I've searched the web but haven't found anything that answers my question so hopefully someone on here will be able to answer it. Using GNU AS with Intel syntax (.intel_syntax noprefix) gives mixed ...
robertapengelly's user avatar
0 votes
0 answers
218 views

I'm new to x86 assembly and I'm following a practical work for the basics. I have 2 equivalent sample codes: One in AT&T syntax and the other on Intel syntax. When compiling theses with GCC, ...
JM445's user avatar
  • 210
0 votes
2 answers
2k views

I've been trying to disassemble C code into intel assembly code on my m1 macbook pro but can't find any way to do it (i've tried to look up how to do it using gdb, lldb, objdump, but no succes so far)....
user avatar
2 votes
1 answer
1k views

As far as I understand, some objects in the "data" section sometimes need alignment in x86 assembly. An example I've come across is when using movaps in x86 SSE: I need to load a special ...
1ncend1ary's user avatar
0 votes
0 answers
37 views

I have a task like this: Implement the function with the signature in x86-64 assembly language: extern int * A; extern void func(size_t N); The function in the loop N times: Enters a signed 32-bit ...
AshGi's user avatar
  • 13
3 votes
1 answer
472 views

Currently the disassembly shows AT&T syntax below, but I'm accustomed to reading the Intel syntax. Is there an option or setting to switch between them? Thanks.
vengy's user avatar
  • 2,467
0 votes
2 answers
454 views

I have some x86 realmode assembly code which isn't behaving exactly as expected. I believe the issue relates to an incorrectly calculated jmp/call offset, but I might be mistaken. Here is the ...
user2138149's user avatar
  • 18.7k
0 votes
1 answer
554 views

I attempted to write a print string function; 45 ; the address is stored in si 46 print_string: ...
user2138149's user avatar
  • 18.7k
0 votes
1 answer
1k views

I'm trying to compile one very simple program, but I get 2 errors that I can not fix: 1.s:13:Error: too many memory references for 'mov' 1.s:15:Error: too many memory references for 'lea' Here is my ...
Marijam's user avatar
  • 45
0 votes
0 answers
86 views

.intel_syntax noprefix number1: .quad 8403406020084561865 , 3325915310126341549 , 1038926090642473899 , 12330590014810845464 mov r12,[number1+0] mov r13,[number1+8] mov rcx,[number1+...
ataberkty's user avatar
3 votes
1 answer
15k views

I have a lot of trouble to make it work: I have tried the following ways: uint32_t reverseBits(volatile uint32_t n) { uint32_t i = n; __asm__ (".intel_syntax\n" &...
Antonin GAVREL's user avatar
1 vote
1 answer
1k views

I decided to try using inline assembly in c for my basic operating system (using intel syntax because I am used to that with NASM). And I came across something I could not fix, I tried looking ...
zufalige daten's user avatar
2 votes
1 answer
390 views

I am learning assembly using Jeff Duntemann's book. I am trying to figure out how to write function that can be called in C. Say for example that I want to implement the following function in assembly:...
tst's user avatar
  • 1,182
0 votes
0 answers
161 views

What is the difference between the operations: mov dword ptr [eax], 5 and mov dword [eax], 5 Furthermore, do mov dword ptr [eax], 5 and mov [eax], dword ptr 5 do the same thing?
Ark's user avatar
  • 133
2 votes
2 answers
4k views

I am trying to convert the xv6 boot code from At&t syntax to Intel syntax and I have a problem with the ljmp instruction. I am trying to learn the boot process of Intel computers and I am not ...
cbot's user avatar
  • 117
1 vote
1 answer
136 views

I'm using D8 shell and the flag --print-opt-code to print the code TurboFan generates. However, the code is printed using AT&T syntax. I'm not familiar with it, but with Intel syntax. I searched ...
Chayim Friedman's user avatar
0 votes
0 answers
541 views

I've been studying assembly in school, and I'm trying to apply it to a real situation. I have a product that is no longer supported and I want to see how a portion of the code that uses the CPUID to ...
richbai90's user avatar
  • 5,264
0 votes
1 answer
280 views

I have C-program with assembly insert. Here is code: main.c: #include <stdio.h> int f() { int a = 0, b; __asm__ (".intel_syntax noprefix\n\t" "mov edx, 1\n\t&...
Артем Силевич's user avatar
0 votes
1 answer
1k views

x86 CPU: MSVC (2010) What does EXTRN _printf:PROC means in code bellow and why after ":" we use some "PROC" directive instead of "near" or "far"? CONST ...
Deno's user avatar
  • 57
0 votes
1 answer
4k views

I'm very new to Assembly Language and I know there are many, many types of assembly languages. Such as ARM, MIPS, x86 etc. So I have questions. Below is more Information Hello World in ARM .text ...
Lasan Nishshanka's user avatar
4 votes
1 answer
2k views

Can I use semicolons in GAS for comment characters? I am using GAS 2.30 with the Intel syntax as below. .intel_syntax noprefix .section .text # Program entry point .globl _start _start: # Put ...
user avatar
-1 votes
1 answer
983 views

I am quite used to Intel-format inline assembly. Does anyone knows how to convert the two AT&T lines into Intel format in the code below? It is basically loading local variable's address into a ...
xuancong84's user avatar
  • 1,615
2 votes
0 answers
2k views

I'm trying to compile an inline assembly code in clang (Windows). So,I have the following code: int main(int, char **) { asm("mov %eax,$4;"); } I tried compiling it using clang++ -masm=...
0xDEADC0DE's user avatar
1 vote
1 answer
189 views

I want to know whether I can change the syntax of the output of the following command: x/5i $rip Now it gives output like that. I guess it is AT&T syntax, correct my if I'm wrong (newbie): -> ...
vagifm's user avatar
  • 447
1 vote
1 answer
404 views

First of all, I'd like to say that I'm new to ASM and if this is a stupid question please excuse it. I read in Agner Fog's microarchitecture manual about partial register stalls (this seems a little ...
Alex Gh's user avatar
  • 65
0 votes
0 answers
30 views

I am trying to write a simple assembly program with GNU assembler (as) in MAC OS. Part of the program looks like the following: .intel_syntax noprefix .globl _main .text ... mov rdx, len ...
Teng Lam's user avatar
1 vote
0 answers
284 views

I've been writing a programming game -- and with that comes writing a programming language. Initially I wanted the programming language to be a gross simplification of assembly language (like the game ...
Thor Correia's user avatar
  • 1,319
0 votes
1 answer
205 views

I'm working on modifying a routine that switches to and from realmode to perform a BIOS interrupt, but running into issues with paging. I had it working prior with no paging, but now that my OS uses ...
23scurtu's user avatar
  • 148
0 votes
1 answer
945 views

I'm trying to perform an absolute jump to the address 0x7C00 as part of a procedure in a hobby OS. I'm using intel syntax in GAS and testing in QEMU. I tried two methods: jmp 0x00007c00 and mov eax,...
23scurtu's user avatar
  • 148
0 votes
1 answer
1k views

I have this piece of inline assembly code that should print A in text mode: void print(){ asm volatile( "mov ax,0xb800\n" "mov ds,ax\n" /*<-as complains about ...
Clement Poon's user avatar
3 votes
1 answer
1k views

From all the docs I've found, there is no mention of syntax like offset[var+offset2] in Intel x86 syntax but GCC with the following flags gcc -S hello.c -o - -masm=intel for this program #...
Hritik's user avatar
  • 722
1 vote
1 answer
672 views

Using GCC, compiling for 32-bit Intel architecture, with .intel_syntax noprefix. Let's suppose I have the following .data section: A: .int 0x1, 0x2 What is the difference between the following, when ...
Balázs Börcsök's user avatar
0 votes
0 answers
19 views

I just have a simple line of NASM/Intel syntax assembly that I need in GAS/AT&T syntax. The line is JMP 0x08:reload_CS I couldn't find anything online, but I have tried: jmp $0x08, reload_CS ...
drewpel's user avatar
  • 475
0 votes
2 answers
926 views

I just cant figure out how to add an offset to my destination when moving a value, specifically in Intel syntax I have: MOV [gdtr + 2], EAX and for AT&T syntax I have tried converting it to: ...
drewpel's user avatar
  • 475
1 vote
0 answers
4k views

So I saw some code .LC0: .string "Hello world" main: sub rsp, 8 mov edi, OFFSET FLAT:.LC0 call puts xor eax, eax add rsp, 8 ...
Lewis Kelsey's user avatar
  • 4,822