|
[求助][求助]谁能给我一本汇编的数据结构的那种书啊???
这本书是我写的,正版的地址是http://www.docin.com/p-104444129.html |
|
[分享]汇编语言数据结构
源码可以在CSDN下载,地址http://download.csdn.net/source/2900557(需要10个积分) 也可在我的网站下载,地址http://www.zencai.com/Archive/ds.rar(完全免费) |
|
[分享]汇编语言数据结构
下载只需10元又不多,在线阅读免费。 |
|
[原创]汇编语言实现队列
在前面的介绍队列的小节中源代码,并不优美,极易上溢或下溢。队尾指针超越了队列空间的上界(即队满)而不能做入队操作,称之为上溢。队头指针小于了队列空间的下界(即队空)而不能做出队操作,称之为下溢。 为了防止队列的上溢、下溢,统计队列的元素总数以及队列的大小,我们可以定义如下结构: Queue strcut front dword 0 rear dword 0 count dword 0 queueSize dword 5 element dword 5 dup(0) Queue ends 源代码 源代码Queue2.asm: . .386 .model flat,stdcall option casemap:none include windows.inc include user32.inc includelib user32.lib include kernel32.inc includelib kernel32.lib include queue.inc .data QueueA queue<> ;声明队列结构的变量 szCaption db '消息框!',0 szText db 100 dup(0) szCharsFormat db '第%d出队:%d',0 .code ;----------------------------------------------------------------- ;置空队 InitQueue proc uses esi q:ptr queue mov esi,q mov (queue ptr [esi]).front,0 mov (queue ptr [esi]).rear,0 mov (queue ptr [esi]).count,0 ret InitQueue endp ;判队空,队空返回1,队非空返回0 QueueEmpty proc uses esi q:ptr queue mov esi,q mov eax,(queue ptr [esi]).count cmp eax,0 jg LE1 mov eax,1 jmp LE2 LE1: mov eax,0 jmp LE2 LE2: ret QueueEmpty endp ;判队满,队满返回1,队未满返回0 QueueFull proc uses esi q:ptr queue mov esi,q mov eax,(queue ptr [esi]).count cmp eax,(queue ptr [esi]).queueSize jl LF1 mov eax,1 jmp LF2 LF1: mov eax,0 jmp LF2 LF2: ret QueueFull endp ;入队 ,队满返回-1,入队成功返回1 EnQueue proc uses esi ebx q:ptr queue,newElement:dword mov esi,q ;队满上溢 invoke QueueFull,esi cmp eax,1 je L1 ;队列元素个数加1 inc (queue ptr [esi]).count ;新元素插入到队尾 mov eax,newElement mov ebx,(queue ptr [esi]).rear mov (queue ptr [esi]).element[ebx*4],eax ;将队尾指针加1 inc (queue ptr [esi]).rear mov eax,1 jmp L2 L1: mov eax,-1 jmp L2 L2: ret EnQueue endp ;出队,队空则返回-1,出队成功返回元素 DeQueue proc uses esi ebx q:ptr queue mov esi,q invoke QueueEmpty,q ;队空下溢 cmp eax,1 je LD1 ;取队头元素 mov ebx,(queue ptr [esi]).front mov eax,(queue ptr [esi]).element[ebx*4] ;队列元素个数减1 dec (queue ptr [esi]).count ;将队头指针加1 inc (queue ptr [esi]).front jmp LD2 LD1: mov eax,-1 jmp LD2 LD2: ret DeQueue endp start: ;入队 invoke EnQueue,addr QueueA,1 cmp eax,-1 je LM2 invoke EnQueue,addr QueueA,2 invoke EnQueue,addr QueueA,3 invoke EnQueue,addr QueueA,5 invoke EnQueue,addr QueueA,7 ;出队 mov ecx,5 LM1: invoke DeQueue,addr QueueA push ecx invoke wsprintf,addr szText, addr szCharsFormat, QueueA.front,eax invoke MessageBox,NULL,offset szText,offset szCaption,MB_OK pop ecx loop LM1 invoke ExitProcess,NULL LM2: end start MakeFile: NAME=Queue2 OBJS=$(NAME).obj LINK_FLAG=/subsystem:windows ML_FLAG=/c /coff $(NAME).exe:$(OBJS) Link $(LINK_FLAG) $(OBJS) .asm.obj: ml $(ML_FLAG) $< clean: del *.obj 定义队列结构的文件如下: queue.inc queue struct front dword 0 rear dword 0 count dword 0 queueSize dword 5 element dword 5 dup(0) queue ends 笔者实测发现,过程EnQueue内部声明了标号L1,L2,则过程QueueFull内部不能声明一样的L1,L2,因为EnQueue调用了QueueFull。对于没有嵌用关系的过程,则其标号可以一样。此处的标号指的是标号名加冒号的格式。 |
|
[求助]汇编标号问题
标号名加冒号是局部标号啊。 |
|
[求助]汇编标号问题
两个过程参数是完全不同的,MASM10支持不同的过程定义相同的标号(标号格式为:标号名加冒号)。编译是可以通过的。 |
|
[必读]新人导航和报到贴(报到时勿另发帖)
wibe报道。 |
|
[求助]学习C语言的书籍
可以看看我写的这本书(作为入门), http://www.docin.com/p-44509280.html 然后看 The C Programming Language (2nd Edition) 作者: Brian W. Kernighan / Dennis M. Ritchie 最后,多看源代码。 |
|
[求助]网页密码有哪些加密方式啊
一般为MD5加密 |
|
[原创]构建汇编编程环境(MASM32)
MASMPlus 是一个使用纯 MASM 编写的 MASM Integrate Develop Environment. 专业汇编程序员90%均使用 MASM,为它开发的编辑器非常多,其中最有名的是 RadASM, 而现在,真正能与 RadASM 同级的就只有 MASMPlus 了,理由是只有 MASMPlus 与 RadASM 一样编写了自定义编辑类,并且比它更出色,只有自已的类,才能在各方面尽情发挥,在量身定制方面,MASMPlus 更是费尽心思,笔者长时间从事工业硬件汇编程序编写,认识到对于专业汇编程序员而言,最重要的,就是代码书写,不需要华而不实的界面,不需要莫名其妙的功能,不需要可有可无的设置,更不需要所谓的封装,总的来说, MASMPlus 是半自动,这也是 MASMPlus 没有取名为 MASMIDE 的主要原因. MASMPlus 工程模式极为简单,简单但并不简陋,这种小巧方便的工程管理方式,能同时打开任意多个单个文件/工程,各自编译/链接互不相关,工程单个文件属性设置,带来的,是真正的多工程,一个工程,可以包含多个主程序,多个动态库,多个静态库,组的设置,各库之间关键字搜索相互独立,共享文件全局搜索,并可实现简单方便的混合编程.你需要做的只是稍稍设置参数,按 Ctrl+1 即可一步完成所有操作.MASMPlus 还可以导出工程为模板,可以完全用于工程的发布,因为导出时,MASMPlus 会将工程中所有文件全部打包进apt中,而这个文件交给其它人时,可以直接使用它创建新工程而不会破坏apt.同时,MASMPlus 的工程模块拥有独一无二的功能:保存附加信息,它在每次关闭工程时将工程所有文件的撤消缓冲保存到工程app中,用户在下次重新打开时可以继续上一次的撤消,如果中间没有使用其它工具编辑文件, MASMPlus 可以记录整个软件的编写过程.详细请参考 "使用工程" 一节. 代码辅助书写方面,MASMPlus 可以说是做得最好的一个编辑器,函数原型参数突出显示,标志参数自动列出,全局搜索可以搜索整个工程,全部关键字列出慢慢浏览,自动大小写支持全部关键字,结构类型变量成员列出,鼠标提示关键字信息,同时,输入与列出遵守一定的编程规则,不会误导使用者,详细请参考 "语法提示规则" 一节. 查找方面 MASMPlus 支持正则表达式查找与替换,这是一个自主开发的正则表达式引擎,同时它的库已带入 MASMPlus,MASMPlus 使用者可直接在自己的程序中使用,MASMPlus 的正则表达式语法与通用的略有不同,详细使用及规则请参考 "正则表达式" 一节. 同时,MASMPlus 支持插件开发,通过装植插件,可以扩展程序功能,尤其是窗口类插件,这种创新的插件模型,可以让 MASMPlus 扩展成为任何编辑器,随着之后插件的增加,使用者会发现 MASMPlus 能打开各种各样的文件,如果您是专业程序员,想为 MASMPlus 编写插件,请参考 "PDK 开发手册" 一章.同时,官方已经预留了二个插件,一个是 "资源编辑器" ,另一个是 "调试器" ,不久这两个插件均会开发并内置在 MASMPlus 下述版本中. |
|
[求助]如何快速升级为正式会员?
挂论坛与发好的原创帖来赚虚拟币 |
|
[注意]成为会员需要 帖子数量不得小于 20 篇
谢谢提醒。。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值