att

fstcw assembly operand type mismatch

浪子不回头ぞ 提交于 2019-12-11 20:07:29
问题 I'm trying to round an input double using a specified rounding mode in in-line assembly in C. To do so, I need to grab the FPU control word using "fstcw" and then change the bits in the word. Unfortunately I'm encountering an error on the very first line: double roundD(double n, RoundingMode roundingMode) { asm("fstcw %%ax \n" ::: "ax"); //clobbers return n; } The assembler error I receive is: "Error: operand type mismatch for 'fstcw'." I'm under the impression this code snippet should store

Invalid operand for instruction movq using clang

谁说胖子不能爱 提交于 2019-12-11 07:35:15
问题 I'm using the movq X86_64 assembly instruction on an Intel Core i5 with the LLVM-based clang-902.0.39.1 compiler. The simplified code (at the my_asm.S file) in Intel syntax looks like this: .intel_syntax noprefix #define a_const 0xFFFFFFFFFFFFFFFF movq rax, a_const I'm compiling with clang -c -g -O3 -fwrapv -fomit-frame-pointer -march=native my_asm.S The compiler gives me the following message: error: invalid operand for instruction movq rax, 0xFFFFFFFFFFFFFFFF ^ I've also tried the AT&T

jmpq and lea, and how does rdi register work in binary bomb

徘徊边缘 提交于 2019-12-11 06:44:49
问题 So I have annotated what I think it means next to each instruction and have put a (?) next to each instruction which I am unsure of/not quite certain it does that function. There are probably a lot more of ones I am unsure of than I have marked, but they are mostly the same type of instruction. 0x0000000000401251 <+0>: sub $0x8,%rsp 0x0000000000401255 <+4>: cmp $0x1,%rdi #compare num of inputs (?) 0x0000000000401259 <+8>: jg 0x40126c <phase_3+27> #blow up if not >1 0x000000000040125b <+10>:

How do function calls work in x86 32-bit assembly on Linux?

a 夏天 提交于 2019-12-11 05:52:22
问题 I am learning GNU assembly from Jonathan Bartlett's "Programming from ground up" book. While going through the topic of a function call and stack, I'm unable to understand its working. Below is what's written in the book: Before executing a function, a program pushes all of the parameters for the function onto the stack in the reverse order that they are documented. Then the program issues a call instruction indicating which function it wishes to start. The call instruction does two things.

Assembly: boot loader for custom OS keyboard support

大憨熊 提交于 2019-12-11 03:22:43
问题 I have a working simple custom OS (doesn't do much for now :D). Right now i'm using an assembly file (boot.s) that has no keyboard support. The assembly file (boot.s): # set magic number to 0x1BADB002 to identified by bootloader .set MAGIC, 0x1BADB002 # set flags to 0 .set FLAGS, 0 # set the checksum .set CHECKSUM, -(MAGIC + FLAGS) # set multiboot enabled .section .multiboot # define type to long for each data defined as above .long MAGIC .long FLAGS .long CHECKSUM # set the stack bottom

Html CSS学习(四)CSS选择器

我与影子孤独终老i 提交于 2019-12-09 16:23:18
CSS选择器 Html用于呈现网页的内容与结构,CSS用于设置页面中内容的外观,即表现形式,在对内容进行样式的设置时,首先要选择欲应用样式的内容,这主要通过CSS的选择器进行。本部分内容主要对CSS选择器进行学习。 一、基础选择器 1.通配符 * 选定文档内所有的对象,通常用于对全局内容样式的设置。 2.ID选择器 #ID 在HTMl中,ID的使用要尽量少用,以增强CSS代码的通用性。ID主要用于页面区块内容的划分。 3.类选择器 .className 通过class属性进行选择,是使用最多的一种方式 4.标签选择器 通过标签类型进行选择 例1.基础选择器的使用 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>选择器</title> </head> <body> <div id="wrap"> <header></header> <div class="page_body"></div> <footer></footer> </div> <

mov instruction in x86 assembly

大城市里の小女人 提交于 2019-12-09 02:37:59
问题 From what I've read about mov , it copies the second argument into the first argument. Then, what does this do? movl 8(%ebp), %edx It copies whatever is in edx to the first parameter of the function (since an offset of +8 from ebp is a parameter)? I feel like what this really means is moving the first parameter into the edx register, but I read on Wikipedia that it is the other way around? 回答1: movl 8(%ebp), %edx is in "AT&T Syntax"; in this syntax, the source comes first and the destination

Embed URL Link in SMS via PHP

随声附和 提交于 2019-12-08 15:26:22
问题 Is there a way I can embed a URL link i.e. <a href='www.google.com'>google</a> in an SMS message send through [myphonenumber]@txt.att.net ? My mail configuration is set to "text/html" but the link shows up as un-clickable plain text in the SMS... Any Ideas?!!? 回答1: Most phones will automatically linkify URLs, however it is not possible to give links the way you are trying to do. Simply send www.google.com and the receiving device will link it for you. 回答2: No, clickable links are dependent on

Asterisk before an address and push instructions, where is it being pushed to?

匆匆过客 提交于 2019-12-08 12:18:57
问题 I am working on an assignment where I need to understand the compiled C Program using GDB. I'm trying to follow the instructions but am having difficulty understanding exactly what the jmp command is doing when it is jumping to an address preceded by * . I've looked where the address is located but it falls between two words. After the jump, there is a push command of a hex value. I'm only assuming that this is basically like using a pointer and the push command overwrites the byte value with

x86 simple mov instruction

别来无恙 提交于 2019-12-08 12:04:16
问题 This is a simple question but I can't find reliable answers on google. What does this instruction mean: movl %eax, (%esi, %ecx, 4) Is it move the value at register eax to the value in memory that (%esi, %ecx, 4) is pointing too? (%esi, %ecx, 4) is for an array. So it means Array[Xs + 4i] where Xs is the starting point in memory for the Array and i is just an offset in the integer array. 回答1: Exactly correct. This is AT&T syntax, so the source comes first, then the destination. Thus, it stores