- UID
- 62930
注册时间2009-7-24
阅读权限20
最后登录1970-1-1
以武会友
TA的每日心情 | 开心 2024-12-6 17:12 |
---|
签到天数: 6 天 [LV.2]偶尔看看I
|
- assume cs:code,ds:data
- data 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整除
- jz EVENNUM ; 如果能被整除
- 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
复制代码 |
|