Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Help! AMOS Extensions and Assembler  (Read 6212 times)

0 Members and 2 Guests are viewing this topic.

MadAngus

  • There is no spoon.
  • Site Admin
  • A500
  • ******
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 497
  • AMOS Docs / AIAB Dev
    • AIAB (Amiga In A Box)
Help! AMOS Extensions and Assembler
« on: February 22, 2012, 01:37:20 AM »

I'm half way through issue 5/6 of the AMOS Club newsletters (nearly ready for a release), however I've come a cropper with the print.

Below is a excerpt from the "The AMOS Shuffle Extension" example. There are some instructions that I'm not sure about what they should be, 'dc.I', 'move.I', 'cmp.I' and 'bIt '. Should that I be an l (small L), they both (I and small L) look like an l (small L) in the print.

[Edit] I've attached the complete article. If you know where to get the TOME Goodies Disk 1, then this would solve the problem as the source file is on that.

Start
@ @ dc.I @ X- Tk-X_Off @ : length of offsets
@ @ dc.I @ X_Llb-X- Tk @ ; length of tokens
@ @ dc.I @ X- Tltle-X_Llb : length of libraries
@ @ dc.I @ X_End-X- Title; length of Title string
@ @ dc.w @ 0

*******************************************************
*
L2
*
L3
* =RANGE(a,b TO c)
* return result of a forced into range of b to c
* shorter version of -MAX(b,MIN(c,a))
L_Range @ equ @ 3
@ move.I @ (a3) + , d2 @ ; get the last parameter
*The above pulled an integer from the stack. (as required)
@ move.I @ (a3) + , d1
@ move.I @ (a3) + , d0
* note that they are pulled in reverse order
@ @ cmp.I @ d2 , d0 @ ; is a>c ?
@ bgt @ BiGGER; if so then force a=c
B1: @ cmp.I @ d1 , d0 ; is a<b ?
@ bIt @ SMALLER @ ; if so then force a=b
* when you have to return a parameter from a function,
* Set D2 to the type (0,1 or 2) and D3 to the value (or
* the address in the case of a string)
B2: @ move.I @ d0 , d3
« Last Edit: February 22, 2012, 03:24:03 AM by MadAngus »
Logged
My shadow says otherwise.

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Help! AMOS Extensions and Assembler
« Reply #1 on: February 22, 2012, 07:55:31 PM »

Sourced this disk image from the English Amiga Board http://eab.abime.net/index.php.

Unfortunately, it refers back to the AMOS Club newsletter issue 5/6 for the source!   ???

Quote
Below is a excerpt from the "The AMOS Shuffle Extension" example. There are some instructions that I'm not sure about what they should be, 'dc.I', 'move.I', 'cmp.I' and 'bIt '. Should that I be an l (small L), they both (I and small L) look like an l (small L) in the print.

I know nothing about TOME (but suspect I will have to soon :o) but do understand 68000 assembler.  So:

dc.I  -->  dc.l  lower case L (stands for Long Integer)
move.I  -->  move.l  lower case L (stands for Long Integer)
cmp.I  -->  cmp.l  lower case L (stands for Long Integer)
bIt  -->  bit  lower case I (not assembler, but makes sense)

Hope this helps.  :)
Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

MadAngus

  • There is no spoon.
  • Site Admin
  • A500
  • ******
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 497
  • AMOS Docs / AIAB Dev
    • AIAB (Amiga In A Box)
Re: Help! AMOS Extensions and Assembler
« Reply #2 on: February 22, 2012, 10:08:06 PM »

Thanks bruceuncle, saves having to fix it down the road. ;D
Logged
My shadow says otherwise.

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Help! AMOS Extensions and Assembler
« Reply #3 on: February 22, 2012, 10:58:31 PM »

Just trawled through the listing and found a heck of a lot of mistakes.  Was this OCRed?   :D

Couldn't see what I was doing with all those damned @s representing tabs, so I've redone that listing section as assembler source - no tabs, just spaces.

If you really need the @s, I suppose I could put them back in but it will take a while...  8)
Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Help! AMOS Extensions and Assembler
« Reply #4 on: February 22, 2012, 11:15:17 PM »

Note that it is many, many, many years since I last used 68000 assembler.  So if some kind soul could check that listing (or even give it a try with Devpac)  'twould be appreciated.

