ورود

View Full Version : عدم اجرای چند وقفه پشت سر هم ؟



one hacker alone
سه شنبه 25 تیر 1392, 15:26 عصر
با یاد خدا
سلام دوستان
من خونه هایی از صفحه نمایش رو که مختصات میدم قبلش با Video Bios function رنگشون رو تنظیم میکنم بعد مختصات میدم تا رنگش کنه اما مشکل اینه که وقتی مثلا 3 بار دستور زیر رو اجرا میکنم میبینم فقط رنگ اخری روی همشون اعمال میشه
یعنی شما فرض کنید من بخوام پرچم ایران رو بکشم رنگ اخر که قرمز باشه روی تمام صفحه اعمال میشه و کل صفحه قرمز میشه
کد زیر مربوط به رنگ کردن یکی از سطر ها هست
نکته اینکه اگه از مقدا bh خود سرویس 06 استفاده کنم مشکلی ندارم اما از رنگ بندی خاص بخوام استفاده کنم به مشکل میخورم


mov ax,1010h ; Video BIOS function to change palette color
mov bx,5 ; color number 0 (usually background, black)
mov dh,29 ; red color value (0-63, not 0-255!)
mov ch, 55 ; green color component (0-63)
mov cl,62 ; blue color component (0-63)
int 10h ; Video BIOS interrupt


mov ah,6h
mov al,25
mov ch,0
mov cl,0
mov dh,2
mov dl,79
;mov bh,10111b
int 10h

m.j_banitaba
سه شنبه 25 تیر 1392, 15:41 عصر
لطفا کد کامل رو بذارید که می خواهید انجام بشه در ضمن عدد 25 برای al در سطر 10 به نظر زیاد میاد.

one hacker alone
چهارشنبه 26 تیر 1392, 00:24 صبح
;________________________________________
; Kernel
;==========###########==========
org 0x0 ; offset to 0, we will set segments later
bits 16 ; we are still in real mode

; we are loaded at linear address 0x10000

jmp main ; jump to main
;************************************************* ;
; Prints a string
; DS=>SI: 0 terminated string
;************************************************;
Print:
lodsb ; load next byte from string from SI to AL
or al, al ; Does AL=0?
jz PrintDone ; Yep, null terminator found-bail out
mov ah, 0eh ; Nope-Print the character
int 10h
jmp Print ; Repeat until null terminator found
PrintDone:
ret ; we are done, so return
;************************************************* ;
; Second Stage Loader Entry Point
;************************************************;
main:
cli ; clear interrupts
push cs ; Insure DS=CS
pop ds
;-----------------------------------------------------------------------header
mov ax,1010h ; Video BIOS function to change palette color
mov bx,5 ; color number 0 (usually background, black)
mov dh,29 ; red color value (0-63, not 0-255!)
mov ch, 55 ; green color component (0-63)
mov cl,62 ; blue color component (0-63)
int 10h ; Video BIOS interrupt


mov ah,6h
mov al,25
mov ch,0
mov cl,0
mov dh,2
mov dl,79
;mov bh,10111b
int 10h


;-----------------------------------------------------------------------middle
;mov ax,1010h ; Video BIOS function to change palette color
;mov bx,0 ; color number 0 (usually background, black)
;mov dh,47 ; red color value (0-63, not 0-255!)
;mov ch, 47 ; green color component (0-63)
;mov cl,47 ; blue color component (0-63)
;int 10h ; Video BIOS interrupt


mov ah,6h
mov al,25
mov ch,2
mov cl,0
mov dh,23
mov dl,79
mov bh,77h
int 10h
;-----------------------------------------------------------------------footer
mov ax,1010h ; Video BIOS function to change palette color
mov bx,0 ; color number 0 (usually background, black)
mov dh,5; red color value (0-63, not 0-255!)
mov ch, 43 ; green color component (0-63)
mov cl,40 ; blue color component (0-63)
int 10h ; Video BIOS interrupt

mov ah,6h
mov al,25
mov ch,23
mov cl,0
mov dh,24
mov dl,79
;mov bh,100001b
int 10h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dh,30 ; red color value (0-63, not 0-255!)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov ch, 0 ; green color component (0-63)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov cl,30 ; blue color component (0-63)
cli ; clear interrupts to prevent triple faults
hlt ; hault the syst


باید رنگ وصل خاکستری باشه
و رنگ هدر و فوتر متفاوت از هم یعنی 3 رنگ اما وقفه 10 در قسمت فوتر عمل نمیکنه و حافظه ی گرافیک همون حافظه ی هدر رو نگه میداره یعنی فوتر همون رنگ هدر رو داره
تازه برای رنگ دهی به سرویس 6 وقفه 10 از خود مقدار bh استفاده کردم که رنگ خاکستریش کار کرد اما برای هدر و فودر از گرافیک بایوس استفاده کردم چون نیاز به رنگ تنظیمی مورد نظر خودم داشتم اما اونم قاطی کرده

m.j_banitaba
چهارشنبه 26 تیر 1392, 05:49 صبح
1- در خطوط 51و68 باید همون مقداری رو بدی که در 64 و 80 استفاده می کنی
http://www.stanford.edu/class/cs140/projects/pintos/specs/freevga/vga/vga.htm
به قسمت dac دقت کن