Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; You may customize this and other start-up templates;
- ; The location of this template is c:\emu8086\inc\0_com_template.txt
- org 100h
- lea si,input
- lea di,output
- mov bx,0
- mov cx,len
- next:
- cmp [si],' '
- je n1
- inc count
- jmp stop
- n1:
- cmp bx,count
- jae skip
- store:
- mov bx,count
- mov count,0
- mov ax,len
- sub ax,cx
- mov dx,ax
- skip:
- mov count,0
- stop:
- inc si
- loop next
- cmp bx,count
- jb block2
- sub si,len
- add si,dx
- dec si
- mov cx,bx
- dec bx
- add di,bx
- block:
- mov al,[si]
- mov [di],al
- dec di
- dec si
- loop block
- jmp en
- block2:
- add di,count
- mov cx,count+1
- b23:
- mov al,[si]
- mov [di],al
- dec di
- dec si
- loop b23
- en:
- ret
- input db 'My is asdfghh blue'
- len equ ($-input)
- output db ?
- count dw 0
Advertisement
Add Comment
Please, Sign In to add comment