AnyCPU
http://anycpu.org/forum/

Assembling other people's sources
http://anycpu.org/forum/viewtopic.php?f=25&t=864
Page 1 of 2

Author:  Vladimir [ Fri Oct 22, 2021 8:05 am ]
Post subject:  Assembling other people's sources

Hi guys!
And I didn’t know about this forum! I see a lot of familiar nicknames from the 6502 community here.
Even the mood has risen.
Many years ago I read in some Soviet magazine about the existence of an outstanding, advanced and in
all respects the best microprocessor - MC68000. Of course, it was impossible to get it, but the news
touched me and it still feels like I missed something important. So, I finally decided to take a bit
closer look at this breakthrough of technical thought and found on the Web a simple SBC circuit that I
could quickly solder. It's here:
http://marc.retronik.fr/motorola/68K/68 ... 1-1984.pdf
I have some amateur experience with various electronic gizmos, including simple microprocessors like
the 8080 or z80, and more recently 6502 can be included here, thanks to 6502.org community.
Actually, I am more like a tinkerer than a programmer. I always lacked knowledge in the field of
software and experienced certain difficulties. The 68000 story is no exception.
I ordered parts on Aliexpress, and in the meantime, while there are no parts, I decided to prepare ROMs with a monitor program. The program is called VUBug and its sources are freely available on the net.I took here:
http://marc.retronik.fr/motorola/68K/68000.html
The first attempt in my life to assemble the source code for 68000 failed miserably. Easy68k generated several hundred assembly errors. I decided that maybe another assembler would fit better and took the AS V1.42 (macro assembler by Alfred Arnold). The errors number did not decrease, but they appeared in other places.
What is the correct approach to solving the problem? Manually fix all the places in the source that Easy68k doesn't like?

Thanks
Vladimir

Edit: spelling

Author:  BigEd [ Fri Oct 22, 2021 12:13 pm ]
Post subject:  Re: Assembling other people's sources

Welcome!

In a situation like this - different assembly syntaxes - I tend to reach for the text-processing tools sed and awk. A text editor with macros might be handy too. But this isn't necessarily the wisest approach!

Author:  robinsonb5 [ Fri Oct 22, 2021 12:32 pm ]
Post subject:  Re: Assembling other people's sources

You could try vasm - its the assembler I tend to use if I need to assemble for 68000.
http://sun.hasenbraten.de/vasm/

Author:  Vladimir [ Fri Oct 22, 2021 2:43 pm ]
Post subject:  Re: Assembling other people's sources

vasm. Doesn't work under Windows XP?
Is there an old version of vasm to run on the Win32 platform?

Author:  Vladimir [ Sat Oct 23, 2021 7:25 am ]
Post subject:  Re: Assembling other people's sources

I started to manually customize the source to fit the Easy68k syntax. If you need a quick result, then it is excruciating. But, if you have free time, then it may even turn out to be interesting and useful. A very good exercise for learning syntax.
However, along the way, I began to doubt that this was the monitor I needed. The planned SBC has the following address map:

$000000 - $000FFF - ROM
$001000 - $001FFF - RAM

And suddenly in the text I come across 'org $ 4000' ....

In addition, the description says:

VUBUG VER 3.0 PORTEd TO PC FOR ASSEMBLE USING a68K 9/84
VUBUG VER 3.1 FIXED FOR VU68K BOARD 10/86
VUBUG VER 4.0 PORTED TO RAYMATIC 68K BOARD 4/88

and the source text contains the following:

Version 4.0 11 August, 1988

Hence, RAYMATIC? And I was going to do VU68k...
So is it.

Author:  oldben [ Sat Oct 23, 2021 11:07 am ]
Post subject:  Re: Assembling other people's sources

Is this demo style board for the 68000? That is a rather small amount of ram.
Have you seen? http://www.easy68k.com/paulrsm/dg/

Author:  robinsonb5 [ Sat Oct 23, 2021 12:47 pm ]
Post subject:  Re: Assembling other people's sources

Vladimir wrote:
vasm. Doesn't work under Windows XP?
Is there an old version of vasm to run on the Win32 platform?


I just poked around in a dusty corner of an old hard drive, and found this version of vasm which I compiled using mingw32 back in 2012. Maybe it'll be useful for someone...

Attachments:
vasm.zip [749.26 KiB]
Downloaded 612 times

Author:  Vladimir [ Sat Oct 23, 2021 2:27 pm ]
Post subject:  Re: Assembling other people's sources

To robinsonb5: Many thanks. I will try.
oldben wrote:
Is this demo style board for the 68000? That is a rather small amount of ram.
Have you seen? http://www.easy68k.com/paulrsm/dg/

I think 4kb RAM is sufficient for initial experiments. In the future, if there is a desire, I can always increase the amount of memory.
DTACK GROUNDED I skimmed through and .... did not see any schemes, only text.

Author:  Vladimir [ Sun Oct 24, 2021 3:02 am ]
Post subject:  Re: Assembling other people's sources

