English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Asm / Hardware (https://eab.abime.net/forumdisplay.php?f=112)
-   -   help learning asm, needed ?? (https://eab.abime.net/showthread.php?t=97292)

Hewitson 10 May 2019 18:11

The problem is, what you want to do is far from simple. I think you really underestimate how difficult it is to code a demo or game. Out of thousands who try only a few succeed.

DanScott 10 May 2019 20:43

Quote:

Originally Posted by Hewitson (Post 1320524)
The problem is, what you want to do is far from simple. I think you really underestimate how difficult it is to code a demo or game. Out of thousands who try only a few succeed.

Utter nonsense....

I learned very quickly in 1990 from just 2 books... the Hardware Reference Manual, and the System Programmers Guide.

Most of the first steps in Amiga programming (setting up a copper-list, bitplanes etc..) can be accomplished with only a very basic "sub-set" of 68000 instructions (primarily the MOVE instructions)

Take baby steps... start simple.. and then explore...

mcgeezer 10 May 2019 23:45

Many people on this forum have helped me massively in my own quest to make games and achieve something I thought was beyond me.

I joined the board on 31 October 2017 after 25 years of not really touching an Amiga or assembler... one of the first bits of code I created with Devpac was to draw a simple picture to the screen.

Here is that assembler.... (yes it's shit)

http://www.seismicminds.com/downloads/disp1.s

and the required image....

http://www.seismicminds.com/downloads/bombjack.iff

As Dan says.... take small steps, experiment with others code.. change the code, try and understand what it does, before long you will start to break down barriers and it will begin to click.

2 years on and I've learned so much, and even in another 2 years I'll probably not know as much as some of the coders here have forgotten, but we all must start somewhere.

Below is the thread that got me started back into the Amiga, if you want I am happy to upload all of the early source files for you to experiment with, I would caveat it though in that I made lots of mistakes.... the biggest one being not using memory management.... ALWAYS USE MEMORY MANAGEMENT.

http://eab.abime.net/showthread.php?t=89271


Edit... If you want to make games... an understanding of the principles of Object Orientated Programming will be a massive help.

Galahad/FLT 10 May 2019 23:55

Quote:

Originally Posted by DanScott (Post 1320549)
Utter nonsense....

I learned very quickly in 1990 from just 2 books... the Hardware Reference Manual, and the System Programmers Guide.

Most of the first steps in Amiga programming (setting up a copper-list, bitplanes etc..) can be accomplished with only a very basic "sub-set" of 68000 instructions (primarily the MOVE instructions)

Take baby steps... start simple.. and then explore...

I think your progression was one of the more drastic, as I remember you as primarily a graphics artist before you became a coder,

jotd 11 May 2019 10:40

The main problem is often time. When you have a full-time job already it's difficult to put in extra effort to learn a completely different topic.

I remember in 1991 I had my amiga I wanted to do something with it beside games. Someone gave me a copy of some Micro application asm book, and I bought Action Replay MKIII (excellent investment) to crack games (I already knew 6502 asm & C)

I also got hold of the amiga bible (translated in french, that helped at the time), comprehensive book about custom chips & CIAs

I was young, no children, a lot of time on my hands. Certainly helped.

That said, I never got into proper game coding. I "just" coded an emulator then JST & all the hd game stuff.

It's difficult to want to embrace all the goals at the same time though: a game is complex: there are graphics, level design, sound, file I/O, controls, tasks, interactions with the OS... you can't learn all that in one day. One step at a time as Dan said.

And even mcgeezer admitted that he shouldn't have written Rygar in asm. Better do a mix of C & asm. C does the tedious loading/organizing/hiscore/computation parts that don't require too much speed. asm does the "fast" parts.

note that a lot of games are coded in C only. They're not the fastest, but still... (Marble Madness, Cinemaware games, Lucas Arts, Sierra)

deimos 11 May 2019 15:37

My recommendation would be to spend some time with a good disassembler. Find a bit of code to analyse that's big enough to be interesting and start adding labels and comments until you end up with a fully documented piece of code that you understand well. Then improve it. If it wasn't originally written in optimised assembly then optimise it. Rinse and repeat until you've reached the level you're looking for.

Another similar suggestion, if you're comfortable with C, would be to write something in C, make it feature complete, then find the handful of functions that are "hotspots" and rewrite them in assembler. You can even start with the compiler generated assembly to give you a working, if non-optimal, starting point.

DanScott 11 May 2019 16:40

Quote:

Originally Posted by deimos (Post 1320674)
My recommendation would be to spend some time with a good disassembler. Find a bit of code to analyse that's big enough to be interesting and start adding labels and comments until you end up with a fully documented piece of code that you understand well.

This actually requires a more serious knowledge of assembler though...

I believe that the OP is starting from scratch with learning 68k

nogginthenog 11 May 2019 18:15

On the bright side 68000 assembly probably has one of the easiest syntaxes to learn. It has a very orthogonal instruction set (even if it's the assembler that's doing the work).

Many CPUs have specialised registers but on the 68000 you often don't care (apart from the address/data register split). Lots of registers too!

zero 13 May 2019 10:27

With 68k you can do a lot with a small number of instructions. You only really need the more obscure ones when you start optimizing.

The biggest pain is the toolset itself. WinUAE helps a lot with the build-in debugger, even if it's not the most friendly. But stuff like cross-development with a source level debugger doesn't exist.

Also it's easy to crash the machine and there are no exceptions when you have a bad pointer, so you have to get good at debugging stuff with minimal help.

Not even a decent modern C compiler... So you have to struggle at first.

Some kind of cross development system would be very helpful I think. I saw one for the Megadrive (also 68k based) which was kinda like an Action Replay but connected to a PC, so you could single step and debug at source level and see the results in real-time.

Might be possible with an A500, or with WinUAE.

roondar 13 May 2019 10:35

WinUAE does let you single step through code. Though if you're running with the OS it will show you the code from interrupts as well as they happen. Which might be confusing for a beginner.

But you hit the nail on the head: one of the biggest challenges with assembly language is the lack of 'help' the system/assembler/etc give you. Even in the best case it can still be difficult to pinpoint errors.

mcgeezer 13 May 2019 10:38

I use WinUAE, Notepad++ with VASM.

I have notepad++ configured like below...

If I press shift+F10 I can build a project in under 1 second.
If I press shift+F11 I can test a project... takes about 2 seconds with Warp mode
If I press shift+F12 I can debug the project with MonAm hooked

It's an extremely fast tool chain and works really well for all of my needs.

DanScott 13 May 2019 11:21

Quote:

Originally Posted by zero (Post 1320986)

Some kind of cross development system would be very helpful I think. I saw one for the Megadrive (also 68k based) which was kinda like an Action Replay but connected to a PC, so you could single step and debug at source level and see the results in real-time.

Might be possible with an A500, or with WinUAE.

SNASM was a pretty useful cross development system back in the days of Amiga game development... the debugging was great!

kasio 13 May 2019 14:23

I quite enjoyed this beginners introduction to 68k asm:
http://mrjester.hapisan.com/04_MC68/

hooverphonique 13 May 2019 14:40

Quote:

Originally Posted by DanScott (Post 1320999)
SNASM was a pretty useful cross development system back in the days of Amiga game development... the debugging was great!


I remember some Amiga demo mentioning it probably being the first developed using snasm on a 386 - might even have been an Anarchy demo :)

DanScott 13 May 2019 15:01

Quote:

Originally Posted by hooverphonique (Post 1321020)
I remember some Amiga demo mentioning it probably being the first developed using snasm on a 386 - might even have been an Anarchy demo :)

Could even have been Anarchy - Seeing Is Believing... that I coded :D :D

prb28 13 May 2019 15:18

Quote:

Originally Posted by zero (Post 1320986)
But stuff like cross-development with a source level debugger doesn't exist.


Yes it does exist with Visual Studio Code and this extension: https://github.com/prb28/vscode-amiga-assembly .

;)

