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,