English Amiga Board


Go Back   English Amiga Board > Support > New to Emulation or Amiga scene

 
 
Thread Tools
Old 07 March 2020, 12:59   #21
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
While it's true that memory protection is useful, I don't really see this as a strong point when doing programming on Amiga. If your code crashes, you reboot and are back in business. It's not as you have to have a critical system running 24/7. And find such a crash is easier done on an emulator anyway. And doing asm in Linux is IMO not very Amiga like, so you learn actually programming Linux and not Amiga (if this is what you want).
If you want to get your hands dirty with just getting started, I would recommend to use Seka and hack directly in memory, because you can immediatly type and see the effects.
Or even better, you could use Easy68k, as long as you are just exploring the CPU. I use this all the time for prototyping functions which don't need hardware or OS specific stuff. IMO this would be the best approach when you are starting with M68 asm. The code is also mostly compatible with vasm, so you can easy test some machine code and then run it on the real machine afterwards. Depends on what you intend to code.
sparhawk is offline  
Old 25 March 2020, 22:11   #22
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
I’m still chasing suggestions from this thread and I’m stuck on testing the cross-assembler “vasm” suggestion, I’m getting a “No config file!” error message when trying assemble a “Hello World” type assembler verification file. I would think I’ve done something wrong but I don’t know what, Any suggestions?
Curbie is offline  
Old 26 March 2020, 07:12   #23
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
You can take a look at my library, as it is intended to ease the pain of getting started with cross development: https://github.com/skeetor/amiga-utils
You have to use MKSYS2 for it and bebbos toolchain. It contains complete fully working sample projects for vasm and gcc and is selfcontained, so no additional dependencies to hunt down.
sparhawk is offline  
Old 26 March 2020, 13:31   #24
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Curbie View Post
I’m still chasing suggestions from this thread and I’m stuck on testing the cross-assembler “vasm” suggestion, I’m getting a “No config file!” error message when trying assemble a “Hello World” type assembler verification file.
vasm doesn't need any config file, so there must be something very wrong.

First of all, how did you get vasm? Did you download it (where)? Did you compile it yourself (how)? On which host system are you running it? After that, a copy of your command line calling vasm and the resulting error messages might help.
phx is offline  
Old 26 March 2020, 16:58   #25
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
I downloaded and followed a tutorial “Setting up an Amiga Cross Compiler (Linux/Mac)” from here: https://blitterstudio.com/setting-up...ross-compiler/

[QUOTE=phx;1387629]vasm doesn't need any config file, so there must be something very wrong.