nogginthenog 13 May 2019 20:56

Quote:

Originally Posted by zero (Post 1320986)
Not even a decent modern C compiler... So you have to struggle at first.

Bebbos GCC (6.x?) cross compiler is good.
https://github.com/bebbo/amiga-gcc

There was some talk of a LLVM/CLANG port (was it the Rust guys?)

turrican3 14 May 2019 02:32

Quote:

Originally Posted by Ami (Post 1320521)
I've read dozens of asm books but I learned nothing, until I've read this -> http://chaozer.ikod.se/asmtut.shtml. But this is only step 1, you need step 2, so I would recommend one of the suggestions above, especially look for something which teach you asm+os coding. Good luck! :)

Thank you,
i hope it will help everyone, i'm sure i'm not alone to try to code in ASM.
Every amigans should try, we need more tools, more games, etc...
Thank you guys. :great

zero 14 May 2019 10:24

Quote:

Originally Posted by DanScott (Post 1320999)
SNASM was a pretty useful cross development system back in the days of Amiga game development... the debugging was great!

That's the kind of thing we want but in WinUAE. Source level debugging, very fast.

roondar 14 May 2019 13:36

Ah, that'd be the holy grail really.
I love the WinUAE debugger, but source level debugging would be the bee's knees.


All times are GMT +2. The time now is 17:24.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05393 seconds with 11 queries