why use ASM anymore

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

why use ASM anymore

Postby MrPixel » Fri Mar 16, 2018 3:12 am

what's the point? it's complicated and takes longer do simple operations that you can get done in 5 seconds flat on Basic and C. granted, certain people still have a soft spot but people, the days of MLX and Compute! are gone. thoughts?

wietze
Captain Atari
Captain Atari
Posts: 221
Joined: Fri Mar 01, 2013 10:52 pm

Re: why use ASM anymore

Postby wietze » Fri Mar 16, 2018 6:37 am

What you lose in programming time, you gain in cpu time.

If execution computing speed is of the essence, using asm on the atari is the only way to push the envelope on the machine.

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 123
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: why use ASM anymore

Postby metalages » Fri Mar 16, 2018 7:14 am

Using a mix is the most productive. There are things you cannot do in c only. In particular when dealing with interrupts, synchro code...

User avatar
spiny
Disk Imager Supreme
Disk Imager Supreme
Posts: 2488
Joined: Mon Aug 11, 2003 11:53 pm
Location: just outside bristol
Contact:

Re: why use ASM anymore

Postby spiny » Fri Mar 16, 2018 7:32 am

MrPixel wrote:what's the point? it's complicated and takes longer do simple operations that you can get done in 5 seconds flat on Basic and C. granted, certain people still have a soft spot but people, the days of MLX and Compute! are gone. thoughts?


Please show us your full screen demo written in basic.

joska
Hardware Guru
Hardware Guru
Posts: 4150
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: why use ASM anymore

Postby joska » Fri Mar 16, 2018 7:41 am

MrPixel wrote:what's the point?


Because it's fun. No other reason needed, although there are several good reasons for choosing assembler over BASIC. Not so many to choose assembler over C though.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
shoggoth
Nature
Nature
Posts: 942
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: why use ASM anymore

Postby shoggoth » Fri Mar 16, 2018 8:10 am

Some things cannot be achieved at all in other languages.
Ain't no space like PeP-space.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: why use ASM anymore

Postby Frank B » Fri Mar 16, 2018 11:33 am

Because it's a specialist skill and it's valuable to an employer. Basic programmers would be lost reverse engineering anything for example. Even mobile developers seem to lack low level skills these days.

joefish
Atari maniac
Atari maniac
Posts: 82
Joined: Thu Dec 05, 2013 4:15 pm

Re: why use ASM anymore

Postby joefish » Fri Mar 16, 2018 11:42 am

Depends on the system. A compiled language like C/C++ is the best way to take advantage of modern multi-core systems as it can prepare your code to run in a whole range of multi-threaded ways; can make flexible links to a range of different software and hardware interfaces, etc.
Any interpreted language like BASIC is still slow. Just-in-time compilation (i.e. compile when you run) or partial compilation to run on a 'virtual machine' (like Java) are fairly good compromises, as compilation times can be quick. But again, the result won't have all the optimisations that a really smart compiler can make of your code.

But if you're going back to a retro machine, or something with a fixed and limited architecture, then there really is nothing that can compare with assembly. No compiler is going to be able to produce the sort of clock-cycle-counted code that runs in the best ST demos, for example.

Your argument is also flawed. It might only take seconds to program something in BASIC that could take half an hour to write and test in assembly, but if that 'thing' has to run a billion times a day for the next ten years then it's worth taking the time to do it in assembly, or at least a compiled language like C/C++, as it'll save a hell of a lot of resources over the lifetime.

chicane
Atari freak
Atari freak
Posts: 72
Joined: Mon Jul 02, 2012 11:25 am
Location: Leeds, UK

Re: why use ASM anymore

Postby chicane » Fri Mar 16, 2018 1:28 pm

MrPixel wrote:what's the point? it's complicated and takes longer do simple operations that you can get done in 5 seconds flat on Basic and C. granted, certain people still have a soft spot but people, the days of MLX and Compute! are gone. thoughts?


You're trolling right? :D

Much of the appeal of playing with old machines like the ST stems from pushing the limits - making the creaky and ancient silicon do things from a technical standpoint that were never previously believed to be possible. I just don't think it's going to happen without assembly language.

My preferred approach is to write everything in C first, identify the performance bottlenecks, and then rewrite these areas in assembly language. This gives you most of the benefits of a pure assembly language approach with (for me at least) a much smaller implementation timeframe. This is what I did when writing ST Pole Position by the way.

User avatar
Estrayk
Captain Atari
Captain Atari
Posts: 195
Joined: Mon Nov 23, 2015 2:52 pm
Location: Spain

Re: why use ASM anymore

Postby Estrayk » Fri Mar 16, 2018 2:15 pm

