|
[通告]辞旧迎新看雪论坛exploit me挑战赛赛事细则
感觉这次比赛非常有意义。支持 。 |
|
[原创]操作系统开发之实现多系统引导
楼主汇编功力很深厚啊,佩服佩服。 |
|
[通告]看雪论坛正式成立技术小组
支持楼主,希望论坛越办越好。 |
|
[原创]进制转换器v2.0
支持负数转换只需要添加一个求补码运算函数即可。 |
|
[分享]胡扯]用OpenGL做了个机器人.呵呵
楼主图形学的功力不浅啊,能不能做一个3D场景出来,并且可以让机器人在里面自由活动呢? |
|
[专题二]汇编程序设计基础
希望像我一样初学汇编的朋友不要怕,要敢于在众大虾面前“献丑”,要不怕“丢脸”,还要有自信,尽自己所能把课题做出。经验是需要积累的,只有不断的实践才能掌握真正的知识。大虾们不要见笑,也希望你们能够做一下课题,因为你们编程的思路会对初学者产生一定的启发和影响。如果大家有什么好的课题,希望能够把它"捐献"出来,可以通过发发消息把课题给我(不过前提是不能太深了,我怕会吓走大多数人:),之后我再把它补上专题去,好让大家都受益。 |
|
[专题二]汇编程序设计基础
本周会继续更新课题,欢迎关注本专题:) |
|
[专题二]汇编程序设计基础
以下为我对[课题2.2](1)的一个解决方案。由于水平有限,所以只能写出这样的程序来。望各位见谅。 [课题2.2](1)解决方案一 ;-------------------------------------------------------------------- ;name:top2o2.asm ; ;purpose:show the capital or lowercase letter,leader letter and ; the follow-up letter which based on the letter given by user ;-------------------------------------------------------------------- assume cs:code,ds:data data segment out1 db 'please input a letter:','$' out2 db 'the capital/lowercase letter is:','$' out3 db 'the leader letter is:','$' out4 db 'the follow-up letter is:','$' out5 db 'press ESC to exit,or any other key to continue!','$' c db 0 c1 db 0 leader db 0 followup db 0 data ends code segment start:mov ax,data mov ds,ax s: lea dx,out1 mov ah,09 int 21h mov ah,01 int 21h mov ds:[c],al mov dl,0dh ;换行 mov ah,02 int 21h mov dl,0ah mov ah,02 int 21h mov bh,ds:[c] cmp bh,27 ;如果是ESC键,退出循环 jz e1 jmp e2 e1:jmp e e2:cmp bh,'a' ;判断是否大于'a' jz s0 ;等于时跳转到s0执行另一个分支 cmp bh,'a' ; jnc s3 ;大于'a'时跳转到s1判断是否小于'z' jmp s0 ;不符合条件时跳转到s0 s3:cmp bh,'z' ;判断是否小于'z' jc s1 ;小于'z'时跳转到s1 jmp s0 s1:sub bh,32 ;符合条件则说明c为小写字母,求它的大写字母 mov ds:[c1],bh jmp s2 ;不执行另一分支,直接执行条件分支后面的语句 s0:cmp bh,'A' ;判断是否大于'A' jz s ;等于'A'时跳转到s3 cmp bh,'A' ;继续判断是否小于'Z' jnc s4 ;大于'Z'则跳转到s3判断是否小于 jmp s s4:cmp bh,'Z' ;判断是否小于'Z' jc s5 ;小于'Z'则跳转到s5处,求小写字母 jmp s s5:add bh,32 ;求c的小写字母 mov ds:[c1],bh s2: mov bh,ds:[c] mov ds:[leader],bh mov ds:[followup],bh sub byte ptr ds:[leader],1 ;求c的前导字母 add byte ptr ds:[followup],1 ;求c的后续字母 lea dx,out2 mov ah,09 int 21h mov dl,ds:[c1] ;输出大写/小写字母 mov ah,02 int 21h mov dl,0dh ;换行 mov ah,02 int 21h mov dl,0ah mov ah,02 int 21h lea dx,out3 mov ah,09 int 21h mov dl,ds:[leader] ;输出前导字母 mov ah,02 int 21h mov dl,0dh ;换行 mov ah,02 int 21h mov dl,0ah mov ah,02 int 21h lea dx,out4 mov ah,09 int 21h mov dl,ds:[followup] ;输出后续字母 mov ah,02 int 21h mov dl,0dh ;换行 mov ah,02 int 21h mov dl,0ah mov ah,02 int 21h lea dx,out5 mov ah,09 int 21h mov dl,0dh ;换行 mov ah,02 int 21h mov dl,0ah mov ah,02 int 21h mov dl,0dh ;换行 mov ah,02 int 21h mov dl,0ah mov ah,02 int 21h jmp s e:mov ax,4c00h int 21h code ends end start [课题2.2](1)总结: 刚开始时以为做这个课题很简单,没想到真刀真强的做起来的时候,却又完全是另外一回事了。我先用C写了一个程序,然后将它一点点翻译成汇编,没想到中间遇到的那个挫折啊,我拿着一本字典看了又看,为的只是掌握那个比较指令和那些条件跳转指令,以做出各种条件分支来。刚开始时,总是会出现理解发生偏差的事情来,一个符合要求的条件分支写了改,改了写前前后后花了好几个小时。我感觉还是求前导和后续字母比较简单,不用作什么判断。 后来我想了个办法,把所有的条件去掉然后输入合法的字母来检测程序运行的正确性,然后才加入各种条件。没想到这个办法还挺管用,居然让我做出来这个程序了。大虾在这里可能要见笑了,可能是练得太少了,所以最后能做出来感到特别兴奋。 |
|
[原创]发一个我写的汇编编译器:虫虫汇编器v0.2
期待楼主的汇编器的更新版本。 |
|
[原创]发一个我写的汇编编译器:虫虫汇编器v0.2
效果很不错,楼主继续加油啊。 |
|
[原创]发一个我写的汇编编译器:虫虫汇编器v0.2
下载使用一下,谢谢楼主。 |
|
[原创]对 Hook 内核ntoskrnl'sZwQuerySystemInformation隐藏任务管理器进程名 的一点完善
很强悍啊,可惜我看起来有点吃力。不过得支持一下楼主的辛劳。 |
|
[注意]启用“课题+成果”的模式+成立“编程技术小组”(最近更新2008.6.27)
有作品当然是一件好事哦,我也希望能早日做出点成果来! |
|
[求助]一个寻路问题在汇编中如何实现
为什么不尝试一下用静态分配的空间来实现呢? |
|
“没有风”的汇编实验报告专题(更新至10)
实验9 根据材料编程 这个编程任务必须在进行下面的课程之前独立完成,因为后面的课程中,需要通过这个实验而获得的编程经验。 编程:在屏幕中间分别显示绿色、绿底红色、白底蓝色的字符串’welcome to masm!’. 编程所需的知识通过阅读、分析下面的材料获得。 80*25彩色字符模式显示缓冲区(以下简称为显示缓冲区)的结构: 内存地址空间中,B8000H~BFFFFH共32KB的空间,为80*25彩色字符模式的显示缓冲区。向这个地址空间写入数据,写入的内容将立即出现在显示器上。 在80*25彩色字符模式下,显示器可以显示25行,每行80个字符,每个字符可以有256种属性(背景色、背景色、闪烁、高亮等组合信息)。 这样,一个字符在显示缓冲区中就要占两个字节,分别存放字符的的ASCII码属性。 80*25模式下,一屏的内容在显示缓冲区中共占4000个字节。 显示缓冲区分为8页,每页4KB(约等于4000B),显示器可以显示任意一页的内容。一般情况下,显示第0页的内容。了就是说通常情况下,B8000H~B8F9F中的4000个字节的内容将出现在显示器上。 在一页显示缓冲区中: 偏移000~09F对应显示器上的第1行(80个字符占160个字节): 偏移0A0~13F对应显示器上的第2行: 偏移140~1DF对应显示器上的第3行。 依此类推,可以偏移F00~F9F对应显示器上的第25行。 即在一行中: 00~01单元对应显示器上的第1列。 02~03单元对应显示器上的第2列。 04~05单元对应显示器上的第3列。 依此类推,可知,9E~9F单元对应显示器上的第80列。 例如:在显示器的0行0列显示黑底绿色的字符串‘ABCDEF’ (‘A’的ASCII码值为41H,02H表示黑底绿色) 显示缓冲区里的内容为: 00 01 02 03 04 05 06 07 08 09 0A 0B 。。。0E 0F B800:0000 41 02 42 02 43 02 44 02 45 02 46 02 。。。 。。 。 。 B800:00A0 。。 。。 。。 。。 。。 。。 。。 。。 。。 。。 。。 。。 。。 可以看出,在显示缓冲区中,偶地址存放字符,奇地址存放字符的颜色属性。 一个在屏幕上显示的字符,具有前景(字符色)和背景(底色)两种颜色,字符还可以以高亮度和闪烁的方式显示。前景色、背景色、闪烁、高亮等信息被记录在属性字节中。 属性字节的格式: 7 6 5 4 3 2 1 0 含义 BL R G B 1 R G B 闪烁 背景 高亮 前景 R:红色 G:绿色 B:蓝色 我们可以按位设置属性字节,从而配出各种不同的前景色和背景色。 比如: 红底绿字,属性字节为:01000010B; 红底闪烁绿字,属性字节为:11000010B; 红底高亮绿字,属性字节为:01001010B; 黑底白字,属性字节为:00000111B; 白底蓝字,属性字节为:01110001B; 例:在显示器的0行0列显示红底高亮闪烁绿色的字符串‘ABCDEF’ (红底高亮闪烁绿色,属性字节为:11001010B,CAH) 显示缓冲区里的内容为: 00 01 02 03 04 05 06 07 08 09 0A 0B 。。9E 9F B800:0000 41 CA 42 CA 43 44 CA 45 46 CA 。。。 。。 。。。。。 。 。 B800:00A0 。。 。。 。。 。。 。。 。。 。。 。。 。。 。。 。。 。。 。。 注意:闪烁的效果必须在全屏DOS方式下才能看到。 解决方案一: ;---------- ;exp9.asm ;---------- ;--------- ;purpose:print 3 strings in the middle of screen by different colors ;--------- assume cs:code,ds:data data segment string0 dw 0277h,0265h,026ch,0263h,026fh,026dh,0265h,0220h,0274h,026fh,0220h,026dh,0261h,0273h,026dh,0221h string1 dw 2477h,2465h,246ch,2463h,246fh,246dh,2465h,2420h,2474h,246fh,2420h,246dh,2461h,2473h,246dh,2421h string2 dw 7177h,7165h,716ch,7163h,716fh,716dh,7165h,7120h,7174h,716fh,7120h,716dh,7161h,7173h,716dh,7121h data ends code segment start: mov ax,data mov ds,ax mov ax,0b800h mov es,ax lea si,string0 mov di,071Eh mov cx,16 s0: mov bx,[si] mov es:[di],bx add di,2 add si,2 loop s0 lea si,string1 mov di,07BEh mov cx,16 s1: mov bx,[si] mov es:[di],bx add di,2 add si,2 loop s1 lea si,string2 mov di,085Eh mov cx,16 s2: mov bx,[si] mov es:[di],bx add di,2 add si,2 loop s2 mov ax,4c00h int 21h code ends end start 实验总结: 实验总共花了我十多天的时间才完成(中间断断续续的写了改,改了写程序,最近有太多事要忙了 ),中间除了思索用什么方式完成功能之外,也在不断的调试BUG。程序要求用自己的方式将彩色字符串输出来,而不是调用中断输出。我考虑过在字符串后面加上一个终止符(随意一个特殊点的字符都行,读取到该字符时停止就行),不用说这个程序肯定要用循环来实现的,刚开始我想用一个循环将三个字符串输出,可是调试时BUG不断,原来保存字符串的方式也不太对,因为是一个字符对应一个属性,较好的方式就是将用字型数组来保存这三个字符串,这样我们要做的工作就是不断的读取这些字符并传送到显存中去即可。 中间走了一些弯路,如最后发觉用比较简单的方式就是用三个循环实现,前面我想用一个循环发觉不是不行,只是有一点点难度,要考虑变换段地址,判断是否读取完一个字符串,考虑条件跳转等因素。 为了尽快完成实验,我采取了我最能接受的方式,就是用三个循环来实现实验要求的功能,这样要做的变换只是每一次循环前要做的工作就是改变一下输出字符串开始的行和列就可以了。 |
|
[专题三]驱动程序设计基础-新增codeproject驱动教程(jingru提供)
很好,非常支持。继续加油。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值