Solved

how to input a number into an array

Posted on 2007-11-26
12
657 Views
Last Modified: 2008-02-02
Machine language array insert explanation pep8
0
Comment
Question by:tagtekin
12 Comments
 
LVL 5

Expert Comment

by:abith
ID: 20355944
refer this link
http://www.experts-exchange.com/Programming/Languages/Assembly/Q_22956333.html (not-accepted one).

but there are something that related to array.

0
 
LVL 5

Expert Comment

by:abith
ID: 20355956
i am sorry i didnt notice that u want in pep8
0
 
LVL 5

Accepted Solution

by:
abith earned 50 total points
ID: 20355963
0
 

Author Comment

by:tagtekin
ID: 20400478
I dont see any pep 8 here they are all pythone
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Assisted Solution

by:BrianGEFF719
BrianGEFF719 earned 50 total points
ID: 20511983
I'm very good with PEP...I had some crazy professors who loved it. Why dont you post what you have so far and I can help you from there.

Here is a basic array example, I hope it helps.

This is a conversion of the following C++ program:

 int main()
 {
  int vector[4];
  int i;
  for(i=0;i<4;i++)
   cin >> vector[i];

  for(i = 3; i >=0; i--)
  cout <<i << ' ' << vector[i] << endl;

 return 0;
}


BR main

vector:  .EQUATE 2          ;LOCAL VARIABLE

i:       .EQUATE 2          ;LOCAL VARIABLE

main:    SUBSP   10,i       ;allocate 10 bytes for locals

         LDX     0,i        ;for(i = 0

         STX     i,s        

for1:    CPX     4,i        ; i<4

         BRGE    endFor1   

         ASLX               ;each element is 2 bytes

         DECI    vector,sx  ; cin >> vector[i]

         LDX     i,s

         ADDX    1,i

         STX     i,s

         BR      for1

endFor1: LDX     3,i        ;for(i = 3

         STX     i,s

for2:    CPX     0,i        ; i>=0

         BRLT    endFor2

         DECO    i,s        ; cout << i

         CHARO  ' ',i       ; << ' '

         ASLX               ;PEP uses 16bit ints (2bytes)

         DECO   vector,sx   ; << vector[i]

         CHARO  '\n',i      ; << endl

         LDX    i,s         ; i--

         SUBX   1,i

         STX    i,s

         BR     for2

endFor2: ADDSP  10,i        ;deallocate 10 bytes

         STOP

.END 

         

         

Open in new window

0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 20756532
@MBIZUP,

Abith posted a python link, highly irrelevant to the question at hand.

0
 
LVL 5

Expert Comment

by:abith
ID: 20784271
>>Abith posted a python link
  Yes

>> highly irrelevant to the question at hand.
  I posted the link just to understand the arrays concept in Pep8.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 20784475
>>  I posted the link just to understand the arrays concept in Pep8.

I don't see how Python and PEP are related. I'm not going to argue points, I'm happy to split if it will make your day. :-)

Brian
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20807292
Forced accept.

Computer101
EE Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Recommended programming language 7 383
Where/When does Bit endianness matters? 7 516
Cascading assemblies in .net libraries 4 354
Localization and Internationalization 17 362
What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now