EASy68K
http://www.easy68k.com/EASy68Kforum/

Need understanding
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=5&t=659
Page 1 of 1

Author:  malee79 [ Wed May 27, 2009 8:25 am ]
Post subject:  Need understanding

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

Author:  profkelly [ Wed May 27, 2009 12:44 pm ]
Post subject: 

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.)

Code:
------------------
* 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.
START

* 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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/