我正在嘗試編寫一個簡單的程序,可以在不使用Linux系統調用或標準C庫函數之一的情況下打印出C字符串。這只是爲了學習的目的,我絕不會在生產中這樣做(除非我真的很擅長)=)。 首先我的系統信息: [[email protected] sandbox-print_chars]$ uname -a
Linux fedora.laptop 2.6.35.14-106.fc14.i686.PAE #1 S
我很努力地找到一種方法來檢索GAS中第一個命令行參數的第一個字符。爲了澄清我的意思是我如何做到這一點在NASM: main:
pop ebx
pop ebx
pop ebx ; get first argument string address into EBX register
cmp byte [ebx], 45 ; compare the firs
這是來自內核代碼中header.S文件的代碼片段。我無法理解lretw指令的功能。我已經檢查過這麼多在線資源的說明。 # We will have entered with %cs = %ds+0x20, normalize %cs so
# it is on par with the other segments.
pushw %ds
pushw $6f
l