I did edit it in a codesense editor, so it should at least be in correct format (nailed a lot of ":" instead of ";" for comments).  No warranty, refund, etc, etc. ;D

The references to the includes files are in the "Tutorials/Extensions" folder in AMOS Pro.
Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Help! AMOS Extensions and Assembler
« Reply #5 on: February 22, 2012, 11:25:54 PM »


bIt  -->  bit  lower case I (not assembler, but makes sense)


actually, since this *is* assembler,  it will  be:

bIt  -->  bLt  "branch if less than"

it will be followed by an address, although is usally programmed with reference to a label.

e.g.   blt    .thisplace


edit: which i see is here:

Code: [Select]
         cmp.l   d1 , d0         ; is a<b ?
         blt     SMALLER         ; if so then force a=b

compares value of d1 to d0, and if the subject (d0) is less than d1, branch to the label "smaller"
« Last Edit: February 22, 2012, 11:32:32 PM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Help! AMOS Extensions and Assembler
« Reply #6 on: February 23, 2012, 04:11:29 AM »

Thanks Hungry Horace, I should have pointed that out in the previous post.

The edited version attached to that post corrected all that and loads of other little 'typos' from what, I assume, is OCR generated.  Those @s made it difficult to realise what I was looking at for a while.  At first I thought it was something in some weird syntax that TOME used (don't know anything about TOME yet) then it dawned on me it was plain ole assembler.  Not having used 68000 assembler for about 20 years didn't help either  :).  Would still be grateful if someone who has some more recent experience would eyeball it to check...

Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

MadAngus

  • There is no spoon.
  • Site Admin
  • A500
  • ******
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 497
  • AMOS Docs / AIAB Dev
    • AIAB (Amiga In A Box)
Re: Help! AMOS Extensions and Assembler
« Reply #7 on: February 23, 2012, 06:46:48 AM »

Thanks folks,  :D

The @s are used in the newsletter, I'd just leave them out of the corrected version. I have just added the corrected version text file to the release archive. If it needs replaced again then I can do that easily enough.

I should point out this extension has nothing to do with TOME it is just included in the TOME Goodies disk. It's an example extension for AMOS The Creator (I think), I've read the newsletters but not read them, if you get my meaning.
Logged
My shadow says otherwise.

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: Help! AMOS Extensions and Assembler
« Reply #8 on: April 20, 2012, 10:14:52 PM »

Bruceuncle,

I just downloaded your "corrected" file from your post on Feb 22, 2012. There is still a few errors, mostly just the few lines after the Start label. One example is this "X- Tk" should actually be "X_Tk" as it's an address label.

One other thing to note, most assemblers kick up a fuss if there are spaces by comma's.

Code: [Select]
move.w   $FFF , $DFF184  ; bad code

move.w   $FFF,$DFF184  ; good code (no spaces either side of the comma)


Regards,
Lonewolf10
« Last Edit: April 20, 2012, 10:17:52 PM by Lonewolf10 »
Logged

MadAngus

  • There is no spoon.
  • Site Admin
  • A500
  • ******
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 497
  • AMOS Docs / AIAB Dev
    • AIAB (Amiga In A Box)
Re: Help! AMOS Extensions and Assembler
« Reply #9 on: April 28, 2012, 01:54:36 PM »

@Lonewolf10
Cheers for the update, I'll add the corrections to the second revision when it comes.
Logged
My shadow says otherwise.

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Help! AMOS Extensions and Assembler
« Reply #10 on: April 28, 2012, 02:11:17 PM »

Quote
There is still a few errors, mostly just the few lines after the Start label.
Thanks for that.  Very rusty after 20 or so years away from 68000 assembler...  But "Willing to learn and will work for the odd table scraps."  :)
Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: Help! AMOS Extensions and Assembler
« Reply #11 on: June 05, 2012, 01:01:12 AM »

Quote
There is still a few errors, mostly just the few lines after the Start label.
Thanks for that.  Very rusty after 20 or so years away from 68000 assembler...  But "Willing to learn and will work for the odd table scraps."  :)

It's pretty easy for me to spot those kinds of errors as I have worked on my own AMOS extension (mainly to learn ASM) for fun, and they all have the same format at the start and end (otherwise they won't work properly in AMOS or when compiled).

Just glad I could help :)


Regards,
Lonewolf10
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022