strcpy(asm)
assume cs:code,ds:datadata segment
strSou db 'Hello World!
wLen dw $ - offset strSou
strDis db offset wLen - offset strSou dup(')
data ends
code segment
start:mov ax, data
mov ds, ax
mov es, ax
mov si, offset strSou
mov di, offset strDis
cld
mov cx, wLen
test cx, 1h ; 判断长度能不能给2整除
jzEVENNUM ; 如果能被整除
shr cx, 1
;NEXT: movsw
; loop NEXT
rep movsw
movsb
jmp DISPLAY
EVENNUM:
;NEXT: movsw
; loop NEXT
shr cx, 1
rep movsw
DISPLAY:mov dx, offset strDis
mov ah, 9h
int 21h
mov ah, 4ch
int 21h
code ends
end start /:18
向牛人学习!~ 纯垃圾代码呀!
页:
[1]