Assembly learning (39)

1 Name: #!/usr/bin/anon 2006-02-04 20:04 ID:KUa2XIM6

What's a good place online to learn about assembly in a modern context? The places I found before seemed to be outdated.

2 Name: #!/usr/bin/anon 2006-02-04 21:37 ID:m7p4v5fL

4 Name: #!/usr/bin/anon 2006-02-05 09:50 ID:uWwD2hYX

Try The Art of Assembly Language Programming: http://webster.cs.ucr.edu/AoA/index.html

5 Name: !WAHa.06x36 2006-02-06 14:32 ID:X2/YlxpV

Are you learning assembly on some sane platform, or on x86?

6 Name: #!/usr/bin/anon 2006-02-06 23:58 ID:KUa2XIM6

What are the sane platforms??

7 Name: #!/usr/bin/anon 2006-02-07 00:08 ID:Ya9rRN5j

RISC platforms with lots of registers, so you don't have to deal with too much memory management. I learned on SPARC.

8 Name: #!/usr/bin/anon 2006-02-07 01:31 ID:Heaven

Sane platforms? More like "platforms nobody uses", amirite?

9 Name: #!/usr/bin/anon 2006-02-07 06:56 ID:OkL/lBbo

If you dislike things that nobody uses, why are you learning assembly?

10 Name: #!/usr/bin/anon 2006-02-07 07:11 ID:Heaven

Silly rabbit, RISC is for compilers, not humans!

11 Name: #!/usr/bin/anon 2006-02-07 08:09 ID:KPdBue1H

> Silly rabbit, RISC is for compilers, not humans!

How pleasent it would be if this was true. In the name of backward compatibility x86 wants CISC instructions that it translates itself to RISC before executing.

12 Name: #!/usr/bin/anon 2006-02-08 02:15 ID:LGZULuA1

>>9
I (>>8) am not, but lots of people use assembly. It's just confined to things that have to be really fast now, e.g. games.

13 Name: KJI!XDpPLAUYlQ 2006-02-23 04:03 ID:gHytwq6+

Assembly Language ia giving me a headache.

Would anyone happen to know if there's a "Assembly Language for Dummies" book?

14 Name: #!/usr/bin/anon 2006-02-24 19:31 ID:LGZULuA1

No.

In case you're not actually an idiot, I've heard good things about Kip Irvine's book Assembly Language for Intel-Based Computers.

http://en.wikipedia.org/wiki/Special:Booksources/0130910139

15 Name: #!/usr/bin/anon 2006-02-24 19:39 ID:Heaven

>Assembly Language for Dummies
>Assembly Language for Intel-Based Computers

lol

16 Name: #!/usr/bin/anon 2006-02-24 23:37 ID:j0uyHa3l

You should learn IA64 asm.

17 Name: #!/usr/bin/anon 2006-02-25 06:35 ID:3rhw9iUF

>>16
no one uses IA64...
you should learn 6502 assembly instead.
i actually have a book called "Programming a Microcomputer: 6502" that was published in 1978...

18 Name: #!/usr/bin/anon 2006-02-25 12:51 ID:Heaven

>>17
Didn't the NES use one of those?

19 Name: #!/usr/bin/anon 2006-02-25 16:58 ID:eM+xKHc2

>>18
http://en.wikipedia.org/wiki/6502

>One of the first "public" uses for the design was the Atari 2600 videogame console. The 2600 used an offshoot of the 6502 called the 6507, which had fewer pins and could address only 8 KB of RAM as a result. Millions would be sold in this form. The 6502 was next used in the Apple II family, and then quickly appeared in various Commodore and Atari home computers, the BBC Micro family, and a huge number of other designs now lost to history. The 6510, a direct successor to the 6502 with a digital I/O port and a tristate bus, was the CPU utilized in the extremely popular Commodore 64 home computer.
>Another important use of the 6502 was in the Nintendo Famicom, a Japanese video game console. Its North American and European equivalent, the Nintendo Entertainment System, also got the 6502. The 6502 used in the NES was a modified version (called 2A03 in NTSC consoles and 2A07 in PAL consoles, the difference being the clock divider ratio) that was produced solely for Nintendo. The custom NES processor lacked the 6502's decimal mode, but added 22 memory-mapped registers for sound generation, joypad reading, and sprite DMA.

if you're seriously going to try writing assembly for this architecture, you'll probably want to check out the section titled "Dubious features" in that article...

20 Name: #!/usr/bin/anon 2006-02-26 07:21 ID:/bkpsonp

Assembly Language Step-by-Step:

http://www.duntemann.com/assembly.htm

21 Name: #!/usr/bin/anonymous : 2006-02-28 17:38 ID:/Kiqw7oC

>>17
No one uses it, but it's still great!

22 Name: #!/usr/bin/anonymous : 2006-02-28 19:26 ID:Muo7ASQB

The 68000 was the processor I learned assembly on. I've also tried 6502 and x86, but neither of them are as fun to programme for as 68k processors.

