Pedantically, in English you can either load A with B or load A into B, so load works either way around.
Fantasy 6502 variant...
-
- Posts: 563
- Joined: Sat Dec 23, 2000 5:56 pm
- Contact:
- dominicbeesley
- Posts: 2210
- Joined: Tue Apr 30, 2013 12:16 pm
- Contact:
Re: Fantasy 6502 variant...
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.
- gordonDrogon
- Posts: 93
- Joined: Fri Nov 23, 2018 12:39 pm
- Location: Scottish Borders
- Contact:
Re: Fantasy 6502 variant...
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?"
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?"
Re: Fantasy 6502 variant...
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
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
Re: Fantasy 6502 variant...
Glad it's not just me! At least with Swap it doesn't matter the order.jgharston wrote: ↑Mon Apr 22, 2024 11:23 amEugh. 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.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.
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.
Re: Fantasy 6502 variant...
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
>_