| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 900 人关注过本帖
标题:刚学汇编,出错了
只看楼主 加入收藏
diaoxue
Rank: 1
等 级:新手上路
帖 子:142
专家分:0
注 册:2007-6-1
收藏
 问题点数:0 回复次数:1 
刚学汇编,出错了

比较两个带符号数的大小,若A>B,则显示出“A>B”,否则同理
我抄的程序,怎么出错了
org 100h ; set location counter to 100h

; you may customize this and other start-up templates
; the location of this template: c:\emu8086\inc\0_com_template.txt

; this is just a random code

mov ax, 1234h ; load ax with hexadecimal value.
mov dx, 0x1234 ; 0x is a valid hexadecimal prefix too.
mov ax, 1234 ; load ax with 04D2h = decimal 1234 = 10011010010b.
mov ax, 0ABCDh ; must have 0 prefix if first digit is A,B,C,D,E or F
mov dx, 0xABCD ; or use 0x prefix.
mov dl, TeSt1 ; assembler is not case sensitive, test1=TeSt1, AX=ax, etc...
jmp $1 ; jump +1 byte to skip over variable.
test1 db 20h ; 1 byte variable 20h = 32.
add dl, dl ; dl = dl+dl = 20h+20h = 40h = 64 = 01000000b.
inc dl ; dl = dl+1 = 41h = 65 = 'A' (ascii code).
mov ah, 2 ; ah and dl are parameters for int 21h.
int 21h ; print 'A'.
mov al, 11100101b ; b suffix is for binary. 11100101b = 0xE5 = 229
xor al, 1111_1110b ; _ can separate nibbles.

stack segment stack
dw 64 dup(?)
stack ends
data segment
a db 76h
b db 4ch
data ends
code segment
assume cs:code,ds:data,ss:stack
start:mov ax,data
mov ds,ax
mov al,a
cmp b,al
jge bga
mov dl,'a'
mov bl,'b'
jmp disp
bga:mov dl.'b' ;error
mov bl,'a'
disp:mov ah,2
int 21h
mov dl,'>'
int 21h
mov dl,bl
int 21h
mov ah,4ch
int 21h
code ends
end start

ret ; return to operating system.

搜索更多相关主题的帖子: 汇编 
2007-10-25 11:18
Kid_X
Rank: 7Rank: 7Rank: 7
等 级:黑侠
帖 子:216
专家分:515
注 册:2007-10-8
收藏
得分:0 
刚学汇编,看不懂
2007-10-25 12:54
快速回复:刚学汇编,出错了
数据加载中...
 
   



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

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