First of all, how did you get vasm? Did you download it (where)? {http://sun.hasenbraten.de/vasm/release/vasm.tar.gz}Did you compile it yourself (how)? {yes, make CPU=m68k SYNTAX=mot} On which host system are you running it? {xubuntu 18.04}After that, a copy of your command line calling vasm {vc +aos68k -o hello hello.c} and the resulting error messages might help.{No config file!}[/QUOTE]
Curbie is offline  
Old 26 March 2020, 17:02   #26
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
Are you sure that is the correct executable?
My VASM is called vasmm68k_mot (assuming I didn't make a spelling error ) and my VBCC is called, well, vbcc.

Edit: hmm, I do see a vc executable in the Aminet release, so I might be mistaken about which executable you have to call.
roondar is offline  
Old 26 March 2020, 17:37   #27
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Curbie View Post
{yes, make CPU=m68k SYNTAX=mot}
So far so good. This should provide you with an executable called "vasmm68k_mot" in the same directory. Copy it anywhere into your bin-path.

Quote:
{vc +aos68k -o hello hello.c}
Do you want to compile a C source or an assembler source? vasm is an assembler, vbcc (vc is the frontend) is a C-compiler. From this thread I had the impression you wanted to do some 68k coding.

Make an example source in 68k assembler, like...
Code:
        moveq   #0,d0
        rts
...save it as tst.asm and assemble an Amiga executable with:
vasmm68k_mot -Fhunkexe -o tst tst.asm
phx is offline  
Old 26 March 2020, 17:50   #28
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Quote:
Originally Posted by roondar View Post
Are you sure that is the correct executable?
My VASM is called vasmm68k_mot (assuming I didn't make a spelling error ) and my VBCC is called, well, vbcc.

Edit: hmm, I do see a vc executable in the Aminet release, so I might be mistaken about which executable you have to call.
I'm just trying to explore a vasm suggestion/assembler recommendation, I don't know heads from tales, vasm from other assemblers that were suggested, I plan to setup them all up and test them as to which one feels right.
Curbie is offline  
Old 26 March 2020, 18:18   #29
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Quote:
Originally Posted by phx View Post
So far so good. This should provide you with an executable called "vasmm68k_mot" in the same directory. Copy it anywhere into your bin-path.

Do you want to compile a C source or an assembler source? vasm is an assembler, vbcc (vc is the frontend) is a C-compiler. From this thread I had the impression you wanted to do some 68k coding.

Make an example source in 68k assembler, like...
Code:
        moveq   #0,d0
        rts
...save it as tst.asm and assemble an Amiga executable with:
vasmm68k_mot -Fhunkexe -o tst tst.asm
THANK YOU...It seems to work, it's creating a "tst" file I presume is executable. Now, to figure out how to load and run a test executable in WinUAE.

curbie@curbie-main:~/bin$ ls
myscript.sh rgu setupvbcc.sh syncall tst.asm vasmm68k_mot
curbie@curbie-main:~/bin$ vasmm68k_mot -Fhunkexe -o tst tst.asm
vasm 1.8g (c) in 2002-2019 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.3f (c) 2002-2019 Frank Wille
vasm motorola syntax module 3.13 (c) 2002-2019 Frank Wille
vasm hunk format output module 2.11 (c) 2002-2019 Frank Wille

CODE(acrx2): 4 bytes
curbie@curbie-main:~/bin$ ls
myscript.sh rgu setupvbcc.sh syncall tst tst.asm vasmm68k_mot
curbie@curbie-main:~/bin$ ^C
Curbie is offline  
Old 29 March 2020, 11:56   #30
AmigaHope
Registered User
 
Join Date: Sep 2006
Location: New Sandusky
Posts: 942
Quote:
Originally Posted by Curbie View Post
THANK YOU...It seems to work, it's creating a "tst" file I presume is executable. Now, to figure out how to load and run a test executable in WinUAE.
Boot to workbench, open main workbench folder, double click on shell to get a shell.

Amiga shells work as terminal emulator devices. The "Shell" icon you doubleclicked opens a terminal emulator to the CON: device. In general Amiga shells combine the terminal emulator with the shell, unlike unix. Other popular ones are KINGCON, etc. CON: is the default shell device in ROM and it's the most basic, sort of akin to bourne shell on unix. NEWCON: is more like korn shell with more features in AmigaOS 1.3, but it was rolled into CON: in AmigaOS 2.0 and up, KINGCON: would be more like bash.

If you're more comfortable with unix-style shells you can easily get a port of bash or tcsh and run it inside an Amiga CON: style shell, keeping the terminal emulator features of whatever CON:-style device you launched it in but executing the command/scripting features of the unix-style shell.

In a CON: though, just cd to the directory that you put your executable in, then type the name of the executable. Amiga CON:-style shells don't use . to represent current directory (they use "" instead) but in general CON: style always includes current directory in the command path.

Outside of the shell builtin commands and scripting features, if you're familiar with unix then you'll be at home interfacing with the command line. Amiga-style arguments are different but that's just convention, as commands still just receive a list of arguments and in C you read them as argc/argv like normal. Environment variables are available like in unix, but global variables, rather than as a memory structure, are stored as files in the ENV: assignment (virtual device that works like a soft link, or a drive assignment in Windows). You can manipulate them with the setenv command. Shells also have local environment variables and these work more like in unix.

Last edited by AmigaHope; 29 March 2020 at 12:10.
AmigaHope is offline  
Old 30 March 2020, 04:22   #31
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Quote:
Originally Posted by AmigaHope View Post
In a CON: though, just cd to the directory that you put your executable in, then type the name of the executable.
Thanks, in the WinUAE tutorial I did, they explained how to setup a PC directory as a device, I've been just dropping the executable in there and running them from there with the right-mouse execute-command, seems to work.
Curbie is offline  
Old 01 April 2020, 19:56   #32
AmigaHope
Registered User
 
Join Date: Sep 2006
Location: New Sandusky
Posts: 942
Quote:
Originally Posted by Curbie View Post
Thanks, in the WinUAE tutorial I did, they explained how to setup a PC directory as a device, I've been just dropping the executable in there and running them from there with the right-mouse execute-command, seems to work.
Yeah that just executes the program and opens a bare-bones CON: if needed for standard output.

As you build more complex software you'll get to know the Amiga HUNK executable format (equivalent to say, ELF in Linux). Right now your assembler is just building your hunks for you but if you want to build more complex Amiga software getting to know hunk allocations is good as it lets you organize code, CPU data, audiovisual data, etc. Any static memory resources your program needs will be allocated on load in hunks of different types (vs. dynamic allocation of further memory hunks).

Last edited by AmigaHope; 01 April 2020 at 20:02.
AmigaHope is offline  
Old 01 April 2020, 22:27   #33
Jope
-
 
Jope's Avatar
 
Join Date: Jul 2003
Location: Helsinki / Finland
Age: 43
Posts: 9,861
Quote:
Originally Posted by Curbie View Post
Now, to figure out how to load and run a test executable in WinUAE.
If it's all in one exe and it doesn't need any additional files, just drag and drop it into DF0: in the floppy drive config section and boot the amiga. WinUAE will build a RAM based bootable disk image with your exe.
Jope is offline  
Old 02 April 2020, 01:23   #34
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Quote:
Originally Posted by AmigaHope View Post
Yeah that just executes the program and opens a bare-bones CON: if needed for standard output.

As you build more complex software you'll get to know the Amiga HUNK executable format (equivalent to say, ELF in Linux). Right now your assembler is just building your hunks for you but if you want to build more complex Amiga software getting to know hunk allocations is good as it lets you organize code, CPU data, audiovisual data, etc. Any static memory resources your program needs will be allocated on load in hunks of different types (vs. dynamic allocation of further memory hunks).
Thanks AmigaHope, just started the book "Total Amiga Assembler" and will check it for HUNK use, although since it's the only Amiga assembler book I've run into (don't really need another Mc68000 CPU book), I'm sure I'll track down HUNK definition and use in due time if it's not covered.
Curbie is offline  
Old 02 April 2020, 01:33   #35
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Thanks for the reply Jope, was mostly concerned about debugging, but will test your DF0: to RAM based bootable disk image notion.
Curbie is offline  
Old 22 January 2021, 23:59   #36
alcomatt
Registered User
 
Join Date: Jan 2021
Location: South Croydon
Posts: 33
Quote:
Originally Posted by AmigaHope View Post
If you want to learn 680x0 assembly, a good bet would be an Amiga running Linux/68k. This means you'll need an Amiga with an MMU, which generally means a 68030+ -- no EC versions, though the A2620 CPU card for the A2000 is the one exception which is a 68020 card with an external MMU.

The reason I suggest running Linux is because AmigaOS has no inbuilt memory protection. You can run your code on AmigaOS inside Enforcer for testing (Enforcer is an MMU tool for AmigaOS) but it is a bit of a pain in the ass. Linux makes it easy to learn without bringing the whole OS down on accident.

If you want to learn advanced 680x0 stuff involving drivers and interrupts etc. though then AmigaOS is actually way better for this for precisely the same reason -- the whole system is visible to you.

Finally, coding for the Amiga is fun because its custom chipset has a rich array of features not found on other platforms of the era (and really not seen today either now that everything is done via CPU or GPU via heavily-abstracted APIs). It's more like writing code for the 16-bit consoles (or the custom-chipset-oriented 32-bit ones like the Saturn and PC-FX)
You can safely code under x86 linux and cross compile for m68k. Lots of people do that in demoscene these days , test first in emu then on real hardware...
alcomatt is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:42.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09196 seconds with 14 queries