我想解決我得到的練習。任務是從終端讀取10個整數並以相反的順序打印出來。要做到這一點,應該使用堆棧。我已經試過這樣: %include "asm_io.inc"
segment .data
prompt db "Please enter a number: ", 0
segment .text
global asm_main
asm_main:
enter 0,
我是新來的彙編,並試圖迭代存儲在內存中的字符串。我可以使用lea(加載有效地址)指令得到字符串的地址,但我現在想使用存儲在寄存器中的那個地址。 有模lw其可以使用如下: lea string, %edx ; Load effective address of string into edx
lw %edx, %eax ; Load eax with the value stored wher
當我們有這樣的代碼: main: MOV #SFE(CSTACK), SP ; set up stack
;;; some instructions .......
; load the starting address of the array1 into the register R4
MOV.W #arr1, R4
; load the st
我們知道C++使用vftable來動態地決定應該調用哪個虛函數。當我們調用虛函數時,我想找出它背後的機制。我編譯了下面的代碼進行彙編。 using namespace std;
class Animal {
int age;
public:
virtual void speak() {}
virtual void wash() {}
};
class Ca
我正在爲stm32l152C-discovery板執行arm cortex-m3的C代碼,但是我發現main函數調用沒有被推入堆棧。我已經分析了這個源的asm代碼,但是我發現它是可以的。爲了更好的理解,請看這裏的C代碼生成的彙編代碼: main.elf: file format elf32-littlearm
*SYMBOL TABLE:
00000010 l d .text 000000