【MASM】求絕對值程序

include io32.inc
.data

.code
start:
			call readsid	;輸入有符號數
			cmp eax,0		;EAX與0比較
			jge	nonneg		;EAX>=0轉移
			neg eax			;EAX<0取反
nonneg:		call dispuid	;輸出無符號結果
			exit 0
end start
  • 運行截圖
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章