datas segment bufm dw 01h,02h,03h,04h,05h,06h,07h,08h,09h,0ah,0bh,0ch,0dh,0eh,0fh,10h,11h,12h,13h,14h org 40h bufn dw 0bh,0ch,0dh,0eh,0fh,10h,11h,12h,13h,14h,15h,16h,17h,18h,19h,1ah,1bh,1ch,1dh,1eh org 90h bufc dw 20 dup(?) org 100h rst db 4 dup(?),0dh,0ah,'$' datas ends stacks segment db 256 dup(?) stacks ends codes segment assume cs:codes,ds:datas,ss:stacks start: mov ax,datas mov ds,ax mov es,ax lea si,bufm lea di,bufc mov cx,20 l1: cld lodsw push cx push di mov cx,20 lea di,bufn repnz scasw pop di pop cx jz same stosw same: loop l1 mov si,0 mov cx,20 print: push cx; mov cl,4 mov ch,4 mov di,0 mov bx,bufc[si]; move: rol bx,cl mov al,bl and al,bl and al,0fh or al,30h cmp al,39h jbe l2 add al,7 l2: mov rst[di],al inc di dec ch jnz move lea dx,rst mov ah,09h int 21h pop cx add si,2 loop print mov ah,4ch int 21h codes ends end start