比较两个带符号数的大小,若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.