السلام عليكم
أنا برنامجي يسأل اليوزر ان يدخل عدد عناصر المصفوفه ثم اطبعها بهذه الشكل
Enter the number of elements 3 10 20 30 The numbers you are entered are: 10,20,30,Press any key to continue . . .
كتبت البرنامج بالC++ عشان اعرف كيف اكتبها بالإسمبلي
اشتغل معاي 100% بالC++ لكن لما رحت أكتبها بالإسمبلي يطبع آخر رقم أدخلته فقط مثل الOutput الي تحت
Enter the number of elements 3 10 20 The numbers you entered are:30,
فاالمطلوب أنه يطبع 10 و20 و30
لكن مشكلتي مع البرنامج انه يطبع آخر رقم فقط
كود الC++ الي اشتغل تمام
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int *a=NULL;
int n;
cout <<"Enter the number of elements\n";
cin >>n;
a=new int[n];
for(int i=0; i<n; i++)
{
cin>>a;
}
cout <<"The number you are entered are: ";
for(int i=0; i<n; i++)
{
cout<<a;
cout<<",";
}
return 0;
}وكود الإسمبلي الي مو راضي يشتغل معاي والي اطلب فيه مساعدتكم هذه هو
Title dosseg .model small .stack 100h INCLUDE io.mac .code Main proc mov ax,@data ; initialize DS mov ds,ax ; START YOUR PROGRAM AFTER THIS LINE putstr first nwln getint ax mov cx,ax start: nwln getint ax,cx loop start putstr show mov dl,',' putint ax putch dl ; DO NOT REMOVE THE FOLLWING LINES mov ax,4C00h int 21h Main endp .data ;-------------->>>>>>>>>>>> WRITE YOUR DATE DEFINITIONS AFTER THIS LINE <<<<<<< first db 'Enter the number of elements',0 start db '?',0 show db 'The numbers you entered are:',0 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end main
أتمنى منكم مساعدتي في كود الإسمبلي كيف أضبط الOutput