EASy68K  
It is currently Thu Mar 23, 2017 2:11 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Jan 23, 2016 6:16 pm 
Offline

Joined: Sat Jan 23, 2016 6:08 pm
Posts: 3
Hi ,
please someone can help me , i have to write a program that includes a subroutine that multiplies unsigned integers each coded on 16 bits, passing the parameters by address. we will show each integer and the product obtained. I'm not used to pass parameters by address so I do not know how to do it.
thank you in adavnce


Top
 Profile  
Reply with quote  
PostPosted: Sat Jan 23, 2016 6:25 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1035
Location: Monroe County Community College, Monroe Michigan, U.S.A.
This question has been answered in a previous post:

http://easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1136&hilit=parameter

_________________
Prof. Kelly


Top
 Profile  
Reply with quote  
PostPosted: Sat Jan 23, 2016 6:29 pm 
Offline

Joined: Sat Jan 23, 2016 6:08 pm
Posts: 3
profkelly wrote:
This question has been answered in a previous post:

http://easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1136&hilit=parameter

thank you i'll try to understand it


Top
 Profile  
Reply with quote  
PostPosted: Sat Jan 23, 2016 9:00 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1035
Location: Monroe County Community College, Monroe Michigan, U.S.A.
Passing the address of the parameter in an address register might satisfy the requirements as you stated them. You should verify that before assuming it does.

Code:
    LEA   PARM1,A0    put address of parameter in register A0
    BSR  SUBROUTINE

_________________
Prof. Kelly


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 24, 2016 10:01 pm 
Offline

Joined: Sat Jan 23, 2016 6:08 pm
Posts: 3
I tried to display the result with move #3,d0 but it didn't work , can you check please ?

Code:
*-----------------------------------------------------------
* Title      :
* Written by :
* Date       :
* Description:
*-----------------------------------------------------------
    ORG    $1000
START:                  ; first instruction of program
        MOVE.W num1,-(SP)
        MOVE.W num2,-(SP)
        MOVE.W num3,-(SP)
        JSR    MULS3
        ADDA.L #6,SP
        STOP   #$2700
        NOP
       
MULS3   MOVE.W 4(SP),d0 
        MULS.W 6(SP),d0
        MULS.W 8(SP),d0
        RTS
* Put program code here

    SIMHALT             ; halt simulator

* Put variables and constants here
num1 dc.w 5
num2 dc.w 8
num3 dc.w 2
    END    START        ; last line of source


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 28, 2016 9:44 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1035
Location: Monroe County Community College, Monroe Michigan, U.S.A.
I don't see a display. What are you trying to display?

_________________
Prof. Kelly


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 3 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:  
cron
Powered by phpBB® Forum Software © phpBB Group