| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 9448 人关注过本帖
标题:计算机
只看楼主 加入收藏
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 

In AT&T syntax the size of memory operands is determined from the last character of the op-code name.

Op-code suffixes of ’b’, ’w’, and ’l’ specify byte(8-bit), word(16-bit), and long(32-bit) memory references.

Intel syntax accomplishes this by prefixing memory operands (not the op-codes) with ’byte ptr’, ’word ptr’, and ’dword ptr’.

Thus, Intel "mov al, byte ptr foo" is "movb foo, %al" in AT&T syntax.

The quieter you become, the more you can hear
2012-10-02 01:50
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
Memory Operands.
In Intel syntax the base register is enclosed in ’[’ and ’]’ where as in AT&T they change to ’(’ and ’)’. Additionally, in Intel syntax an indirect memory reference is like

section:[base + index*scale + disp], which changes to

section:disp(base, index, scale) in AT&T.

One point to bear in mind is that, when a constant is used for disp/scale, ’$’ shouldn’t be prefixed.

The quieter you become, the more you can hear
2012-10-02 01:55
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
 Protected Mode and Real Mode each use a different format for the interrupt table — PM uses an 8-byte entry per interrupt and RM uses a 4-byte entry.

The quieter you become, the more you can hear
2012-10-02 12:39
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
sidt 语句
图片附件: 游客没有浏览图片的权限,请 登录注册

The quieter you become, the more you can hear
2012-10-02 15:24
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
In some cases, a single variable may serve as both the input and the output operand.

asm( "incl %0" : "=a"(var): "0"(var));

The register %eax is used as both the input and the output variable.

var input is read to %eax and updated %eax is stored in var again after increment.

"0" here specifies the same constraint as the 0th output variable

The quieter you become, the more you can hear
2012-10-02 16:26
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
out 语句
Usage: OUT port,accum

Modifies Flags: None

Transfers byte in AL,word in AX or dword in EAX to the specified hardware port address.

If the port number is in the range of 0-255 it can be specified as an immediate.

If greater than 255 then the port number must be specified in DX.

Since the PC only decodes 10 bits of the port address, values over 1023 can only be decoded by third party vendor equipment and also map to the port range 0-1023.


[ 本帖最后由 madfrogme 于 2012-10-2 17:36 编辑 ]

The quieter you become, the more you can hear
2012-10-02 16:35
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
If BIOS is to recognize a device as a bootable device,

then the device should have the values 0x55 and 0xaa at the 510th and 511th location.

The quieter you become, the more you can hear
2012-10-02 21:04
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
LODSB loads a byte from [DS:SI] or [DS:ESI] into AL. It then increments or decrements (depending on the direction flag: increments if the flag is clear, decrements if it is set) SI or ESI.

The quieter you become, the more you can hear
2012-10-03 20:16
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
pushl %ebx     # equivalent instructions
                                    subl $4,  %esp
                                    movl %ebx, (%esp)


popl %ebx             # equivalent instructions
                                movl (%esp), %ebx
                                addl   $4, %esp

The quieter you become, the more you can hear
2012-10-03 23:23
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
MOV [SI], AX.      

Will write the word contained in ax to the address DS:SI

MOV   ES:[DI],  AX.          

Will write the word contained in ax to the address es:di

COMSB  

will compare the byte at DS:SI to the byte at ES:DI,    set the zero flag if they are equal and decrement /increment SI and DI according to the state of the directing flag

The quieter you become, the more you can hear
2012-10-04 11:47
快速回复:计算机
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028712 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved