可以
从键盘上读入一个字符存入ds:[si],将字符与‘#‘进行比较。如果不是’#‘则继续循环,如果是’#‘则跳出到next
输出换行
输出字符串
assume cs:code, ds:data data segment x dw 91, 792, 8536, 65521, 2021 len equ $ - x data ends code segment start: mov ax, data mov ds, ax mov cx, len / 2 mov bp, 0 S: mov ax, ds:[bp] push cx call printNumber call printSpace pop cx add bp, 2 loop S mov ah, 4ch int 21h printNumber: mov si, 0 mov bx, 10 L1: mov dx, 0 div bx push dx inc si cmp ax, 0 jne L1 mov cx, si mov ah, 2 L2: pop dx add dl, 48 int 21h loop L2 ret printSpace: mov ah, 2 mov dl, 32 int 21h ret code ends end start
assume cs:code, ds:data data segment str db "assembly language, it's not difficult but tedious" len equ $ - str data ends code segment start: mov ax, data mov ds, ax mov si, 0 mov cx, len call strupr mov ah, 4ch int 21h strupr: L1: cmp BYTE PTR ds:[si], 97 jl L2 cmp BYTE PTR ds:[si], 122 jg L2 sub BYTE PTR ds:[si], 32 L2: inc si loop L1 ret code ends end start