Fantasy 6502 variant...

discuss both original and modern hardware for the bbc micro/electron
ThomasHarte
Posts: 563
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: Fantasy 6502 variant...

Post by ThomasHarte »

jgharston wrote: Mon Apr 22, 2024 11:23 am Eugh. I don't like the MOV dest,src syntax, it breaks English. You should either use *move* source /to/ dest, or *load* dest /with/ source.
Pedantically, in English you can either load A with B or load A into B, so load works either way around.
User avatar
dominicbeesley
Posts: 2210
Joined: Tue Apr 30, 2013 12:16 pm
Contact:

Re: Fantasy 6502 variant...

Post by dominicbeesley »

And it could be "move from" rather than "move to". Same with transfer. TXA could be transfer X to A or transfer X from A.
User avatar
gordonDrogon
Posts: 93
Joined: Fri Nov 23, 2018 12:39 pm
Location: Scottish Borders
Contact:

Re: Fantasy 6502 variant...

Post by gordonDrogon »

In another reality[1], I used to wonder about the use of transfer or move ... Shouldn't it be copy ?

We can transfer a stack of cards from input hopper to output hopper, transfer a tape from the input spool to the output spool, a footballer from one team to another, but transfer memory or a register? What gets left behind ...

Maybe it made more sense in the days of core - save a memory cycle by transferring (or moving) the value (from core) without the copy back to preserve it? (Did anything have that?)

Maybe I'm just over-thinking it...

-Gordon
[1] In the same reality I might ask; "if a stealth bomber crashes in a forest with no-one around does it make a noise?"
User avatar
SKS1
Posts: 327
Joined: Sat Sep 19, 2020 12:04 am
Location: Highland Perthshire
Contact:

Re: Fantasy 6502 variant...

Post by SKS1 »

At least keeping the destination at one end or the other needs to be consistent

ADD r0,r1,r2 is more like the sensible r0 := r1 + r2 rather than COBOL's ADD r1 TO r2 GIVING r0

and then

MOV r0,r1 follows
Miserable old curmudgeon who still likes a bit of an ARM wrestle now and then. Pi 4, 3, ARMX6, SA Risc PC, A540, A440
Arx
Posts: 33
Joined: Sat Aug 20, 2022 10:12 pm
Contact:

Re: Fantasy 6502 variant...

Post by Arx »

jgharston wrote: Mon Apr 22, 2024 11:23 am
Arx wrote: Sun Apr 21, 2024 8:49 pm Yeah, on the 6502's RISCy-ness... I imagine its mnemonics were chosen with an every-byte-counts mindset, regarding source code. Loosening that restriction a bit and applying a more ARM-like syntax does reveal its RISC-like nature. TAX becomes MOV X,A (I think). LDA #15 becomes LDR A,#15 etc.
Eugh. I don't like the MOV dest,src syntax, it breaks English. You should either use *move* source /to/ dest, or *load* dest /with/ source. When looking at 80x86 code I always have to rotate my brain through 90 degrees to understand what's going on.

So:
TXA -> LD A,X or MOV X,A
LDA #n -> LD A,n or MOV #n,A or LDR A,#n
LDX abs -> LD X,(abs) or MOV abs,X or LDR X,abs
etc.
Glad it's not just me! At least with Swap it doesn't matter the order. :)
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Fantasy 6502 variant...

Post by jgharston »

SKS1 wrote: Mon Apr 22, 2024 2:01 pm At least keeping the destination at one end or the other needs to be consistent

ADD r0,r1,r2 is more like the sensible r0 := r1 + r2 rather than COBOL's ADD r1 TO r2 GIVING r0
and then
MOV r0,r1 follows
That's something I particularly like about the ARM32 syntax. *Everything* is (operation) (destination)(otherstuff), with the only exceptions where it absolutely has to deviate, STR (source)(dest). All credit to Sophie* for a very clean specification.

*My notes tell me Sophie designed the instruction set and binary architecture, and Steve designed the implementation in hardware, though with a lot of overlap.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
Post Reply

Return to “8-bit acorn hardware”