ورود

View Full Version : سوال: لطفا راهنماییم کنید



zahra2015
سه شنبه 15 اردیبهشت 1394, 12:32 عصر
سلام دوستان این برنامه خروجیش فقط گوشه سمت چپ بالاست باید چیکارش کنم که تو چهار گوشه اسممو چاپ کنه؟



; this sample prints 16x16 color map,
; it uses all possible colors.


name "zahra"


org 100h




; set video mode:
; text mode. 80x25. 16 colors. 8 pages.
mov ax, 3
int 10h


; blinking disabled for compatibility with dos,
; emulator and windows prompt do not blink anyway.
mov ax, 1003h
mov bx, 0 ; disable blinking.
int 10h





mov dl, 0 ; current column.
mov dh, 0 ; current row.


mov bl, 0 ; current attributes.


jmp next_char


next_row:
inc dh
cmp dh, 4
je stop_print
mov dl, 0


next_char:


; set cursor position at (dl,dh):
mov ah, 02h
int 10h


mov al, 'a'
mov bh, 0
mov cx, 1
mov ah, 09h
int 10h


inc bl ; next attributes.


inc dl
cmp dl, 4
je next_row
jmp next_char


stop_print:


; set cursor position at (dl,dh):
mov dl, 10 ; column.
mov dh, 5 ; row.
mov ah, 02h
int 10h


; test of teletype output,
; it uses color attributes
; at current cursor position:
mov al, 'x'
mov ah, 0eh
int 10h




; wait for any key press:
mov ah, 0
int 16h


ret

masoud.8086
سه شنبه 15 اردیبهشت 1394, 13:10 عصر
سلام
اینجا برای رفع مشکلات است نه اینکه یکی بیاد برنامشو بدازه دیگران براش انجام بده..این برنامرو فراموش کنید ..برای این برنامه اول بیاد رشته مورد نظرتونو داخل دیتا سگمنت تعریف کرده بعد بیاید با وقفه int 21h / ah,09 اونو چاپ کنید و بعد با استفاده از وقفه جابه جایی مکان نما int 10 / ah.02 مکان نما را به گوشه سمت راست و هر جا خواستید ببرید و با استفاده از وقفه بالا دوباره همون رشته رو چاپ کنید.. موفق باشید

golbafan
سه شنبه 15 اردیبهشت 1394, 13:23 عصر
سلام کد زیر جواب شماست:



Jmp cjc

corner db, 'golbafan $'
corner1 db, 'golbafan $'
corner2 db, 'golbafan $'
corner3 db, 'golbafan $'
corner4 db, 'golbafan $'

cjc:

;Create a Whole Black Box to the Screen
mov ah, 06
mov al, 00
mov bh, 07
mov ch, 00
mov cl, 00
mov dh, 24
mov dl, 79
int 10h

;Create a Box on the Upper Left corner of the Screen
mov ah, 06
mov al, 00
mov bh, 01h
mov ch, 00
mov cl, 00
mov dh, 0
mov dl, 14
int 10h

;Create a Box on the Upper Right corner of the Screen
mov ah, 06
mov al, 00
mov bh, 01h
mov ch, 0
mov cl, 64
mov dh, 0
mov dl, 79
int 10h

;Create a Box on the Center of the Screen
mov ah, 06
mov al, 00
mov bh, 01h
mov ch, 12
mov cl, 34
mov dh, 12
mov dl, 48
int 10h

;Create a Box on the Bottom Left corner of the Screen
mov ah, 06
mov al, 00
mov bh, 01h
mov ch, 23
mov cl, 00
mov dh, 23
mov dl, 14
int 10h

;Create a Box on the Bottom Right corner of the Screen
mov ah, 06
mov al, 00
mov bh, 01h
mov ch, 23
mov cl, 64
mov dh, 23
mov dl, 79
int 10h

;Move the cursor to the Top Left of the screen
mov ah, 02
mov bh, 00
mov dl, 00
mov dh, 00
int 10h

;Display the text stored in corner
mov ah, 09h
lea dx, corner
int 21h

;Move the cursor to the Top Right of the screen
mov ah, 02
mov bh, 00
mov dl, 00
mov dh, 23
int 10h

;Display the text stored in corner1
mov ah, 09h
lea dx, corner1
int 21h

;Move the cursor to the Bottom Left of the screen
mov ah, 02
mov bh, 00
mov dl, 64
mov dh, 00
int 10h

;Display the text stored in corner2
mov ah, 09h
lea dx, corner2
int 21h

;Move the cursor to the Center of the screen
mov ah, 02
mov bh, 00
mov dl, 64
mov dh, 23
int 10h

;Display the text stored in corner3
mov ah, 09h
lea dx, corner3
int 21h

;Move the cursor to the Bottom Right of the screen
mov ah, 02
mov bh, 00
mov dl, 34
mov dh, 12
int 10h

;Display the text stored in corner4
mov ah, 09h
lea dx, corner4
int 21h