نمونه برنامه زبان ماشین

یک برنامه نمونه که در سطرهای 4 و 16 کاراکتر ستاره را چاپ می کند و در سطر 10 رشته ی "welcome" را نمایش می دهد



dataseg segment 'data'
well db 'wellcome','$'
dataseg ends

codeseg segment 'code'
main proc far
assume ds:dataseg, cs:codeseg
mov ax,dataseg
mov ds,ax

call poin    
call stars
call point
call cls
call points
call star
mov ah,07h
int 21h
mov ax,4c00h
int 21h
main endp

poin proc near
mov ah,02h
mov dh,4
mov dl,0
mov bh,0
int 10h
ret
poin endp

stars proc near
mov ah,09h
mov al,5
mov bl,00000001b
mov cx,79
mov bh,0
int 10h
ret
stars endp

cls proc near
mov ah,09h
lea dx,well

int 21h
ret
cls endp

point proc near
mov ah,02h
mov dh,10
mov dl,35
mov bh,0
int 10h
ret
point endp

points proc near
mov ah,02h
mov dh,16
mov dl,0
mov bh,0
int 10h
ret
points endp



star proc near
mov ah,09h
mov al,5
mov bl,00000001b
mov cx,79
mov bh,0
int 10h
ret
star endp

chara proc near
mov ah,09h


int 21h
ret
chara endp

codeseg ends
end main

نظرات 0 + ارسال نظر
برای نمایش آواتار خود در این وبلاگ در سایت Gravatar.com ثبت نام کنید. (راهنما)
ایمیل شما بعد از ثبت نمایش داده نخواهد شد