Try to code any effect from this demo in Basic and you´ll find you own answer.

https://www.youtube.com/watch?v=1cDFvHq-Wgs
・Falcon ct60e・Atari MegaSTE ・Atari STe ・MIST ・

Moulinaie
Captain Atari
Captain Atari
Posts: 202
Joined: Wed Feb 01, 2012 9:34 pm

Re: why use ASM anymore

Postby Moulinaie » Fri Mar 16, 2018 2:48 pm

MrPixel wrote:what's the point? it's complicated and takes longer do simple operations that you can get done in 5 seconds flat on Basic and C. granted, certain people still have a soft spot but people, the days of MLX and Compute! are gone. thoughts?


1) Because it's fun.
2) because when you're used to it, you think in ASM and the program comes easely
3) because you get the total control of the machine and don't have to wait for a language to provide every library you need
4) ASM optimizing is really cool. It's harder to do it with another language as a change in the compiler can totally disturb something optimized.
5) binary operations are really easy in ASM (image encoding/decoding, compacting data into one LONG word etc....)

Then, I really like Basic, it's a very fast way to test an algorithm and get input/output.

(I'm only talking about Atari and machines of this generation! The most recent machine where I programmed in ASM was a PC with single core and WindowsXP)

Guillaume.

Zippy
Captain Atari
Captain Atari
Posts: 161
Joined: Sun Feb 01, 2004 1:58 am

Re: why use ASM anymore

Postby Zippy » Fri Mar 16, 2018 3:00 pm

"We do these things not because they are easy, but because they are hard"

https://www.youtube.com/watch?v=6z1DidldxUo

:)

There's a feeling of being "at one" with the processor which can only be achieved with low level programming, a bit like comparing driving a manual car to an automatic.

I started on BASIC and also used Pascal, COBOL and Clipper in the 80's, all of which were good at the time for certain applications, but since then have only used various assemblers. Luckily there are still some niche applications like embedded microcontrollers and reverse engineering where assembler is still very useful.

I look at the newer high level languages like C++ (hell I never even learned C) with total horror and would rather give up coding altogether than use that stuff.

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: why use ASM anymore

Postby thomas3 » Fri Mar 16, 2018 3:19 pm

MrPixel wrote:what's the point? it's complicated and takes longer do simple operations that you can get done in 5 seconds flat on Basic and C. granted, certain people still have a soft spot but people, the days of MLX and Compute! are gone. thoughts?


Personally, I don't think there is any point in programming ANYTHING any more. Instead, I just close my eyes and imagine what a program looks like instead.

Dude, you should see the effects I can pull off nowadays. There are simply no limitations. For instance, just yesterday in 5 seconds, I created a full overscan 50hz 512 colour rotating rhombic triacontahedron, in medium resolution, on a normal ST, just by imagining it.

It's the FUTURE!

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12468
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: why use ASM anymore

Postby wongck » Fri Mar 16, 2018 3:39 pm

Whoa... it works.
My STFM was streaming Netflix Youtube of Kids trashing an Amiga.
It also cooked my dinner of BBQ chicken with noodles and mango chutney.... WTF must be some bug in that ASM dinner code.
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: why use ASM anymore

Postby Foxie » Fri Mar 16, 2018 5:29 pm

MrPixel wrote:what's the point? it's complicated and takes longer do simple operations that you can get done in 5 seconds flat on Basic and C. granted, certain people still have a soft spot but people, the days of MLX and Compute! are gone. thoughts?


C isn't much easier than assembly really. You end up with a similar line count to do the same kinds of tasks. Certain things are more attractive to read in C, like linked lists of big structures. However, if you wrote the code and understand it well then it isn't a huge advantage.

BASIC is usually easier and more convenient than either assembly or C. However, it lacks structured features that assembly and C have - like the ability to work with structs and OO programming. On a big program, this can make BASIC actually harder than assembly or C.

Assembly is absolutely 100% necessary if you want fast code. No matter how good compilers get, it's just too difficult to make timing guarantees when working at a high level. The sorts of situations where you need to make guarantees are when working with sync code on the Atari, or programming an MCU for time critical tasks. The only sort of MCUs where it makes sense to use C are larger 32 bit devices. Those usually have cache, rendering your timing guarantees pointless.

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: why use ASM anymore

Postby MrPixel » Fri Mar 16, 2018 6:16 pm

chicane wrote:
MrPixel wrote:what's the point? it's complicated and takes longer do simple operations that you can get done in 5 seconds flat on Basic and C. granted, certain people still have a soft spot but people, the days of MLX and Compute! are gone. thoughts?


You're trolling right? :D

