is there any trick to port easy68k assembly to gnu assembly/68k ? - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: January 15, 2015, 12:58:05 pm
content: hi guysi likeEhBasic-68K(1), unfortunately its site seems down, so i have got sources and stored them into a repoQuotei'd like to port these sources to gnu assembler m68k, they seem written inEasy68Kassembly, so any trick to simplify the porting-task ?(1) Copyright by Lee Davison 2002 - 2012, for educational purpose only

author: westfw
author_rank: Super Contributor
timestamp: January 17, 2015, 01:43:55 am
content: Probably not. My general experience with translating code from one assembler to another, or from c to assembler (.h files to assembler equivalents) is that you can get pretty far, pretty fast, with an editor that has keyboard macros or some basic programability. put colons after the labels, change the .equ-like statement formats, etc.I use this as my basic 68k gas reference:http://tigcc.ticalc.org/doc/gnuasm.htmlFortunately, it doesn't look like the code is using the "advanced" features of Easy68k...

author: westfw
author_rank: Super Contributor
timestamp: January 17, 2015, 07:01:06 am
content: Hmm. Your code is significantly different thanhttp://www.easy68k.com/applications.htm(the original source?)Is this really open source code from somewhere, or reverse-engineered source from questionable sources?I mean, it's got comments and stuff, but it's also got ridiculous label names that look like they're from a disassembler:Code:LAB_15F6BSRLAB_GBYT* get BASIC byteBSR.sLAB_15FF* go interpret BASIC code from (a5)* interpreter inner loop (re)entry pointLAB_15C2BSR.sLAB_1629* do CRTL-C check vectorTST.bClinel(a3)* test current line #, is -ve for immediate modeBMI.sLAB_15D1* branch if immediate modeMOVE.la5,Cpntrl(a3)* save BASIC execute pointer as continue pointerLAB_15D1

author: westfw
author_rank: Super Contributor
timestamp: January 17, 2015, 09:05:39 am
content: (it's REALLY annoying, isn't it? Gnu got lazy on their argument parsing, and does ALL the addressing modes differently.("-(sp)" becomes "%sp@-", for example.) Lazy programmers :-( )So. the --mri switch helps A LOT. Takes things from 10k+ of errors to less than a page worth. It seems to still have some problems with "moveq" values and sign extension:Code:moveq #$80, d1 ; errormoveq #$FFFFFF80, d1 ; ok

author: legacy
author_rank: Super Contributor
timestamp: January 17, 2015, 10:17:25 am
content: Quote from: westfw on January 17, 2015, 07:01:06 ami don't knowthe author's site is down, i have foundthisforum in where he was writing, but he is away, it's impossible to contact him by PM, or by email, so i asked around for sources and i was given with what i have simply pulled into a git repo in order to be useful for guys who are looking for such a sources, too

author: legacy
author_rank: Super Contributor
timestamp: January 17, 2015, 10:19:52 am
content: i was also looking at thev-asmproject, it is an open source assembler that accepts the 68k motorola syntax. It seems better than gas/68k.wandering if to use v-asm, or if to spend time trying to adapt sources to gas/68k

author: amyk
author_rank: Super Contributor
timestamp: January 17, 2015, 04:55:26 pm
content: In the x86 world we have the same problem - the GNU people thought making a totally different syntax from the official documentation was somehow a good idea...http://x86asm.net/articles/what-i-dislike-about-gas/For 68k I found this:https://www.jankratochvil.net/project/mot2as/But I agree that the best way forward is to use a different assembler that accepts the official syntax.

author: westfw
author_rank: Super Contributor
timestamp: January 17, 2015, 09:32:17 pm
content: do try the "--mri" switch; it's like a whole different assembler.