我寫了一個彙編程序(x86_64的Linux的NASM)讀取用戶輸入打印整數安慰,總部設在算法提出我的意見在這個post,這基本上是這樣的: divide number x by 10, giving quotient q and remainder r
emit r
if q is not zero, set x = q and repeat
所有下面的腳本下工作得很好: section
我正在使用x86_64 Linux Assembly,我被要求將一個字符的三個低位(來自用戶輸入)設置爲1,然後打印出結果字符。爲了說明 Input: b ; ASCII in binary: 01100010
Set the last 3 bits to 1:
01100010 -> 01100111
Output: g ; ASCII in binary: 01100111