汇编学习日志——add指令

在学习Intel汇编程序设计时,有下面一段话

The first two lines, because they are directives, contain no executable instructions. But the subsequent lines are assembly language instructions, each 5 bytes long. The hexadecimal values in the second column, such as B8 00010000are the actual instruction bytes.


TITLE Add and Substract
;This program adds and substracts 32-bit integers.
.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO,dwExitCode:DWORD
DumpRegs PROTO
.code
main PROC
    mov eax,4h
    add ebx,FFh //如果这里为0x7F的话(或者说小于7F),机器码为83 C3 7F,如果大于7F,则为81 C3 00000080
		//如果这里为eax,ecx,edx,小于0x7F 则为83 C0 7F,如果大于0x7F,则为05 00000080
		//所以ebx为基地址寄存器,在加法上,与其他三个寄存器是不同的
    call DumpRegs
	INVOKE ExitProcess,0
main ENDP
END main



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值