`
qwop
  • 浏览: 7636 次
  • 性别: Icon_minigender_1
  • 来自: 景德镇
最近访客 更多访客>>
社区版块
存档分类
最新评论

LODS LODSB LODSW LODSD 例子【载入串指令】

    博客分类:
  • asm
 
阅读更多
http://qwop.iteye.com/blog/1958761
// lodsb.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <string.h>

/************************************************************************/
/* 载入串指令														    
/* LODS LODSB LODSW LODSD 例子	
/*  运行结果:														    
/*	bcdef
/*	g1
/*	2345
/************************************************************************/
int main(int argc, char* argv[])
{

	char	s[33] = "abcdefg123456789";
	char	lodsb_chars[ 10 ] = {0};
	char	ret[ 10 ]	= {0};
	short	vWORD		= 0;	// 备用载入 字 数据
	int		vDWORD		= 0;	// 备用载入 双字 数据

	__asm {
		xor eax,eax // 清空eax
		lea esi, s  // esi 指向数据 s

		mov ecx, 2 // 执行两次 lodsb
		// 载入串指令: LODSB、LODSW、LODSD ;将 ESI 指向的数据载入到 AL/AX/EAX, 执行后 ESI 自动变化
		rep lodsb // mov al byte ptr [esi]; esi = esi + sizeof( byte );  
		
		// 数据载入到al中
		mov lodsb_chars[ 0 ], al  // b
		
		lodsb 
		mov lodsb_chars[ 1 ], al  // c
		
		lodsb 
		mov lodsb_chars[ 2 ], al  // d
		
		lodsb 
		mov lodsb_chars[ 3 ], al  // e
		
		lodsb 
		mov lodsb_chars[ 4 ], al  // f
		
		lodsw // 载入串 字 指令
		mov vWORD,ax			  // g1
		
		lodsd // 载入串 双字 指令
		mov vDWORD,eax			  // 2345
	}
	
	printf( "%s\r\n", lodsb_chars );
	
	strncpy( ret, (char*) &vWORD, 2 ); // 将字符串 ps 中 2 个字符复制到字符串 ret 中。
	printf( "%s\r\n", ret );
	
	strncpy( ret, ( char* ) &vDWORD, 4 ); // 将字符串 ps 中 4 个字符复制到字符串 ret 中。
	printf( "%s\r\n", ret );

	getchar();
	return 0;
}

分享到:
评论

相关推荐

    汇编语言指令系统、伪指令

    数据 传送 指令 通用数据传送指令 传送指令MOV 堆栈操作指令PUSH、POP ... MOVS、CMPS、LODS、STOS、SCAS 处理器   控制   指令 标志操作指令 CLC、STC、CLD、STD、CLI、STI 处理机控制指令 HLT

    汇编指令(chm格式)

    LODS 装入串. 把源串中的元素(字或字节)逐一装入AL或AX中. ( LODSB 传送字符. LODSW 传送字. LODSD 传送双字. ) STOS 保存串. 是LODS的逆过程. REP 当CX/ECX&lt;&gt;0时重复. REPE/REPZ 当ZF=1或比较结果相等...

    inout、jmp、lea、lods指令演示

    通过选择要播放的指令演示inout指令基本功能、段间间接转移jmp指令、有效地址传送lea指令及串读取指令

    lod-based-recommender-system:LODS RS,一种提供基于LOD的推荐系统的平台。 推荐DBpedia数据集中的所有内容

    LODS推荐系统LODS RS ,一种提供基于LODS推荐系统的平台。 推荐DBpedia数据集中的所有内容。动机为了使用测量确保不同数据类型之间的相似性评分,创建了分散的平台LODS RS 。屏幕截图安装要使用该应用程序,您应该...

    Microsoft Library MSDN4DOS.zip

    LODS/LODSB/LODSW/LODSD Load String Operand LOOP/LOOPcond Loop Control with CX Counter LSL Load Segment Limit LTR Load Task Register MOV Move Data MOV Move to/from Special Registers MOVS/MOVSB/MOVSW/...

    unity汽车插件包

    This model has 4 LODs so it can be used for PC and mobile projects. Technical Details: Model has 4 LOD's: -LOD0: 38670 tris -LOD1: 20121 tris -LOD2: 9521 tris -LOD3: 5126 tris Texture size: -...

    MESH Shader & Rendering.pdf

    MOTIVATION • Vegetation, undergrowth, greebles • Fine geometric detail at massive scale ...• Pre-computed topologies for LODs • Efficient submission of small objects • Flexible instancing

    Bakery - GPU Lightmapper

    unity3d gpu灯光烘焙插件Bakery - GPU Lightmapper 1.4 Features: - Physically correct baked lighting. All results were compared against Mitsuba offline ...- Supports LODs. - Supports baked prefabs.

    SimplygonSDKV4x86.rar

    Simplygon is a 3D computer graphics software for automatic 3D-optimization, based on proprietary methods for creating Level of detail LODs, through smart Polygon mesh reduction and other optimization ...

    Oak Trees Package v2.04

    This package contains a set of 6 highly detailed PBS oak trees – each consisting of 2 smoothly fading mesh based LODs and a billboard. The trees are manually modeled, carefully optimized, support ...

    Urban Traffic System 2018.2 (Apr 26, 2018 - latest version)

    and 11 models of people with 4 LODS each, necessary for the creation of urban traffic. Such as: 1. Mountainbike 2. Moped 3. GyroScooters 4. Vans 5. Motorcycle 6. Cars 7. Trucks 8. Semi 9. Buses Info ...

    Bakery - GPU Lightmapper 1.4

    Bakery is a high-end, production-ready, hassle-free GPU lightmapper, designed as an alternative to Enlighten and Progressive. NOTE: Requires modern Nvidia GPU (6xx or newer) and 64-...- Supports LODs.

    Bakery GPU Lightmapper1.4

    Bakery is a high-end, production-ready, hassle-free GPU lightmapper, designed as an alternative to Enlighten and Progressive....- Supports LODs. - Supports baked prefabs. ---如有问题请联系qq1083787402

    AT&T Assembly Language

    详细的揭示了linux下的AT&T汇编指令使用方法,给出了各种汇编指令,指令用法,以及相应的例程。其中包括一些如何使用汇编链接C语言库,汇编调用系统调用,汇编执行浮点运算,C语言内嵌汇编等。 Chapter 1: What Is ...

    Bakery - GPU Lightmapper 1.71.unitypackage

    - Supports LODs. - Supports baked prefabs. - Real-time ray traced preview can be additionally installed. Some notable games shipped using Bakery: Call of Duty Mobile Totally Accurate Battle ...

    Realistic Car HD 02 1.0.7z.baiduyun

    This model has 4 LODs so it can be used for PC and mobile projects. Technical Details: Model has 4 LOD's: -LOD0: 38670 tris -LOD1: 20121 tris -LOD2: 9521 tris -LOD3: 5126 tris Texture size:...

    C.V.P – Eucalyptus Forest v1.2

    - 165+ ready to use prefabs with LODs. - Trees, bushes and plants. - 8 Rocks and Cliffs PBR materials. - 6 Rock models. - 2 Cliff models. - 40 PBR Ground seamless textures. - 8 Terrain Layers ready to...

    Pro Radar Builder (Source Included) 3.0.1

    - Use Mesh Blips at different LODs - Use Prefab Blips - Height Tracking (tracking lines). - Use Advanced rotation tracking - Optional Blip Auto scaling functions -Visualize Design - Use Multiple...

    The Art of Assembly Language Programming

    You are visitor as of October 17, 1996. The Art of Assembly Language Programming &lt;br&gt;Forward Why Would Anyone Learn This Stuff? 1 What's Wrong With Assembly Language 2 What's Right With ...

    2012年三级PC填空400题

    2012年三级PC填空400题,要过级的快过来下载吧。

Global site tag (gtag.js) - Google Analytics