To robinsonb5:
Yes, your vasm works on my Windows XP netbook.
I'm afraid to look intrusive, but...
I would also like to ask you about creating the simplest working environment. So far I've tried to put the lone vasmm68k_std.exe file and the source VUBUG.ASM in the root directory of the C: \ drive.
Next, I type on the command line
C: \ vasmm68k_std.exe VUBUG.ASM -L <Enter> and getting stop after five errors. No output files are created. Do vasmm68k_std.exe need any other files nearby for normal operation?
And still wondering where to find out about the m68k syntax, as it is understood by vasm?
I have a pdf taken from the author's site and dated June 2021. Is it too new?

Author:  robinsonb5 [ Sun Oct 24, 2021 8:34 am ]
Post subject:  Re: Assembling other people's sources

Vladimir wrote:
I would also like to ask you about creating the simplest working environment. So far I've tried to put the lone vasmm68k_std.exe file and the source VUBUG.ASM in the root directory of the C: \ drive.
Next, I type on the command line
C: \ vasmm68k_std.exe VUBUG.ASM -L <Enter> and getting stop after five errors. No output files are created. Do vasmm68k_std.exe need any other files nearby for normal operation?


You shouldn't need anything else - but you might get on better with the _mot version than the _std version.
Try assembling a really simple test program - maybe:

Code:
   ORG 0

STACK_TOP   equ   $2000

Tag:
   dc.l   STACK_TOP
   dc.l   Start

Start:
   moveq   #1,d0
.loop
   move.l   d0,$dff180
   addq.w   #1,d0
   bra.s   .loop


Assemble with:
Code:
vasmm68k_mot -Fbin test.s

You should end up with a small binary file, a.out.

I had a quick look at the monitor file - it will need some adapting.
Symbols must be on the leftmost column, so there are a few lines of the form " symbol = value" which need moving to the left.
I'm not sure what the intention is where the code has "dc.l $userv1" but the $ needs to be removed.
(a1,d2:w) will need to be changed to (a2,d2.w)
.ascii will need to be replaced with dc.b
.asciz will need to be replaced with db.c *and* and terminating ,0 added to each line which uses it.
Where there are lines like "stack = .", just replace with "stack:"
Lastly, replace ctrls: and bkptf's definitions with single byte dc.b

Hope that helps.

Author:  Vladimir [ Sun Oct 24, 2021 9:05 am ]
Post subject:  Re: Assembling other people's sources

Now the work has gone well, I can study the syntax and so on...
Of course, there are still ambiguities, but now it doesn't matter yet..
Many thanks for the help!

Author:  Vladimir [ Thu Oct 28, 2021 12:26 pm ]
Post subject:  Re: Assembling other people's sources

I was wrong about the free availability of the VUBug monitor for the VU68K SBC. What I took to be the software product I needed is, it seems, a monitor for another modified version of the SBC called RAYMATIC. I apologize for the misinformation.
I have not yet been able to find the original, unmodified version of the monitor program, suitable for the SBC VU68K, in electronic form. I found the source of this program so far only in paper form in the book by Andrew M. Veronis 'THE 68000 MICROPROCESSOR'. Now I am trying to type this source on a computer. If anyone has this program electronically and is willing to share it, please let me know.
Vladimir

Author:  Vladimir [ Fri Oct 29, 2021 4:47 am ]
Post subject:  Re: Assembling other people's sources

Here's another kind of syntax.
For example, there are lines like this:

Code:
MTAB:   DC.W   #1,#20A0
        DC.W   #1,#3D00


This is clear to me, the first parameter is the number of words, and the second is the word itself.
For vasm assembler, I can write instead
#1,#20A0 just $20A0.

But this is already unclear:

Code:
VECT2:   DC.L #1,$1018
VECT3:   DC.L #1,$101C
VECT4:   DC.L #1,$1020
VECTS:   DC.L #1,$1024
SSRI:    DC.W #1,#2000         ;Supervisor SR, interrupts
SSRN:    DC.W #1,#2700         ;Supervisor SR, no interrupts
PRMP:    DS "\r\n!\0"          ;Prompt (!)


What's the difference between $1018 and #2000?

P.S. Could it be that $ 1018 is not a number but a symbol? In this case, the dollar sign indicates that this is a symbol. Can a symbol contain only numbers?

Author:  BigEd [ Fri Oct 29, 2021 9:15 am ]
Post subject:  Re: Assembling other people's sources

That is odd. Is it possible both $ and # are valid prefixes to denote hex?

Author:  Vladimir [ Thu Apr 21, 2022 4:20 pm ]
Post subject:  Re: Assembling other people's sources

After some deliberation with programs found on the net, I realized that it would be better to try to write a monitor program myself. The best way to learn how to program is to program as much as possible. Right now my monitor is about 50% ready. The following commands are debugged and work well: dump, load, go, mem, fill, copy, help. I would like to do more: - searching, tracing, breakpoints and disassembly of machine code. Hope I can do it.

Attachments:
monitor.jpg
monitor.jpg [ 244.14 KiB | Viewed 4206 times ]

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