Solved

how to input a number into an array

Posted on 2007-11-26
12
695 Views
Last Modified: 2008-02-02
Machine language array insert explanation pep8
0
Comment
Question by:tagtekin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

 

Author Comment

by:tagtekin
ID: 20400478
I dont see any pep 8 here they are all pythone
0
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This article is in regards to the Cisco QSFP-4SFP10G-CU1M cables, which are designed to uplink/downlink 40GB ports to 10GB SFP ports. I recently experienced this and found very little configuration documentation on how these are supposed to be confi…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

636 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