EASy68K  
It is currently Mon Nov 19, 2018 8:53 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Feb 21, 2012 12:55 am 
Offline

Joined: Sun Feb 19, 2012 4:56 pm
Posts: 3
Location: RI, USA
Hello,
Can S-Record output range be specified in source? I am using EASy68k to develop software for an actual hardware platform, and I want to use ‘DC’ (along with ‘SECTION’) to automate the allocation of variables across multiple ‘included’ files. This works fine, except that I do not want the S-Record output to include the variable (SRAM) space. Is there a way to specify the memory range over which to save the S-Record with an assembly directive (in this case, defining only the EPROM range)? I understand that can be done using EASyBIN through a separate process, but I hope it can be accomplished automatically within the code.

Also thanks so much to you, Prof Kelly, and all others involved here for this excellent software. It is spectacular and very much appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2012 8:27 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
Use ORG to define where different sections of you code/data need to live.
Use EQU to define addresses for hardware ports, etc.

Some of the more advanced stuff, you'd need to look at assemblers and linkers capable of handling and outputting relocatable code.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2012 8:44 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
Bill Buckels manages a page for the old Aztec compilers/assemblers, with the approval of the original developers. I provided the 68K version to Bill.

http://www.aztecmuseum.ca/compilers.htm

The 68K Aztec compilers/assemblers generate object files from the individual source files, and the linker can output S-Records. I've used these to build embedded apps over the years. I've also work with they OaSYS tool chain, which supports IEEE694 and COFF objects, but this has zero availability these days.

The Sega/Amiga communities have also posted compilers/assemblers over the years, try googling the scene.

Peter Fondse's IDE68K is also worth a look, a 68000/68020 C compiler and assembler.
http://home.kpn.nl/pj.fondse/ide68k/

Like EaSY68K it does anticipate a more monolithic development model, but supports projects, and supports Board Support Package (BSP) or HAL (Hardware Abstraction Layer), I've ported it to some of the older Motorola IDP boards.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2012 11:20 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1087
I believe the OFFSET directive will do what you want.

OFFSET - Used to define a table of offsets. No machine code is generated by instructions or directives following an OFFSET directive. Use an ORG directive to end the offset section and cause the assembler to generate machine code again.

OFFSET 0 Temporary origin for data
label1 DS.W 1
label2 DS.B 2
ORG * Restore previous code origin

ORG * restores the code to the address in use prior to the OFFSET.

For example the following code:
Code:
*-----------------------------------------------------------
* EPROM START
    ORG     $1000
START:              ;first instruction of program
    MOVE.B  var1,D0
    MOVE.B  D0,var2

    STOP    #$2700  ;stop execution

*-----------------------------------------------------------
* Variables and Strings are located at $8000
* Not part of S-Record
    OFFSET $8000
var1    DC.B    $AA
var2    DC.B    $55   

    END     START   ;last line of source


Assembles as:

Code:
00001000 Starting Address
Assembler used: EASy68K Editor/Assembler v5.9.0
Created On: 2/21/2012 6:15:07 PM

00000000=                            1  *-----------------------------------------------------------
00000000=                            2  * EPROM START
00001000                             3      ORG     $1000
00001000                             4  START:              ;first instruction of program
00001000  1039 00008000              5      MOVE.B  var1,D0
00001006  13C0 00008001              6      MOVE.B  D0,var2
0000100C                             7 
0000100C  4E72 2700                  8      STOP    #$2700  ;stop execution
00001010                             9 
00001010                            10  *-----------------------------------------------------------
00001010                            11  * Variables and Strings are located at $8000
00001010                            12  * Not part of S-Record
00008000=                           13      OFFSET $8000
00008000= AA                        14  var1    DC.B    $AA
00008001= 55                        15  var2    DC.B    $55   
00008002=                           16 
00008002=                           17      END     START   ;last line of source

No errors detected
No warnings generated


SYMBOL TABLE INFORMATION
Symbol-name         Value
-------------------------
START               1000
VAR1                8000
VAR2                8001


The S-Record file does not contain any of the data defined at $8000
Code:
S021000036384B50524F47202020323043524541544544204259204541535936384B6D
S113100010390000800013C0000080014E722700D8
S804001000EB

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2012 3:26 am 
Offline

Joined: Sun Feb 19, 2012 4:56 pm
Posts: 3
Location: RI, USA
This is very, very close. But the key feature missing is that I'd like to continue the position in the offset 'table' across separate offset sections. Functionally, I'm looking to use include files which allocate memory space independently of each other in a common heap.

Building on your example, I'd like not to explicitly specify the $8002, but instead say "*" and just continue from where I'd left off.

Code:
*-----------------------------------------------------------
* EPROM START
    section 1       ; -- code section --
    ORG     $1000
START:              ;first instruction of program
    MOVE.B  var1,D0
    MOVE.B  D0,var2
    move.b  var3,D0
    move.b  D0,var4

    STOP    #$2700  ;stop execution

*-----------------------------------------------------------
* Variables and Strings are located at $8000
* Not part of S-Record
    section 2       ; -- SRAM section --
    OFFSET $8000
var1    DC.B    $AA
var2    DC.B    $55   

    section 1       ; -- code section --
    nop
    nop
    nop
   
    section 2       ; -- SRAM section --
    offset $8002 ; <--- This position would follow from above
var3   dc.b   $77
var4   dc.b   $88

    END     START   ;last line of source


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2012 2:58 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1087
I created a macro to update the address at the end of a section. Each SRAM section begins with OFFSET * to turn off S-Record creation and ends with the SECT_END macro.

Code:
* Update address at end of section
SECT_END    MACRO
SIZE\@
    ORG SIZE\@
    ENDM

*-----------------------------------------------------------
* EPROM START
    section 1       ; -- code section --
    ORG     $1000
START:              ;first instruction of program
    MOVE.B  var1,D0
    MOVE.B  D0,var2
    move.b  var3,D0
    move.b  D0,var4

    STOP    #$2700  ;stop execution

*-----------------------------------------------------------
* Variables and Strings are located at $8000
* Not part of S-Record
    section 2       ; -- SRAM section --
    ORG     $8000
    OFFSET  *
RAM1
var1    DC.B    $AA
var2    DC.B    $55   
    SECT_END
   
    section 1       ; -- code section --
    nop
    nop
    nop
   
    section 2       ; -- SRAM section --
    OFFSET  *
var3   dc.b   $77
var4   dc.b   $88
    SECT_END

    END     START   ;last line of source

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 26, 2012 2:31 pm 
Offline

Joined: Sun Feb 19, 2012 4:56 pm
Posts: 3
Location: RI, USA
Author's magic works like a charm. I must thank you again, for both the software and the support. This solution even works for multiple independent sections (i.e. different memory banks).

Seems like EASy68K is used a lot as an educational tool. But it's also been great for hardware too. I've been a fan of the 68000 processor, to the point of designing a hobbyist single board computer around it. Feel free to check the project out. Maybe someone will find it of interest as an educational tool too. It's pretty thorough, including a rich documentation package, hardware design information, assembly and test procedures -- and, of course, software examples under EASy68K.

http://theproject.dnsalias.net/

Long live the M68k...
-Grant


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 26, 2012 4:35 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1087
Very cool project.

Thanks for the kind words about EASy68K. I'm glad you find it useful.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 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:  
cron
Powered by phpBB® Forum Software © phpBB Group