Much of the appeal of playing with old machines like the ST stems from pushing the limits - making the creaky and ancient silicon do things from a technical standpoint that were never previously believed to be possible. I just don't think it's going to happen without assembly language.

My preferred approach is to write everything in C first, identify the performance bottlenecks, and then rewrite these areas in assembly language. This gives you most of the benefits of a pure assembly language approach with (for me at least) a much smaller implementation timeframe. This is what I did when writing ST Pole Position by the way.


i'm not trolling, just stating my opinion. if i was trolling, i'd have insulted people for using assembly, but i'm not that person

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: why use ASM anymore

Postby MrPixel » Fri Mar 16, 2018 6:20 pm

i've read some of the old compute magazines and found the MLX program to be insufficient, so i understand the appeal of ASM to a point. my question is this: is there a way to do assembly on an atari 800 through BASIC? (IT won't get an assembler and i'm too cheap to buy one).

any example code? thanks

sporniket
Atariator
Atariator
Posts: 17
Joined: Fri Feb 16, 2018 5:39 pm

Re: why use ASM anymore

Postby sporniket » Fri Mar 16, 2018 6:32 pm

MrPixel wrote:i've read some of the old compute magazines and found the MLX program to be insufficient, so i understand the appeal of ASM to a point. my question is this: is there a way to do assembly on an atari 800 through BASIC? (IT won't get an assembler and i'm too cheap to buy one).

any example code? thanks


