1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| assume cs:code,ds:data,ss:stack
data segment db 'welcome to masm!' db 2h,24h,71h data ends
stack segment dw 0,0,0,0,0,0,0,0 stack ends
code segment start: mov ax,data mov ds,ax mov ax,stack mov ss,ax mov sp,16 mov ax,0b872h mov es,ax mov cx,3 mov si,16 s1: push cx mov bx,0 mov bp,0 mov cx,16 s2: mov al,ds:[bx] mov es:[bp],al inc bx inc bp mov al,ds:[si] mov es:[bp],al inc bp loop s2 inc si mov ax,es add ax,0ah mov es,ax pop cx loop s1 g:mov cx,3 loop g mov ax,4c00h int 21h code ends end start
|