Assembler / disassembler

Here you can ask questions or provide insights about how to use efficiently 6502 assembly code on the Oric.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Assembler / disassembler

Post by Symoon »

Hi all,

Ok, I'm getting tired of writing my own assembler programs by hand in a TXT file, like this for instance:

Code: Select all

Address / cycles / op codes / Asm instructions / Comments
0431    6    20 6A E7  JSR #E76A    Init du VIA ***ROM1.0: E6CA
It's fine for short programs but when they start being longer than 100 bytes, having to re-write all the addresses when I insert or remove instuction is HELL. Also repeating the addresses in "op codes" and in "asm instruction" leads to typos.

So, before looking by myself and going the wrong route, is there any standard / used by Oricians / efficient cross-assembler?
Which one should I use/learn, knowing that if it handles cycle counting display, it would be heaven ?

Thanks!
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Assembler / disassembler

Post by Chema »

XA included in the OSDK. The best option, imho.

In fact, just download the OSDK and have a look at the examples. You'll be writing multi file asm programs in no time!
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Assembler / disassembler

Post by iss »

+1 for XA/OSDK.
BTW, when I saw your source 'Load_Vader_0400_source.txt', I wonder what tool are you using because of the inconsistency of hex number notation ($,# ...), I simply can't believe you do it everything manual. Man, this is self punishment ;).
jede
Flying Officer
Posts: 191
Joined: Tue Mar 14, 2006 11:53 am
Location: France

Re: Assembler / disassembler

Post by jede »

I used frasm, xa, ca65.

XA is the best solution (for syntax, preprocessor, etc). ca65 is good too, but, XA is the best assembler.

Dbug is the maintainer of XA in OSDK. It means that there is updates, bug corrections. The only tool, i don't use in OSDK, is the compiler.

Oric's coder use mainly XA. It's easy to share source code :)
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Assembler / disassembler

Post by Symoon »

Thanks fr the replies guys, it seems quite clear ;)
I'll be a total newbie here, is there some user interface, kind of: "I write my code, it displays the address and cycles count automatically"?
iss wrote: Sun Aug 20, 2017 2:45 pm BTW, when I saw your source 'Load_Vader_0400_source.txt', I wonder what tool are you using because of the inconsistency of hex number notation ($,# ...), I simply can't believe you do it everything manual. Man, this is self punishment ;).
Lol ;)
The inconsitency is due to the fact that I'm trying to follow what I was told here (about $ and #) but sometimes get it wrong or keep using my old way of writing... Sorry, that certainly doesn't help.
Doing it by hand is painful but also has the advantage of being able to make it here or there (at work, in the bus, ...) on paper even if I have no computer at hand. If I have to have a SDK all the time, that's the end of my programming career ;) as I only have 5 mins here, 15 mins there...
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Assembler / disassembler

Post by Dbug »

Symoon wrote: Sun Aug 20, 2017 5:34 pm I'll be a total newbie here, is there some user interface, kind of: "I write my code, it displays the address and cycles count automatically"?
You get that for free with Oricutron: Press F2 and you are in the debugger:
http://osdk.org/index.php?page=document ... =oricutron

There's a value called CY which contains the number of cycles, you can press F9 to reset it.

After, it's just a matter of putting a breakpoint at the end of the code, and run it until it hits, then you have the exact cycle count.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Assembler / disassembler

Post by Symoon »

Ok thanks!
In what I'm mainly working at these days (tape loading), cycles counting is really important and determines the way of coding.
I guess I'll have to try and learn now!
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Assembler / disassembler

Post by iss »

Symoon wrote: Sun Aug 20, 2017 11:00 am Ok, I'm getting tired of writing my own assembler programs by hand in a TXT file, like this for instance:

Code: Select all

Address / cycles / op codes / Asm instructions / Comments
0431    6    20 6A E7  JSR #E76A    Init du VIA ***ROM1.0: E6CA
I'm resurrecting this old thread because of a message in Apple][ FB-group which announce a tool
for writing 6502 assembler code in ..... (suspense....) MS Excel :!: :shock:

It's seems maybe little slow but in general it works.
Download here: https://github.com/tilleul/apple2/tree/ ... _assembler

@Symoon: IIRC you are an Excel-pro, hopefully this tool will be easier than hand-made assembler coding ;).
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Assembler / disassembler

Post by Symoon »

Aha thanks, I don't have a recent Excel version so not sure I can read xlsx files, but I should give it a try!
BTW i'm no Excel "pro", rather a hobyyst that likes playing with VBA for fun - but none of my work is pro ;)
User avatar
Badger
Pilot Officer
Posts: 84
Joined: Sat Sep 22, 2018 10:04 am
Location: Wigan, England

Re: Assembler / disassembler

Post by Badger »

BTW i'm no Excel "pro", rather a hobyyst that likes playing with VBA for fun - but none of my work is pro
Remember, amateurs built the Ark, Pros built the titanic :D
flag_uk Amateurs built the Ark, Professionals built the Titanic.
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: Assembler / disassembler

Post by xahmol »

Pro’s should never use Excel 😉 (sorry, could not help myself. Always in my work battling against End User Defined Apllucations instead of proper automation...)
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Assembler / disassembler

Post by Symoon »

xahmol wrote: Fri Feb 12, 2021 6:26 am Pro’s should never use Excel 😉 (sorry, could not help myself. Always in my work battling against End User Defined Apllucations instead of proper automation...)
Ha ha, I both agree and disagree.
It's a matter of doing things you have to do, with the tools you got.
Sometimes fully right (you don't call an architect to use a hammer and a spike), sometimes wrong (if you're using spikes too help the wall standing... You should call an architect ;) )

Anyway, sorry for the off-topic ;)
Post Reply