EASy68K  
It is currently Sun Nov 17, 2019 5:56 am

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: help with basics..
PostPosted: Fri Feb 16, 2007 5:22 am 
Offline

Joined: Fri Feb 16, 2007 4:59 am
Posts: 8
Anyone know of some good books to start 68k programming? I'm starting to learn 68k programming for fun. I want to design robots and I thought a good place to start would be assembly. Could anyone tell be some good basic examples. Can I use Mac OS X with easy68k? Can we port it to Mac OS X if not.

Thanks
split...


Top
 Profile  
 
 Post subject: Re: help with basics..
PostPosted: Fri Feb 16, 2007 11:11 am 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
Quote:
Anyone know of some good books to start 68k programming? I'm starting to learn 68k programming for fun. I want to design robots and I thought a good place to start would be assembly.

"The Art of Electronics", Horowitz & Hill, ISBN-10: 0521370957, ISBN-13: 978-0521370950. Chapter 11 is on microprocessors and includes a worked example of building an instrument using an MC68008 (an 8 bit bus version of the MC68000. A modern equivalent would be the MC68EC000)

There are other chapters on interfacing and it's a good electronics book.

Quote:
Could anyone tell be some good basic examples.

There are examples included in the EASy68K archive, some more here ..

http://www.monroeccc.edu/ckelly/easy68kexamples.htm

.. and more here ..

http://members.lycos.co.uk/leeedavison/68k/easy68k/index.html

Lee.


Top
 Profile  
 
 Post subject: Re: help with basics..
PostPosted: Fri Feb 16, 2007 4:38 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1103
splitline wrote:
Can I use Mac OS X with easy68k? Can we port it to Mac OS X if not.

I have had reports from people who run EASy68K in WINE on a Linux system. I've never had a report from anyone who ran EASy68K using a Windows emulator on OS X.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Parallel
PostPosted: Sat Feb 17, 2007 12:56 am 
Offline

Joined: Fri Feb 16, 2007 4:59 am
Posts: 8
I know you can run Parellel which emulates Win X quite well with out much lagg, but I would much rather run EASy68k natively on Mac OS X Tiger with 64bit support. How could you do cross development with EASY68k?

I aslo need some help with an example from the book. I'm trying to figure out what they mean by off setting the bits. Here is the question...

Ffill a 256 byte block of memory starting at address $3000 with the bytes address (offset) within the block.

Example:

$3000 0
$3001 1
$3002 2

I'm new to assembly and i'm trying to understand the basics.


Top
 Profile  
 
 Post subject: Re: Parallel
PostPosted: Sun Feb 18, 2007 1:03 am 
Offline

Joined: Tue Nov 15, 2005 7:58 am
Posts: 129
Location: Oregon, USA
splitline wrote:
Fill a 256 byte block of memory starting at address $3000 with the bytes address (offset) within the block.

Example:

$3000 0
$3001 1
$3002 2

I'm new to assembly and i'm trying to understand the basics.


A small hint: read about indexing in general, then look for a 68K indexing mode that adds an number as an offset (+0, +1, +2, ...) to a base address ($3000 here) to get an effective address; write the number (offset) to that address, increment the number, and loop. You'll also need to check for the loop exit condition (256 addresses written).


Top
 Profile  
 
 Post subject: Re: Parallel
PostPosted: Tue Feb 20, 2007 5:23 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1103
splitline wrote:
I know you can run Parellel which emulates Win X quite well with out much lagg, but I would much rather run EASy68k natively on Mac OS X Tiger with 64bit support.


The source code is published if anyone wants to do the conversion to OS X. We use only Windows PCs at MCCC so I have no interest in doing a MAC version.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 20, 2007 12:51 pm 
Offline

Joined: Mon Dec 20, 2004 6:03 pm
Posts: 50
Sadly, you'd probably have to re-do the entire GUI being that I don't believe there has ever been a version of C++ Builder for macs.

However, I would assume that most of the assembler and simulator code is portable.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 21, 2007 1:40 am 
Offline

Joined: Fri Feb 16, 2007 4:59 am
Posts: 8
Thanks for the hint. I'll look at indexing. And i guess i'll use Windows, how about linux?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 21, 2007 2:22 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1103
splitline wrote:
... , how about linux?

See this thread:

http://www.easy68k.com/EASy68Kforum/viewtopic.php?t=92

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: example in the book...
PostPosted: Wed Feb 21, 2007 3:29 am 
Offline

Joined: Fri Feb 16, 2007 4:59 am
Posts: 8
Code:
START   ORG        $3000
INIT     LEA.L         Q,A0
       LEA.L         QEND,A1
ILUP    CLR.B          (A0)
       ADDA.W     #1,A0
       CMPA.L   A1,A0
       BNE             ILUP
       JMP             $8008
       ORG     $3100
   
Q      DS.B           5
QEND    EQU        Q+5
   



       MOVE.B   #9,D0
       TRAP     #15      Halt Simulator

       END             START


I have tried to assemble this code in the emulator but i keep getting a error. When I try to run it... Thanks...

Line 1111 Emulator exception occurred at location e00014. Execution halted

I cannot find line 1111 and don't worry about the spacing it happened when a cut and pasted the code.

I'm a newbie so any help would be greaty appriciated..


