att

    0热度

    1回答

    我有%ecx包含希望将%esi的值移到左侧的位置数,但对于我的理解,shl的源必须是立即值。 有人可以帮助我理解我将如何转移%ecx的价值吗?我环顾四周,看到有人推荐使用CL寄存器。但是有没有其他选择? 谢谢。

    0热度

    1回答

    假设整数数组的大小存储在eax中。我想你可以可以为数组分配存储像这样: subl (%eax), %esp 然而,在EAX大小是由用户提供的,并且将具有不同的尺寸与每个程序的执行。鉴于此,如何初始化用户使用scanf提供的整数每个4字节的内存地址?我们如何确保如果提供的整数大于数组的大小,我们不会覆盖任何内存?

    0热度

    1回答

    我有下面的C代码: #include <inc/x86.h> #include <inc/elf.h> #define SECTSIZE 512 #define ELFHDR ((struct Elf *)0x10000) // scratch space void readsect(void*, unit32_t); void readsec(uint32_t, uint32_t,

    1热度

    1回答

    我有这个“.s”文件,写在AT & T程序集中。 .globl interleave interleave: pushl %ebx pushl %esi pushl %edi movl 16(%esp), %ebx #a movl 20(%esp), %esi #b movl 24(%esp), %edi #c D: movb

    1热度

    1回答

    我想打电话从32位汇编写系统调用,代码即时通讯现在使用: .section .rodata # read-only data msg: .ascii "hello" # not null-terminated string called "msg" len: .long 5 # length of "msg" .section .text #

    0热度

    1回答

    这个在& t语法中的等效含义是什么?我似乎无法通过谷歌找到任何东西。 struc node info: resd 1 next: resd 1 endstruc

    1热度

    1回答

    我新的编程,和我开始阅读一本书就明白了基本面。我无法理解下面的汇编代码是如何工作的:它计算一个数字的阶乘。我已经对我能理解的说明添加了评论 - 显然我错过了一些东西。 .section .data .section .text .globl _start .globl factorial _start: pushl $4 call fa

    1热度

    1回答

    为什么下面的x64程序集会给我“地址边界错误”?只有当我在call _print_string之后添加代码时才会发生。我假设一些寄存器已被修改,但不是在_print_string函数返回时它们应该被还原吗? 我使用的是Mac OS X obj_size = 8 .data hello_world: .asciz "hello world!" .text .globl _

    3热度

    1回答

    我有以下代码(caller.c): #include <stdio.h> extern int callee(int); int main(int argc, char *argv[]){ callee(4); return 1; } 和(callee.s): .globl callee callee: pop %eax add $4, %

    -2热度

    1回答

    所以我有一个任务要做,这需要从我到scanf a组装char*。我想这样的代码: .data INPUT_STRING: .string "Give me a string: " SCANF_STRING: .string "%s" PRINTF_STRING: .string "String: %s\n" .text .globl main .type main,