23 Name: #!/usr/bin/anonymous : 2006-02-28 19:56 ID:393L4sIP

Ah yeah, I've got a buddy I talk to online who's always telling me how great 68k assembly is. He sent me a C program once that was converted from 68k assembly. I bet he won't mind if I post it here:

/* 13371z3r written in "68000" */


#include <stdio.h>

char d0b;
char*a0b;
long d0l;
long*a0l;
long*a7l;
char status;
unsigned char mainmemory[1024]="leet TESTING string";

main()
{
a7l=1024+mainmemory; // movea.l #1024,a7
a0b=a0l=mainmemory; // move.l #mainmemory,a0
*(--a7l)=a0b=a0l; // movea.l a0,-(a7)

loop: status=d0b=*a0b; // loop: move.b (a0),d0
if(!status)goto finished; // beq finished

status=d0b-='A'; // subi.b #'A',d0b
if(status<0)goto quit2; // bmi quit2
status=d0b-=26; // subi.b #26,d0b
if(!(status<0))goto quit1; // bpl quit1
d0b+=('z'+1); // addi.b #'z'+1,d0b
goto go; // bra go

quit1: d0b+=27; // quit1: addi.b #27,d0b
quit2: d0b+='A'; // quit2: addi.b #'A',d0b
go: // go:


status=d0b-'t'; // cmpi.b #'t',d0
if(status)goto l2; // bne l2
*(a0b++)='7'; // move.b #'7',(a0)+
goto loop; // bra loop

l2: status=d0b-'l'; // l2 cmpi.b #'e',d0
if(status)goto l3; // bne l3
*(a0b++)='1'; // move.b #'3',(a0)+
goto loop; // bra loop

l3: status=d0b-'a'; // l3 cmpi.b #'e',d0
if(status)goto l4; // bne l4
*(a0b++)='4'; // move.b #'3',(a0)+
goto loop; // bra loop

l4: status=d0b-'b'; // l4 cmpi.b #'e',d0
if(status)goto l5; // bne l5
*(a0b++)='8'; // move.b #'3',(a0)+
goto loop; // bra loop

l5: status=d0b-'g'; // l5 cmpi.b #'e',d0
if(status)goto l6; // bne l6
*(a0b++)='6'; // move.b #'3',(a0)+
goto loop; // bra loop

l6: status=d0b-'j'; // l6 cmpi.b #'e',d0
if(status)goto l7; // bne l7
*(a0b++)='9'; // move.b #'3',(a0)+
goto loop; // bra loop

l7: status=d0b-'o'; // l7 cmpi.b #'e',d0
if(status)goto l8; // bne l8
*(a0b++)='0'; // move.b #'3',(a0)+
goto loop; // bra loop

l8: status=d0b-'s'; // l8 cmpi.b #'e',d0
if(status)goto l9; // bne l9
*(a0b++)='5'; // move.b #'3',(a0)+
goto loop; // bra loop

l9: status=d0b-'e'; // l9 cmpi.b #'e',d0
if(status)goto end; // bne end
*(a0b++)='3'; // move.b #'3',(a0)+
goto loop; // bra loop

end: // end:
a0b++; // addq.l #1,a0
goto loop; // bra loop
finished: d0l=0; // finished: moveq #0,d0
*(a0b++)=d0l; // move.b d0,(a0)+
*(a0b++)=d0l; // move.b d0,(a0)+
*(a0b++)=d0l; // move.b d0,(a0)+
*(a0b++)=d0l; // move.b d0,(a0)+
*(a0b++)=d0l; // move.b d0,(a0)+
*(a0b++)=d0l; // move.b d0,(a0)+
*(a0b++)=d0l; // move.b d0,(a0)+
*(a0b++)=d0l; // move.b d0,(a0)+
printstring(); // jsr printstring
return; // rts
}

printstring()
{
a0l=*(a7l++); // movea.l (a7)+,a0
// loop2: move.l (a0)+,(a1)
loop2: status=*a0l;fwrite(a0l++,4,1,stdout);
if(status)goto loop2; // bne loop2
return; // rts
}

24 Name: #!/usr/bin/anonymous : 2006-03-01 01:31 ID:Heaven

By the way, my friend who wrote the program in >>23 goes by the name "Cyan Helkaraxe." He is insisting that I mention his name here.

25 Name: #!/usr/bin/anonymous : 2006-03-01 16:11 ID:Heaven

As CISC architectures go, 68k is indeed one of the more pleasant ones to use.

26 Name: #!/usr/bin/anonymous : 2006-04-12 04:44 ID:ddVivMx/

Hah, assembly is so old school. Useful for quite a few things though. I saw 6502 mentioned earlier, I've been learning 65816 (SNES) assembly, I like it so far. Anyway, thanks for the links mentioned above.

27 Name: #!/usr/bin/anonymous : 2006-04-12 04:45 ID:ddVivMx/

