It is currently Fri Jun 05, 2020 8:40 am

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Need understanding
PostPosted: Wed May 27, 2009 8:25 am 

Joined: Wed May 27, 2009 8:07 am
Posts: 3
Just beginning a program and wanting to the program to print 'Input Equation'
I amwondering if anyone can shed a light on what is the subroutine function 'lea'? Is there a better way to write this?
I tried using the following but cant get it to work.

add.l #4,sp
add.l #PROMPT,sp

ORG $1000

start move.b #14,d0 ;Display instructions
lea prompt,a1
trap #15

prompt dc.b ' Input Equation:'

END $1000

 Post subject:
PostPosted: Wed May 27, 2009 12:44 pm 
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1122
I've added some comments to explain what this code does: (The code is not case sensitive. I have capitalized some words just to make them stand out in this post.)

* This locates the program code at address $1000 in the 68000 memory
    ORG $1000

* The START label is used by the END directive to tell EASy68K
* where to begin program execution.

* The EASy68K simulator has some built in commands that are accessed
* through trap #15. The task number of the command is placed in register
* D0. Other registers may also be used to contain additional parameters.
* Trap task #14 will display the NULL terminated string who's address
* is in register A1.
* This instruction places the number 14 in register D0.
    move.b #14,D0 ;Display instructions

* The lea instruction places the address of PROMPT into register a1
* This parameter is needed by trap task #14. It tells it where the message
* to display is located.
    lea PROMPT,a1

* This performs the trap task
    trap #15

* This places the text ' Input Equation:' in memory. ,0 at the end is
* the NULL character that terminates the string. Required by task #14.
PROMPT dc.b ' Input Equation:',0

* End of the source file and defines the starting location.
    END    START

Prof. Kelly

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group