assembly

    0熱度

    1回答

    我在網上看到很多教程,其中assembly language與C一起使用,以構建新的內核映像。但我不明白爲什麼要裝配,而C Compiler可以從c代碼生成asm。 使用assembly代碼進行內核編程的原因是什麼?以及如何在C下開發內核而不需要在asm中編寫代碼?

    0熱度

    1回答

    如果您有由數字構成的MIPS一個字陣列(5,3,0,19)已在,比方說,一個起始地址,$ T1,我添加到$ T1 (起始地址)我知道0($ t1)現在將包含而不是。但是,數組的實際內容會改變嗎?如在數組仍然是(5,3,0,19)或現在它會(3,0,19),因爲我添加到起始地址?

    0熱度

    1回答

    階段: 0x00000000004013d9 <+0>: sub $0x2c8,%rsp #reserve 0x2c8 in stack 0x00000000004013e0 <+7>: mov %rdi,%rsi #rsi = rdi 0x00000000004013e3 <+10>: movw $0x6cb,0x42(%rsp) #stack pointer + 0

    1熱度

    2回答

    我正在用匯編程序存在: xor eax, eax ; make eax equal to 0 push eax ; pushes null push 0x68732f2f ; pushes /sh (//) push 0x6e69622f ; pushes /bin mov ebx, esp ; passes the first argument push eax ; e

    2熱度

    1回答

    的算法如下: res <- 0 for i from 15 downto 0 do: change the ith bit of result to 1 if res^2 > x then: change the ith bit of res back to 0 return res 我完全理解它是如何工作的,但我不知道這是什麼方法被調用。我一直在尋找wik

    -1熱度

    1回答

    我試圖將C程序轉換爲MIPS彙編程序。以下是該程序我的C代碼:(注:燈泡[數字]是用於由用戶輸入的「數量」初始化爲全零個值的數組) for(int i = 1; i <= number; i++) for(int j = 1; j <= number; j++) if(j % i == 0) Bulbs[j-1] = (Bulbs[j-1] + 1)

    0熱度

    1回答

    以下內容做了什麼? testq %rdx, %rdx cmovg %rcx, %rax 我明白,testq是一個位和兩個寄存器之間,但它如何與標誌? 這將轉化爲c? 例如如果%rdx將持有價值0x01,那麼我們就會有0x01 & 0x01 = 0x01,這將設置 ZF = 0, SF = 0, OF = 0. 爲了什麼,我能找到,如果 ˜(SF ˆ OF) & ˜ZF 這將解決以進行

    1熱度

    2回答

    我想創建一個可以計算除法問題的程序。問題是當我嘗試用負數分割時,我的程序崩潰了,儘管我創建了一個名爲「DivNeg」的分支,該分支應該可以防止它崩潰。有沒有人有如何解決這個問題的想法? 這是我的彙編代碼 .386 .model flat public _Divide .code _Divide proc mov eax, [esp + 4] ; First addres

    0熱度

    1回答

    如果此問題聽起來很愚蠢,但我對shellcoding非常陌生,並且我試圖獲得一個適用於32位Linux機器的hello world示例。 由於這是shellcoding,我使用了一些技巧來刪除空字節並縮短代碼。在這裏,它是:下面的C代碼中。然而 $ nasm -f elf print4.asm $ ld -o print4 -m elf_i386 print4.o ,我試圖運行它: $貓sh

    -2熱度

    1回答

    我有以下的代碼組裝。但我不明白什麼是STT_FUNC? .section .rodata Lhello: .asciz "Hello!" .section .text .globl function1 .type function1, STT_FUNC function1: