שילוב אסמבלר ב C

VFR750F

New member
שילוב אסמבלר ב C

אהלן. אני צריך לכתוב תוכנית שתקרא נתונים ותרוץ כל הזמן - למעשה TSR שמשתמשת בפסיקת ISR שנכתבה מחדש על ידי ותכתוב את הנתונים האלה לתוך קובץ. לכאורה פשוט. את החלק של האסמבלר כתבתי בתוכנית ישנה שמחליפה בין האותיות y ל n והיא תקינה וגם עבודה עם קבצים ב c אני יודע. הבעיה כיצד אני מיישם את זה ? איך אני משלב בין 2 התוכניות ? TSR ב c ?? או לחילופין אם למישהו יש שיטה פשוטה וקלה לכתוב לקבצים באסמבלר - אני מוכן לקבל. בגדול התוכנית שצריכה לעבור את השינוי היא זאת : .model small .stack 100h .386 .code start: mov al,9h mov ah,35h ;get vector bx=ip es=cs int 21h mov ax,seg newisr ;enter the new segment to ax mov ds,ax mov dx,offset newisr ;enter the new address to dx mov al,9h mov ah,25h ;set vector of values :ds,dx int 21h mov ax,es ;mov the old vector to 0a0h mov ds,ax mov dx,bx mov al,0a0h mov ah,25h int 21h mov dx,0400h ;TSR int 27h ;EXIT newisr proc far pusha ;push all registers to the stack in al,60h ;gets scan code cmp al,15h ;compare with 'y' je switch ;jump if equel to yes cmp al,31h ;compare with 'n' jne orig ;jmp to origenal vector mov dl,'y' ;enter 'y' insted of 'n' jmp print ; skip yes loop switch: mov dl,'n' ;enter 'n' insted of 'y' print: mov ah,2h int 21h ;print 'n' or 'y' jmp eoi orig: int 0a0h ;the origenal vector eoi: mov al,61h out 20h,al ;send EOI popa ;pop al registers iret ; newisr endp end
 
בגדול את יכו לשלב asm ב-C

תסתכל על הקישור המצורף (וגם תחפש עוד קצת ב-google אם אתה משתמש ב-compiler אחר לא של מיקרוסופט תחפש ב-google על השיטה של ה-compiler שלך
 
למעלה