crazyman
חבר מתאריך 8.8.03
118 הודעות |
14:50 12.06.06 |
|
בעיה בתוכנית באסמבלר.
|
ערכתי לאחרונה בתאריך 12.06.06 בשעה 14:51 בברכה, crazyman התוכנית מקבל מספרים שונים החל מכתובת first ועד last. התוכנית צריכה להעביר את כל המספרים השליליים להתחלה ואת החיוביים לסוף.התוכנית שכתבתי היא:
.model small .stack 100h .data first dw 15 last dw 15 adress dw ? mone_neg dw 0 mone_pos dw 0 degel dw ? .code start: mov ax,@data mov ds,ax mov ah,0 mov si,20h mov di,30h mov bx,first l1: mov al, push ax call bdika pop dx cmp dx,1 jz positive mov ,al inc si jmp continue positive: mov ,al inc di continue: cmp bx,last jnz l1 mov bx,10 mov si,20 mov di,30 call moving pop mone_pos mov ax,mone_pos mov ,al pop mone_neg mov ax,mone_neg mov ,al jmp sof bdika: pop adress pop cx sub cx,0 jnz negative inc mone_pos jmp fin negative: inc mone_neg fin: push mone_neg push mone_pos push degel push adress ret moving: pop adress mov1: mov al, mov ,al inc bx inc si mov mone_neg,ax cmp ,ax jnz mov1 mov2: mov al, mov bx,ax inc bx inc di cmp di,mone_pos jbe mov2 push adress ret sof: mov ah,4ch int 21h end start
יש בעיה בתוכנית (התוכנית לא מבצעת את הנדרש) ואני לא מצליח לפתור אותה, מה יכולה להיות הבעיה? תודה רבהה לעוזרים
|
|
שתף
|
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד
|
| |