Hah, assembly is so old school. Useful for quite a few things though. I saw 6502 mentioned earlier, I've been learning 65816 (SNES) assembly, I like it so far. Anyway, thanks for the links mentioned above.

28 Name: #!/usr/bin/anonymous : 2006-04-12 04:58 ID:ddVivMx/

Hah, assembly is so old school. Useful for quite a few things though. I saw 6502 mentioned earlier, I've been learning 65816 (SNES) assembly, I like it so far. Anyway, thanks for the links mentioned above.

29 Name: #!/usr/bin/anonymous : 2006-04-12 13:00 ID:Heaven

C-C-COMBO BREAKER

30 Name: #!/usr/bin/anonymous : 2006-04-13 11:09 ID:Heaven

>>29
lol'd

31 Name: #!/usr/bin/anonymous : 2006-04-20 13:45 ID:obS4WB/7

www.flatassembler.net

32 Name: #!/usr/bin/anonymous : 2006-04-22 10:24 ID:Heaven

>>24
What your friend needs is a good kick in the ass.

33 Name: #!/usr/bin/anonymous : 2006-05-25 14:20 ID:zDavRJ1v

The 65c02 and 6502-based CPU's were used in most of the popular consoles until the 68k made the leap from arcade games into the home


The 65816 was also used on the Apple IIGS


68k was also used in the Genesis, Neo Geo, and as a sound processor in the Saturn


Then there's the Z80, which is a bigger pain in the ass than the 68k :)

34 Name: #!/usr/bin/anonymous : 2006-05-29 00:11 ID:Heaven

So true about the Z80.

35 Name: #!/usr/bin/anonymous : 2006-07-21 13:29 ID:Heaven

Then again, anything is a bigger pain in the ass than 68k. Well, apart from the address/data register split anyway, and the bizarre pairing rules for optimizing for a 68060, but anyway. Would likely be really good for learning, even though the architecture has been mostly only relevant for embedded targets (i.e. ColdFire and the like, and those are subsets of the 68k ISA anyway).

36 Name: #!/usr/bin/anonymous : 2006-08-31 03:10 ID:6hBqHoI5

Z80 is cake. I can write z80 code with one hemisphere tied behind my back. Ditto m68k.

65816 is insane to debug because the length of certain instructions actually changes depending on the state of the CPU when they are executed. Gah. Still, it's not bad, for being such a blatant bag on the side of 6502.

x86 gives me an acute case of brain hives.

37 Name: #!/usr/bin/anonymous : 2006-09-24 00:53 ID:CyByDT19

>>16
Damn, if programmers had horrible in-jokes, this would be one of them. Bloody hell, I mean. Just coming up with a code generator that works at all for IA64 is an EPIC task (pun intended, har dee har) and that's in a compiler environment. I can't imagine writing any but the most horribly inefficient code for IA64 by hand, and even then... I get nightmares just reading the shit, and I'm only talking about things that some (presumably) human wrote to do something like syscalls or interrupt handlers so it's not laden with fecking predicate registers and VLIW-enforced stop bits and goddamn nonobvious control flow!

For those who don't know what I'm talking about, I'll elucidate one fraction of the true horror. Think of predicate registers like the condition code register of the ARM. You know, using it to omit jumps here and there. Now think about juggling a whole bunch of them, far more than the condition register slices you get on a PowerPC, and consider that any instruction can be predicated by any of them. Now, consider this alongside things like pseudo-VLIW instruction slots and stop bits. Yeaaaaaah, ride the snake.

>>36
I found, way back when, that after some years of 6502 hand-coding, m68k suddenly felt like a processor for the kids in the neighbourhood who were a few years older and always had their toys which were somehow neater and more serious than those of us little kids. Just an anecdote, but... not like the OP is going to be writing any serious assembly, right? And an instruction set with a pretty nice set of rather orthogonal addressing modes (apart from the data/address register split) has to be nicer for learning than the "hi, I'm like a Z80 only I've got six accumulators!" pile of cr^W^W^Wproduct of hard economic realities most of us use today.

38 Name: #!/usr/bin/anonymous : 2006-09-26 20:31 ID:xOuq+IgF

There is a book called "The Art of Assembly Language" available online... never read it myself, but have it sitting in my bookmarks for quiet some time... -> http://webster.cs.ucr.edu/AoA/Windows/HTML/AoATOC.html

39 Name: BLAH : 2010-05-14 06:37 ID:wMmul3fE

You guys forget that there's also the 6809 vs the Z80 and the 68K vs the 65816. 6809 uses the same basic assembly used in the 68HC11 microcontrollers, and the 6809 was used in arcade games that were hard to program because of the raw power (Defender, Stargate, Robotron 2084, Etc) so mabe try that, then maybe move to 68000K as they are very alike. And to program the Z80,It's very unique as the register swapping between 8 and 16 bits is just wastefull sometimes (To me)....

Whatever floats your boat. Even if it may be a failboat....

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: