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

help with basics..
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=341
Page 1 of 1

Author:  splitline [ Fri Feb 16, 2007 5:22 am ]
Post subject:  help with basics..

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

Author:  lee [ Fri Feb 16, 2007 11:11 am ]
Post subject:  Re: help with basics..

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.

Author:  profkelly [ Fri Feb 16, 2007 4:38 pm ]
Post subject:  Re: help with basics..

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.

Author:  splitline [ Sat Feb 17, 2007 12:56 am ]
Post subject:  Parallel

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.

Author:  gtippery [ Sun Feb 18, 2007 1:03 am ]
Post subject:  Re: Parallel

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

Author:  profkelly [ Tue Feb 20, 2007 5:23 am ]
Post subject:  Re: Parallel

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.

Author:  ABeakyboy [ Tue Feb 20, 2007 12:51 pm ]
Post subject: 

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.

Author:  splitline [ Wed Feb 21, 2007 1:40 am ]
Post subject: 

Thanks for the hint. I'll look at indexing. And i guess i'll use Windows, how about linux?

Author:  profkelly [ Wed Feb 21, 2007 2:22 am ]
Post subject: 

splitline wrote:
... , how about linux?

See this thread:

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

Author:  splitline [ Wed Feb 21, 2007 3:29 am ]
Post subject:  example in the book...

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

Author:  splitline [ Wed Feb 21, 2007 3:50 am ]
Post subject:  Sorry

Sorry for the messy looking code. But when i cut and paste from Easy68k the formating changes.

Author:  splitline [ Wed Feb 21, 2007 4:16 am ]
Post subject:  Problem fixed I think

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?

Author:  splitline [ Wed Feb 21, 2007 5:17 am ]
Post subject:  Ok not fixed.

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   

Author:  splitline [ Wed Feb 21, 2007 8:04 am ]
Post subject:  Ok fixed the bug i think but...

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

Author:  profkelly [ Wed Feb 21, 2007 1:41 pm ]
Post subject:  Re: Ok fixed the bug i think but...

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

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