Best/Worst Assembly Language Instruction Set

Discussion in 'Game Development General Discussion' started by Piglet, Nov 5, 2008.

  1. Piglet

    Piglet Spirited Member

    Joined:
    May 28, 2008
    Messages:
    175
    Likes Received:
    0
    PHX/PLX
    PHY/PLY
    BBRx/BBSx ZP (test bit and branch if)
    SMBx/RMBx ZP (reset/set specific bits in a ZP register)
    STZ <operand>
    JMP [$abcd, X]
    CLA/CLX/CLY (for tight code)

    The BBR & SMB were not 6502 instructions. You just had BIT. Don't remember STZ, CLA,CLX or CLY either. Yes, the PHX/PLX and so on were useful but the JMP [XXXX.x) was zero-page only (unless that was C64 only).
     
  2. tomaitheous

    tomaitheous Spirited Member

    Joined:
    Jun 29, 2007
    Messages:
    100
    Likes Received:
    0
    STZ - implemented in the 65C02. Z is the zero register and contains fixed value of 0 ;)
    JMP ($nnnn,X) (opcode $7C) - implemented on 65C02. Finally, a function table instruction.

    The CMOS version added some more addressing mode opcode like ($zp) without indexing. The BIT instruction received 3 more addressing modes, with BIT #imm probably being the more important.

    BBR/BBS, SMB/RMB, TRB/TSB, and BSR (branch subroutine) were implemented in the 65SC02 (sometimes labeled 65C02S). The SC02/C02S came out after the C02 - sometime around '85.

    And I totally forgot that 6502 is missing DEC A and INC A.

    Sorry about CLA,CLX and CLY. Those are PC-Engine opcodes. PCE has a bunch of added opcodes on top of the 65CS02 model. Sometimes I confuse them as being part of the original C02 set.
     
  3. Piglet

    Piglet Spirited Member

    Joined:
    May 28, 2008
    Messages:
    175
    Likes Received:
    0
    Thats odd, I did the 'mode 7' floor for BC racers on the 32X and unrolling the loop made it faster, if you write to memory it goes through the cache anyway, doesn't it, so only in the event of a cache write will it slow down...
     
  4. manopac

    manopac Spirited Member

    Joined:
    May 20, 2004
    Messages:
    199
    Likes Received:
    1
    better late then never ...

    8048 (Magnavox Odyssey 2 ... 3K without bankswitching, no subtract commands, no bit-set/clear commands ...)
    68000 (Commodore Amiga)
    80x86 (some)
     
  5. Jamtex

    Jamtex Adult Orientated Mahjong Connoisseur

    Joined:
    Feb 21, 2007
    Messages:
    5,472
    Likes Received:
    16
    Best - Z80, mainly as it's the only CPU I got to grips with/

    Worst - 8086, mainly as it stole all the god ideas from the Z80 added a horrible segmented memory map and IBM were stupid enough to use the 8088 in the IBM PC, they should have used the Z8000 then the world would have been a better place.
     
  6. AntiPasta

    AntiPasta Fiery Member

    Joined:
    Dec 30, 2006
    Messages:
    809
    Likes Received:
    4
    Wow, my kinda thread! Makes me itching to do some more hardcore asm, it's been a few years :)

    Well...

    my first: X86 (later realized how ugly it is)
    most baroque: SH2
    most powerful: ARM7
    cute and somewhat clumsy: Z80
    favourite: 32-bit MIPS, like the PSX' R3000A

    Something I'd love to try once is Itanium VLIW :nod:
     
  7. Piglet

    Piglet Spirited Member

    Joined:
    May 28, 2008
    Messages:
    175
    Likes Received:
    0
    Anyone else find the 80286 bug (or others)? 80286 can read 16 bits from anywhere inside a 64K bank but if you read a word from the last byte, rather than wrapping around, it DIES!

    I began with 6502 and came rather late to Z80 but it is a good (for 8 bit) instruction-set.

    Anyone attempting to learn assembler language could do a lot worse than the ARM series. Now that is pretty and fun...
     
  8. jollyroger

    jollyroger Gutsy Member

    Joined:
    Oct 18, 2008
    Messages:
    458
    Likes Received:
    256
    Oof ok, I have worked and played with a few...

    MC 6502
    MC 680x0
    Intel x86 - Core Quad, with all SIMD extensions (one of the worst, latest SSE4.1 are good though)
    Intel i960
    MIPS R2000 - R12000
    ARM 7/9 (the nicest imho)
    Z80
    PowerPC / Cell PPU
    Cell SPU
    PS2 Vector Unit
    DEC Alpha
    SUN Sparc 2/3/4
    Microchip PIC (8bit)
    ATMEL Mega8 - Mega16
    NEC V60 - V70
    Hitachi SH1 - SH4

    Perhaps I forgot some, I have seen too many... oh well...

    Jollyroger
     
  9. Piglet

    Piglet Spirited Member

    Joined:
    May 28, 2008
    Messages:
    175
    Likes Received:
    0
    How RISCy is RISC?

    Are there many differences between ARM 7 & ARM 9? I wonder, did anyone like the ARM thumb-mode? I seem to remember that the guys from Shin'en wrote their GBA sound-drive almost all in thumb (only a few interupt drivers used wholesome, fulsome, full ARM).

    Another related question: What is the minimum number of uniques instructions that a CPU has to have? I seem to remember a Post Graduatre student in the US designed an 8-bit RISC chip with, I think, 71 instructions.
     
  10. AntiPasta

    AntiPasta Fiery Member

    Joined:
    Dec 30, 2006
    Messages:
    809
    Likes Received:
    4
    There's the eponymous 3-instruction RISC chip, but I think that one cheated somehow. Hey, technically all you need is OR ;-)

    Oh and jollyroger: i960? Why on earth?
     
  11. smf

    smf mamedev

    Joined:
    Apr 14, 2005
    Messages:
    1,255
    Likes Received:
    88
    sega model 2?

    and from my computer studies class it would be nand that you need. all logic can be built from nand.
     
  12. jollyroger

    jollyroger Gutsy Member

    Joined:
    Oct 18, 2008
    Messages:
    458
    Likes Received:
    256
    Well the 860/960 were used in several types of hardware, from SCSI RAID controllers to large electronic boards as an accelerator processor (SGI Reality Engine, etc...)

    In the right amounts it was pretty fast, on the Reality Engine 2 there were twelve 860 which managed all the OpenGL transform and ligthing operations (and some more), this was waaay before commercial GPUs existed...

    Jollyroger
     
  13. AntiPasta

    AntiPasta Fiery Member

    Joined:
    Dec 30, 2006
    Messages:
    809
    Likes Received:
    4
    I know, but I'm curious what you used it for... there's not that many M2 developers you know ;-)
     
  14. jollyroger

    jollyroger Gutsy Member

    Joined:
    Oct 18, 2008
    Messages:
    458
    Likes Received:
    256
    Ahahah, fair enough, sorry no M2 for me... other graphics-related hardware but no M2 I am afraid... ;-)

    Jollyroger
     
  15. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    For a single instruction computer (OISC), the instruction is: subtract memory from memory, if zero, branch to address ;)
     
  16. darkangel

    darkangel Guest

    I don't know why, but the 65816 always had an unually high amount of people who suck at programming it. Not in regards to if their code works or not, but in regards to their codes being inefficient compared to the way the 65816 was designed to be.

    I find it really easy to write fast code for the 65816. All you have to do is learn to take advantage of 8-bit instructions, and only use 16-bit instructions when they allow operations to be done in less instructions; taking advantage the direct page; avoiding tight loops; and by doing things almost the complete opposite way on the 68000.
     
    Last edited by a moderator: Jan 26, 2009
  17. jonwil

    jonwil Robust Member

    Joined:
    Dec 16, 2005
    Messages:
    256
    Likes Received:
    21
    If only IBM had gone with a CPU with a flat address space (such as the 68000), the PC architecture likely wouldn't suck so much.
     
  18. tomaitheous

    tomaitheous Spirited Member

    Joined:
    Jun 29, 2007
    Messages:
    100
    Likes Received:
    0
    386 introduced the linear address range, so it's not so bad :)
     
  19. MottZilla

    MottZilla Champion of the Forum

    Joined:
    Feb 1, 2006
    Messages:
    5,066
    Likes Received:
    102
    Is 68000 ASM really that nice? I've seen 6502 (nes), 65816 (snes), and gameboy's custom z80 mainly. I've seen alot of people commenting that the 68000 is alot nicer than the ones I've mentioned I've seen or used. Anyone have any tutorials or documents that they think really do a good job explaining the 68000?
     
  20. TmEE

    TmEE Peppy Member

    Joined:
    Aug 13, 2008
    Messages:
    362
    Likes Received:
    1
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page