att

What is an assembly-level representation of pushl/popl %esp?

做~自己de王妃 提交于 2019-12-29 07:39:09
问题 C++ ATT Assembly I'm trying to understand the behavior of the following two instructions: pushl %esp And: popl %esp Note that they store the computed value back into %esp . I'm considering these instructions independently, not in sequence. I know that the value stored in %esp is always the value before the increment/decrement, but how could I represent the behavior in assembly language? This is what I've come up with so far: For push: movl %esp, %edx 1. save value of %esp subl $4, %esp 2.

x64: Why does this piece of code give me “Address boundary error”

穿精又带淫゛_ 提交于 2019-12-29 01:52:53
问题 Why does the following x64 assembly give me "Address boundary error"? It only happens when I add code after call _print_string . I assume that some of the register have been modified but aren't they supposed to be reverted once the _print_string function returns? I am using Mac OS X obj_size = 8 .data hello_world: .asciz "hello world!" .text .globl _main _main: pushq %rbp movq %rsp, %rbp leaq hello_world(%rip), %rdi callq _print_string subq obj_size, %rsp movq 1, %rax movq %rax, obj_size(%rsp

What was the original reason for the design of AT&T assembly syntax? [closed]

拈花ヽ惹草 提交于 2019-12-28 03:06:32
问题 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 2 years ago . When using assembly instructions on x86 or amd64, programmer can use "Intel" (i.e. nasm compiler) or "AT&T" (i.e. gas compiler) assembly syntax. "Intel" syntax is more popular on Windows, but "AT&T" is more popular on UNIX(-like) systems. But both Intel and AMD manuals, so

In the Assembly language, what does the 'l' in “movl” stands for? [duplicate]

旧巷老猫 提交于 2019-12-27 06:38:32
问题 This question already has answers here : Questions about AT&T x86 Syntax design (4 answers) Closed 11 months ago . I understand that movb is move byte, movw is move word, movq is move quad word. movl is move double word, but what does the l stands for? 回答1: According to Computer System: A Programmer's Perspective , page 215, it means "long" since 32-bit quantities are considered to be "long words" 来源: https://stackoverflow.com/questions/54411253/in-the-assembly-language-what-does-the-l-in

In the Assembly language, what does the 'l' in “movl” stands for? [duplicate]

我是研究僧i 提交于 2019-12-27 06:35:13
问题 This question already has answers here : Questions about AT&T x86 Syntax design (4 answers) Closed 11 months ago . I understand that movb is move byte, movw is move word, movq is move quad word. movl is move double word, but what does the l stands for? 回答1: According to Computer System: A Programmer's Perspective , page 215, it means "long" since 32-bit quantities are considered to be "long words" 来源: https://stackoverflow.com/questions/54411253/in-the-assembly-language-what-does-the-l-in

Print register value to console

人盡茶涼 提交于 2019-12-26 21:39:49
问题 I want to print the value in %RCX directly to the console, let's say an ASCII value. I've searched through some wise books and tutorials, but all use buffers to pass anything. Is it possible to print anything without creating special buffer for that purpose? lets say i am here (all this answers are fat too complicated to me and use different syntax): movq $5, %rax ...???(print %rax) Output on console: \>5 in example, to print buffer i use code: SYSWRITE = 4 STDOUT = 1 EXIT_SUCCESS = 0 .text

CSS选择器

主宰稳场 提交于 2019-12-26 15:56:19
一、基本选择器 序号 选择器 含义 1. * 通用元素选择器,匹配任何元素 2. E 标签选择器,匹配所有使用E标签的元素 3. .info class选择器,匹配所有class属性中包含info的元素 4. #footer id选择器,匹配所有id属性等于footer的元素 实例: * { margin:0; padding:0; } p { font-size:2em; } .info { background:#ff0; } p.info { background:#ff0; } p.info.error { color:#900; font-weight:bold; } #info { background:#ff0; } p#info { background:#ff0; } 二、多元素的组合选择器 序号 选择器 含义 5. E,F 多元素选择器,同时匹配所有E元素或F元素,E和F之间用逗号分隔 6. E F 后代元素选择器,匹配所有属于E元素后代的F元素,E和F之间用空格分隔 7. E > F 子元素选择器,匹配所有E元素的子元素F 8. E + F 毗邻元素选择器,匹配所有紧随E元素之后的同级元素F 实例: div p { color:#f00; } #nav li { display:inline; } #nav a { font-weight:bold; }

CSS选择器

元气小坏坏 提交于 2019-12-26 15:55:44
CSS选择器 一、基本选择器 序号 选择器 含义 1. * 通用元素选择器,匹配任何元素 2. E 标签选择器,匹配所有使用E标签的元素 3. .info class选择器,匹配所有class属性中包含info的元素 4. #footer id选择器,匹配所有id属性等于footer的元素 实例: * { margin:0; padding:0; } p { font-size:2em; } .info { background:#ff0; } p.info { background:#ff0; } p.info.error { color:#900; font-weight:bold; } #info { background:#ff0; } p#info { background:#ff0; } 二、多元素的组合选择器 序号 选择器 含义 5. E,F 多元素选择器,同时匹配所有E元素或F元素,E和F之间用逗号分隔 6. E F 后代元素选择器,匹配所有属于E元素后代的F元素,E和F之间用空格分隔 7. E > F 子元素选择器,匹配所有E元素的子元素F 8. E + F 毗邻元素选择器,匹配所有紧随E元素之后的同级元素F 实例: div p { color:#f00; } #nav li { display:inline; } #nav a { font-weight

CSS选择器

旧城冷巷雨未停 提交于 2019-12-26 15:55:15
一、基本选择器 序号 选择器 含义 1. * 通用元素选择器,匹配任何元素 2. E 标签选择器,匹配所有使用E标签的元素 3. .info class选择器,匹配所有class属性中包含info的元素 4. #footer id选择器,匹配所有id属性等于footer的元素 实例: * { margin:0; padding:0; } p { font-size:2em; } .info { background:#ff0; } p.info { background:#ff0; } p.info.error { color:#900; font-weight:bold; } #info { background:#ff0; } p#info { background:#ff0; } 二、多元素的组合选择器 序号 选择器 含义 5. E,F 多元素选择器,同时匹配所有E元素或F元素,E和F之间用逗号分隔 6. E F 后代元素选择器,匹配所有属于E元素后代的F元素,E和F之间用空格分隔 7. E > F 子元素选择器,匹配所有E元素的子元素F 8. E + F 毗邻元素选择器,匹配所有紧随E元素之后的同级元素F 实例: div p { color:#f00; } #nav li { display:inline; } #nav a { font-weight:bold; }

Impossible constraint in 'asm': __asm__ __volatile__

心不动则不痛 提交于 2019-12-25 07:21:30
问题 I trying since a few days to write a very simple inline assembler code, but nothing worked. I have as IDE NetBeans and as compiler MinGW. My latest code is: uint16 readle_uint16(const uint8 * buffer, int offset) { unsigned char x, y, z; unsigned int PORTB; __asm__ __volatile__("\n" "addl r29,%0\n" "addl r30,%1\n" "addl r31,%2\n" "lpm\n" "out %3,r0\n" : "=I" (PORTB) : "r" (x), "r" (y), "r" (z) ); return value; } But I get everytime the same message "error: impossible constraint in 'asm'". I