Top
 Profile  
 
 Post subject: Sorry
PostPosted: Wed Feb 21, 2007 3:50 am 
Offline

Joined: Fri Feb 16, 2007 4:59 am
Posts: 8
Sorry for the messy looking code. But when i cut and paste from Easy68k the formating changes.


Top
 Profile  
 
 Post subject: Problem fixed I think
PostPosted: Wed Feb 21, 2007 4:16 am 
Offline

Joined: Fri Feb 16, 2007 4:59 am
Posts: 8
I think the problem was " Q+5 " this should look like this " Q + 5 " becuase this opeand expression is not evaluted until run time. In the book the example is given like this " Q+5 ". You should check this in the editor..
Doesn't really matter.

But I think the best solution is to inderectly address 256 bytes while adding 1 into memory.

I'm not sure what do you think?


Top
 Profile  
 
 Post subject: Ok not fixed.
PostPosted: Wed Feb 21, 2007 5:17 am 
Offline

Joined: Fri Feb 16, 2007 4:59 am
Posts: 8
Ok that was not the problem.. I'm still having an error.

Illegal instruction found at location 301e. Execution halted

Code:
*-----------------------------------------------------------
* Program    :
* Written by :
* Date       :
* Description:
*-----------------------------------------------------------
START   ORG   $3000
INIT   LEA.L    Q,A0
   LEA.L   QEND,A1
ILUP   CLR.B   (A0)
   ADDA.W    #1,A0
   CMPA.L   A1,A0
   BNE   ILUP
Q   DS.B   5
QEND    EQU   Q+5
   MOVE.B   #9,D0
   TRAP   #15      Halt Simulator

   END   


Here is the debug data..



Any help would be appriciated...
Code:
PC=$00003000  CODE=$41F9  LEA         
PC=$00003006  CODE=$43F9  LEA         
PC=$0000300C  CODE=$4210  CLR         
PC=$0000300E  CODE=$D0FC  ADDA       
PC=$00003012  CODE=$B1C9  CMPA       
PC=$00003014  CODE=$66F6  BCC         
PC=$0000300C  CODE=$4210  CLR         
PC=$0000300E  CODE=$D0FC  ADDA       
PC=$00003012  CODE=$B1C9  CMPA       
PC=$00003014  CODE=$66F6  BCC         
PC=$0000300C  CODE=$4210  CLR         
PC=$0000300E  CODE=$D0FC  ADDA       
PC=$00003012  CODE=$B1C9  CMPA       
PC=$00003014  CODE=$66F6  BCC         
PC=$0000300C  CODE=$4210  CLR         
PC=$0000300E  CODE=$D0FC  ADDA       
PC=$00003012  CODE=$B1C9  CMPA       
PC=$00003014  CODE=$66F6  BCC         
PC=$0000300C  CODE=$4210  CLR         
PC=$0000300E  CODE=$D0FC  ADDA       
PC=$00003012  CODE=$B1C9  CMPA       
PC=$00003014  CODE=$66F6  BCC         
PC=$00003016  CODE=$0000  ORI         
PC=$0000301A  CODE=$0000  ORI         
PC=$0000301E  CODE=$0009  ORI         
Illegal instruction found at location 301e. Execution halted
PC=$00003022  CODE=$0000  ORI   


Top
 Profile  
 
PostPosted: Wed Feb 21, 2007 8:04 am 
Offline

Joined: Fri Feb 16, 2007 4:59 am
Posts: 8
I'm still having problems.. It seems i'm going into a infinite loop or something.. Please I need help..

The program fills 256 bytes and adds one each time into each memory address of 256 bytes.

Sorry my English is not that good... I'm Japanese

Code:
START   ORG   $1000 
INIT   LEA.L   Q,A0     
   LEA.L   QEND,A1
   MOVE.B   #0,D0
ILUP   MOVE.W    D0,A0     
   ADDA.W    #1,A0
   ADD.B   #1,D0
   CMPA.L   A1,A0
   BNE   ILUP

   ORG   $3000

Q   DS.B   256
QEND    EQU   Q+256


   MOVE.B   #9,D0
   TRAP   #15      

   END   INIT


sorry for the bad formatting but i'm cut and pasting the code..
Here is the problem..
It seems I'm not leaving the loop or adding 1 each time either..
Whats the problem its an example in the book...


Top
 Profile  
 
PostPosted: Wed Feb 21, 2007 1:41 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1103
The "Halt Simulator" code was not running. After your loop finished the program continued to try running instructions that it found in memory until an illegal opcode was executed. Here is your program corrected to prevent that problem. It currently clears memory from $3000 to $3100.

splitline wrote:
Code:
        ORG     $1000 

INIT    LEA.L   Q,A0     
        LEA.L   QEND,A1
ILUP    CLR.B   (A0)     
        ADDA.W  #1,A0
        ADD.B   #1,D0
        CMPA.L  A1,A0
        BNE     ILUP

        MOVE.B  #9,D0          Halt Simulator
        TRAP    #15      

        ORG     $3000

Q       DS.B    256
QEND    EQU     Q+256

        END     INIT



See this post relating to spaces in assembly code.
http://www.easy68k.com/EASy68Kforum/viewtopic.php?t=320

_________________
Prof. Kelly


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

All times are UTC


Who is online

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