advice needed for basic program

From: davepenney (junglefunkin_at_yahoo.co.uk)
Date: 02/22/05


Date: Tue, 22 Feb 2005 09:03:08 -0500

hi, Im struggling to complete a simple task for the digital systems course
i am studying. The task was to make a program to ask for 10 numbers to be
entered, and then to display them in reverse order, ie it should look like

enter number: 2
enter number: 6
enter number: 8
enter number: 4
enter number: 9
enter number: 3
enter number: 2
enter number: 6
enter number: 2
enter number: 8

Number in reverse order are
8,2,6,2,3,9,4,8,6,2

I so far have managed to code it as to ask for 10 numbers and allocate
them to memory.

Can anyone advice me as to how to retreive these from memory and display
them. The program so far is

ORG $1000
STORE DS.W 10
Temp DS.L 1
                                        
Prompt DC.B 'Enter a number: ',0
CRLF DC.B '',0
Reply DC.B 'Number entered is: ',0
Bye DC.B 'Goodbye!',0
 
START ORG $1200
                                        
                                        
                                        
                                        
                                        
                                         

        MOVE #0,D7
        MOVEA #STORE,A2
Repeat LEA Prompt,A1
                        
        MOVE #14,D0
        TRAP #15
        MOVE #4,D0
        TRAP #15
                                        
                                        
        CMP #-1,D1
        BEQ Fin
                                                
                                        
                                        
        MOVE.L D1,Temp
        MOVE.L Temp,D1
        MOVE D1,(A2)
                                        
        LEA Reply,A1
        MOVE #14,D0
        TRAP #15
                                        
        MOVE #3,D0
        TRAP #15
        
                                        
                                         
        LEA CRLF,A1
        MOVE #13,D0
        TRAP #15
                
        ADD #1,D7
        CMP #9+1,D7
        ADDA #2,A2
        BNE REPEAT
                                        
        MOVE (A2),D4
                                        

Fin LEA Bye,A1
        MOVE #13,D0
        TRAP #15
        STOP #$2000
        END START

Thanks for your help,

David Penney.



Relevant Pages

  • TP 6.0 Request.: SVGA BGI / Unit + Graphics conversion + Memory usage
    ... => a way to display any modern type graphics files ... Mostly memory trouble. ... my problem is I do not know how to display the ... but on most websites the extended memeory info is based on DOS ...
    (comp.lang.pascal.borland)
  • Re: Text overlay on image then Save to JPEG with reasonable DPI for Online printshop
    ... > Let's suppose I have an image of 1500 X 1500 pixels of which I ... picture at the top right of the card, or whether it is actually the card ... memory (an invisible VB picture box or a memory bitmap or DIBSection or ... What you "display to the user" while he is ...
    (comp.lang.basic.visual.misc)
  • Re: Support of a large table
    ... >> display different parts within different controls of a vb app. ... >> One part of the XML file identifies information about processor cylces. ... >> demanding on memory. ... > Try to open it in vb with DOM first. ...
    (comp.lang.basic.visual.misc)
  • Re: Draw Performance Improvement
    ... > same bit depth and bit masks as the primary display driver. ... > and not the display card's video memory. ... For the display hardware to ...
    (microsoft.public.windowsce.platbuilder)
  • Re: How to display multiple images
    ... > the listbox, where whenever the user click on an image in the list, I ... > can display the image for him. ... only have one image in memory at a time, ... > I saw also a lot of talking about Toolkit related code, ...
    (comp.lang.java.programmer)