I read an article recently about that (I don't have a link though), but the workflow was :

[*]write assembly code on paper
[*]convert manually into opcodes and values => the "data"
[*]write a basic program with "DATA ..." lines using the "data" you got on previous step
[*]the basic program read the data, poke them into memory, then there is a call to this memory, et voilà.

very cumbersome, time consuming and error prone.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: why use ASM anymore

Postby Foxie » Fri Mar 16, 2018 6:38 pm

MrPixel wrote:i've read some of the old compute magazines and found the MLX program to be insufficient, so i understand the appeal of ASM to a point. my question is this: is there a way to do assembly on an atari 800 through BASIC? (IT won't get an assembler and i'm too cheap to buy one).


I don't know about the Atari 800 specifically, but inline assemblers were uncommon on 8 bit micros. The Acorn machines were the exception rather than the rule. Perhaps you could cross-assemble using a BBC and some method of transferring data to the Atari.

User avatar
troed
Atari God
Atari God
Posts: 1428
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: why use ASM anymore

Postby troed » Fri Mar 16, 2018 6:54 pm

MrPixel wrote:i'm not trolling, just stating my opinion. if i was trolling, i'd have insulted people for using assembly, but i'm not that person


No, no insults needed. This post (and it's not your first) is actually a textbook case of trolling in its original sense.

In Internet slang, a troll (/troʊl, trɒl/) is a person who sows discord on the Internet by starting quarrels or upsetting people, by posting inflammatory,[1] extraneous, or off-topic messages in an online community (such as a newsgroup, forum, chat room, or blog) with the intent of provoking readers into an emotional response[2] or of otherwise disrupting normal, on-topic discussion,[3] often for the troll's amusement.
[wikipedia]

After having seen a few of your threads I'm certain that you are, on purpose, trolling this forum.

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: why use ASM anymore

Postby thomas3 » Fri Mar 16, 2018 8:00 pm

MrPixel may be a troll, but we should give the guy some credit at least for being a niche troll.

His Collosal Cave listing was legit funny :lol:

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 763
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: why use ASM anymore

Postby mfro » Fri Mar 16, 2018 8:05 pm

MrPixel wrote:... my question is this: is there a way to do assembly on an atari 800 through BASIC? (IT won't get an assembler and i'm too cheap to buy one)...


You can write an assembler in Basic, and once you have that, you can use this and write it again in assembler. That's how it has been done in the past.

User avatar
Maartau
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2618
Joined: Thu Dec 15, 2005 2:15 am
Location: France

Re: why use ASM anymore

Postby Maartau » Fri Mar 16, 2018 8:28 pm

viewtopic.php?f=30&t=11631&p=341420&hilit=introduce+yourself#p341420

MrPixel wrote:hello, from lodi

think fresh prince but replace Philly with stockton and Bel-air with lodi

i grew up idolizing the 90's hip hop scene, started out on windows 98 and eventually got an XP, where i learned (and am still learning as of now) basic. i am teaching atari basic at program and adore old technology and movies. Alien, the War of the worlds (1950), i love them all. i also am a sucker for old video games, especially atari 2600. i am a star wars nerd and consider star trek to be, while inferior in many ways, a decent successor. i never understood the show's popularity but i will admit to liking the nes games. i LOVE ghostbusters and think Gozer and Zuul are AWESOME. Walter peck was a dick, but he had a point. Empire strikes back, the return of the jedi, star wars at its best (screw the "special editions".

my philosophy is this: mistakes make us better and desks bolted to the floor and forced lectures, bring us down. you program your own way, students are not robots and school is not an assembly line. I advocate Open source software and also endorse the GNU public license. if you download a software program, you retain the rights and should not be folded into some shitty "you will defend us" bullshit that takes away your rights. Viacom and its followers have done that already. if i want shitty programming, I'll work for EA.

If you like Pascal, program in Pascal. Basic? program in BASIC. do not assume that i am a "noob" (which i find extremely offensive and derogatory) just because i am a beginner, me or anyone else. Judgment is for God alone.

24 year old Christian. Born and Raised

Favorite NFL team: 49ers

Favorite series: Avatar the last airbender

Favorite rapper: subjective, liked eminem, now moving on to Masta Ace, but i respect the architects of rap.

Pet peeve: Lazy video game design. the NES had great games, but good cover art do not a good game make. Raid 2020, Rambo, Predator, freaking TMNT (not 2 or 3, they rocked and i finally beat it, cheats were used, but i beat it. that and contra). how bad were they. T2 for nes made me want to boil the cart in lava, rip open the nes and deface it by writing Sega over Nintendo, then get a Sega master system.

Worst use of a beloved Series: 2. the Last Airbender and Scary movie. some movies should not be parodied.

sorry for the long list.

I don't think a troll, simply somebody :) .

User avatar
Total Eclipse
Captain Atari
Captain Atari
Posts: 222
Joined: Tue Jul 20, 2004 2:20 pm
Location: Sheepy Magna, UK

Re: why use ASM anymore

Postby Total Eclipse » Fri Mar 16, 2018 9:04 pm

MrPixel wrote:... my question is this: is there a way to do assembly on an atari 800 through BASIC? (IT won't get an assembler and i'm too cheap to buy one)...

That's how some 8-bit magazines did type in listings (definitely when I read Page 6).

You'd have a few lines of basic, essentially a loop to read DATA statements and poke them to an address, followed by dozens of lines data values that were actually the program code.
Atari equipment all in storage - Now playing with MiST :)

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: why use ASM anymore

Postby MrPixel » Fri Mar 16, 2018 9:06 pm

Maartau wrote:http://www.atari-forum.com/viewtopic.php?f=30&t=11631&p=341420&hilit=introduce+yourself#p341420

MrPixel wrote:hello, from lodi

think fresh prince but replace Philly with stockton and Bel-air with lodi

i grew up idolizing the 90's hip hop scene, started out on windows 98 and eventually got an XP, where i learned (and am still learning as of now) basic. i am teaching atari basic at program and adore old technology and movies. Alien, the War of the worlds (1950), i love them all. i also am a sucker for old video games, especially atari 2600. i am a star wars nerd and consider star trek to be, while inferior in many ways, a decent successor. i never understood the show's popularity but i will admit to liking the nes games. i LOVE ghostbusters and think Gozer and Zuul are AWESOME. Walter peck was a dick, but he had a point. Empire strikes back, the return of the jedi, star wars at its best (screw the "special editions".

my philosophy is this: mistakes make us better and desks bolted to the floor and forced lectures, bring us down. you program your own way, students are not robots and school is not an assembly line. I advocate Open source software and also endorse the GNU public license. if you download a software program, you retain the rights and should not be folded into some shitty "you will defend us" bullshit that takes away your rights. Viacom and its followers have done that already. if i want shitty programming, I'll work for EA.

If you like Pascal, program in Pascal. Basic? program in BASIC. do not assume that i am a "noob" (which i find extremely offensive and derogatory) just because i am a beginner, me or anyone else. Judgment is for God alone.

24 year old Christian. Born and Raised

Favorite NFL team: 49ers

Favorite series: Avatar the last airbender

Favorite rapper: subjective, liked eminem, now moving on to Masta Ace, but i respect the architects of rap.



Pet peeve: Lazy video game design. the NES had great games, but good cover art do not a good game make. Raid 2020, Rambo, Predator, freaking TMNT (not 2 or 3, they rocked and i finally beat it, cheats were used, but i beat it. that and contra). how bad were they. T2 for nes made me want to boil the cart in lava, rip open the nes and deface it by writing Sega over Nintendo, then get a Sega master system.

Worst use of a beloved Series: 2. the Last Airbender and Scary movie. some movies should not be parodied.

sorry for the long list.

I don't think a troll, simply somebody :) .


i appreciate that


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 4 guests