יה אלה אני לא מאמיין אפשר להדביק

KingTSHM

New member
יה אלה אני לא מאמיין אפשר להדביק

טוב דבר ראשון מעניין אותי איך NO ידע שדילגתי על הקטע שהוא אמר לא לדלג:) דבר שני אני חויבתי להשתמש בתוכנה המוצלחת מפני שחייבו אותי עם איזה פרויקט בבית הספר ומפני נשמורי הנבונים לא בדיוק יודעים להשתמש בתוכנות `מתקדמות` כמו turbo (או לפחות זה הרושם שהם עושים) והם נתנו לי שלושים ושלוש על העבודה שלי בתוכנה הנ``ל (בזכות התיעוד המופלא שלי שאפילו הצלחתי לכתוב אותו באנגלית) וחוץ מזה הם רוצים שאני גם יעשה אפקטים אם איזה נורות שנמצאות בתוכנית הפלא שכתבו, אני לא חושב שאני יעתיק לכ mov bh,0 mov bl,1 mov cl,20 mov ch,2 start : mov dl,[bx] rol dl,1 jc negative ror dl,2 jc odd rol dl,1 shr dl,1 inc bl dec cl jnz start jz the_end jnz start וווואי זה עובד אפשר להעתיק מהתוכנית לכאן בעזרת העתק והדבק ואולי זה לא מסודר אבל עשיתי כמיטב יכולתי כדי לסדר (אני מקווה שאתה מבין את הקטע עם [bx] שלא טרחתי לסדר, לא העתקתי לך את כל התוכנית כמובן אלה רק את החלק הרלוונטי, הבעיה נוצרת בשורה שבע עם negative הוא רושם לי שזה משתנה בילתי חוקי (וזה צריך להיות תווית) אם זה כל כך קל להעתיק אז אני יכול אפילו לתת לך הסבר על ``הפונקציה`` כך המורה שלי תוען שקוראים לחלק מתרגילינו: ;this program checks the ;memory between 10h to 30h ;and if it find even number it ;divisive it by two and if it ;find odd number it multiplication it ;by three (this progran knows ;how to tackle with negative ;numbers). ווווואי זה ממש נפלא אני יכול להעתיק ולהדביק לך עוד הרבה עבודות נפלאות שלי אם רק תרצה, אם הייתי יודע שכך הוא ההיתי מעתיק ומדביק כל חיי באינטרנט אולי אם יהיה לך משעמם במיוחד גם תבדוק לי את הקטע הבא ב- C (בבקשה:)(הקטע הזה אמור להסביר ולתת תקווה לתלמידים חדשים שרוצים ללמוד הקצאה דינמית וקדומה וזה בערך הדבר הכי מושקע שעשיתי אז תתנהג עליו יפה ובלי ירידות מיותרות:)) Included files ****************************************************************************/ #include ``listIterator.h`` /* must be included */ #include <stdlib.h> /* to use malloc() */ #include <stdio.h> /* to use printf() */ /**************************************************************************** ListIterator functions ****************************************************************************/ /*-------------------------------------------------------------------------- Creates a ListIterator (on the heap) for the given list. Param: list - the list towhich it is attached. Returns: ListIterator - a pointer to the struct Iterator. on a failure to allocate memory for the iterator - returns 0 ---------------------------------------------------------------------------*/ ListIterator ListIterator_init(LinkedList list) { /* declaring of an iterator */ ListIterator itr; /* allocating memory for a struct Iterator on the heap. pay attention to the casting */ itr = (struct Iterator*) malloc(sizeof(struct Iterator)); /* check the success of the allocation */ if (itr == null) { return 0; /* on a case of a failure - return 0 */ } /* checking the argument that was passed to the function */ if (list == 0) { /* given list address is NULL */ free(itr); /* a new iterator can not be initialized - free it */ return 0; } /* given list is legal - the Iterator points to it (using its _list field)*/ itr -> _list = list; /* there is no need to initialize itr->_current field, it will be done using the ListIterator_first() function */ return itr; /* returns the pointer to the new iterator */ } /*-------------------------------------------------------------------------- Puts the Iterator on the first (not dummy) Node of its linked-list. Param: iterator - the iterator. Returns: 1 on success, 0 on failure. failure might happen when the list is empty. ---------------------------------------------------------------------------*/ int ListIterator_first(ListIterator iterator) { /* you will do it */ } /*-------------------------------------------------------------------------- Moves the Iterator to the next Node. Param: iterator - the iterator. Returns: 1 on success, 0 on failure. failure might happen when there is no next item. ---------------------------------------------------------------------------*/ int ListIterator_next(ListIterator iterator) { /* the given argument should be an iterator that was already allocated on the heap (using ListIterator_init() function) */ if (iterator == 0) { /* wrong argument */ return 0; } /* moving to the next Node is done by making _current point to the next Node. how do we reach to this next Node ? we use the field _next of the Node which is currently pointed by the iterator */ iterator-> _current = iterator->_current->_next; return 1; /* pay attention - in the case that the Iterator points to the LAST Node in the list - it will point to its _next - meaning: it will point NULL */ } /*-------------------------------------------------------------------------- Moves the Iterator to the previous Node. Param: iterator - the iterator. Returns: 1 on success, 0 on failure. failure might happen when there is no previous item. ---------------------------------------------------------------------------*/ int ListIterator_prev(ListIterator iterator) { /* you will do it */ } /*-------------------------------------------------------------------------- Returns the item that is pointed by the Node that the iterator points to. Param: iterator - the iterator. Returns: ListItem - the item pointed by the node. on a case of a failure, returns 0. ---------------------------------------------------------------------------*/ ListItem ListIterator_current(ListIterator iterator) { /* you will do it */ } /*-------------------------------------------------------------------------- checks if current Node is the last Node in the list. Param: iterator - the iterator. Returns: 1 - if it is the last item. 0 otherwise. ---------------------------------------------------------------------------*/ int ListIterator_isLast(ListIterator iterator) { /* you will do it */ } /*-------------------------------------------------------------------------- checks if current Node is the first Node in the list. Param: iterator - the iterator. Returns: 1 - if it is the first item. 0 otherwise. ---------------------------------------------------------------------------*/ int ListIterator_isFirst(ListIterator iterator) { /* you will do it */ } /**************************************************************************** EOF *****************************************************************************/ KINGTSHM שאומנם לא מצפה שמישהו באמת יקרא ויתקן אבל בכל זאת אולי MMMMMMMM יסכים למען החברה?:) בבקשה, בבקשה:)
 

N0

New member
טוב...

תסלח לי אם אני גם לא יקרא את הקטע בC אני פשוט יודע כבר הקצאה דינמית והוא ממש ארוך לי, ובכלל אתה לא קראת את הקיטורים שלי. בקשר לאסמבלר. 1. לפי מה שN0 הבין התוכנה בודקת אם מספר הוא חיובי וזוגי ואם כן מחלקת אותו ב2. 2. איפה אתה מגדיר את הליבלים של הnegative וה odd (אם העתקת את רוב התוכנה הם צריכים להיות איפשהו...) דבר שני הלבל שלך the_end תדפוק לך את כל התוכנית (אלא אם הEASYCPU שלך יותר טוב ממה שN0 מכיר) תקרא לא the_sof או משהו אסור שהמילה end תופיע בכלל כל עוד זה לא בסוף התוכנית. יכול להיות זה בגלל זה. והקומפיילר בכלל לא מגיע לבדוק את מיקום הליבלים האחרים כי הוא חושב שהתוכנית נגמרת שם... N0
 
למעלה