EASy68K  
It is currently Tue Sep 17, 2019 8:20 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Tue Oct 18, 2011 2:04 pm 
Offline

Joined: Tue Oct 18, 2011 1:06 pm
Posts: 5
.


Last edited by jerrytheberry on Fri Oct 21, 2011 5:08 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2011 12:38 am 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
Code:
PRINT   equ     $400180
        org     $400080
START   lea     DATA,a0
        move.w  #15,d0
LOOP    move.b  (a0)+,d1
        jsr     PRINT
        dbra    d0,LOOP
        move.b  #9,d0
        trap    #15
        org     $400100
DATA    dc.b    $54,$68,$65,$20,$71,$75,$69,$63,$6B,$20,$62,$72,$6F,$77,$6E,$2E
        end     START


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2011 11:48 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1102
We do not answer homework questions on this forum. BTW, clive's program is not the answer.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2011 11:49 am 
Offline

Joined: Tue Oct 18, 2011 1:06 pm
Posts: 5
.


Last edited by jerrytheberry on Fri Oct 21, 2011 5:08 am, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2011 11:54 am 
Offline

Joined: Tue Oct 18, 2011 1:06 pm
Posts: 5
.


Last edited by jerrytheberry on Fri Oct 21, 2011 5:09 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2011 9:19 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
jerrytheberry wrote:
What has Clive done wrong?

I think Professor Kelly's observation is that the answer exceeds the scope of the original question, because it uses knowledge of the 68K instruction set not presented, but never the less is a valid and arguably better solution. It is going to be difficult to simulate with EASy68K.

It does not have any comments, and the instructor who posed the question may fail it as not being the "rote" answer expected. Sometimes it helps to see different solutions to a problem, and to understand how they work. Sometimes it helps to think outside the box and be creative.

The question may also have lost something in the formatting of the data, and what exactly the '-' and '*' are doing. I tried to interpret the intent.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2011 3:28 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
[code]; Answer targeting EASy68K as a test platform

removed by admin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2011 4:58 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1102
[quote="jerrytheberry"]Chuck, I thought this section was called Programming Questions. Therefore I thought it was ok to post a programming question! :D

Programming questions are OK, but we do not do your homework for you. That would defeat its purpose.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2011 2:01 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
Homework is overrated, this is the kind of problem that should be explained in class, and easily demonstrable in a simulator or emulator. ie calling some TRAP to get output, not some non-specific/existent routine, and not some 30 year old board from Motorola. Seeing multiple solutions, from different people, is also very effective at grasping the underlying mechanism.

Removing code and questions also makes it easier to pass off code as your own as won't show up in a Google search.

Code:
Refer to the array and storage map drawn below and the list of instructions
tabulated in Table 1 and hence, in MC68000 assembler language, write a program
to print the contents of an array of data stored in memory. The array (DATA)
comprises sixteen (16) items of data, the first item is stored at location
$0400100. Assume that a subroutine called PRINT is stored at address $0400180,
which will print out a byte of data held in D1 and then return to your program.



54 68 65 20 71 75 69 63  6B 20 62 72 6F 77 6E 2E
T  h  e     q  u  i  c  k      b  r  o  w  n  .



$0400100                                      $0400180

DATA                                             PRINT

Figure TMA3-4b.  Hex data array and storage map



             Mnemonic      Operand      Operation


             MOVE.B  (A0)+,D1    add the content of memory at the address stored in
                                 address register A0 to the content of data register
                                 D1 and store the result in register D1. Increment
                                 the address register to the next location.

            BNE      TARGET      On the state of the Zero bit (Z=0) of the Status register,
                                 transfer program control (branch) to the effective
                                 address of the label TARGET

            CLR    D0            Clear the content of data register D0 to zero

            JSR (A1)             Jumps to the subroutine at the address given in A1



            MOVE.B  D0,(LOCN)    move, to store, the byte content of register D0 into
                                 the effective address of the label LOCN.

            MOVE.B  #10,D1       copy the immediate data (10) into the data register D1

            MOVEA.L   #$789AB, A0   copy the address $789AB into the address
                                    register A0


            SUB.B         #1,D0      Subtract one from the content of register D0 and
                                     store the result in D0

                Table 1 List of MC68000 instructions

            Notes: $ (dollar)  prefixes hexadecimal data, for example $789AB

Format of a Motorola MC68000 MPU assembler language statement:
            Label        Mnemonic        Operand        Comment


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2011 4:04 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1102
clive wrote:
Homework is overrated, this is the kind of problem that should be explained in class, and easily demonstrable in a simulator or emulator. ie calling some TRAP to get output, not some non-specific/existent routine, and not some 30 year old board from Motorola. Seeing multiple solutions, from different people, is also very effective at grasping the underlying mechanism.

Removing code and questions also makes it easier to pass off code as your own as won't show up in a Google search.


I encourage answering questions with example code however we should refrain from providing exact answers to obvious homework questions. Whatever we think of the question, it is not appropriate to subvert the intentions of the instructor. Too many students will simply copy our answers verbatim and make no effort to understand the material. They will, in turn, skew the grades of the class and hurt the students who are doing the work on their own.

_________________
Prof. Kelly


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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