• Please review our updated Terms and Rules here

Assemblers, Origins, Offsets and Targets... Offset Assembly question.

Yep, I know what you mean: you have to tell the assembler when the 65816 switched to 16-bit and for which part of it. I managed but don't ask me how many times a program crashed because I forgot to place the correct directive in the code. This is also one of the reasons why I don't have a disassembler specific for the 65816 yet: my disassembler is what it says, a disassembler, not en emulator. So It won't have an idea what value is written to the status register. Another reason: to less 65816 binaries to make it worth the trouble and time.
 
Fortunately I had a "hints" feature using two spare flag bits for every address. That let me tweak up to two things at each address. On 8048 it gives hints for the absolute JMP/CALL instructions, which use a CPU register for one extra address bit. So I made one hint for 65816 bit be LONG-I and the other one be LONG-A.
 
Fortunately I had a "hints" feature using two spare flag bits for every address. That let me tweak up to two things at each address. On 8048 it gives hints for the absolute JMP/CALL instructions, which use a CPU register for one extra address bit. So I made one hint for 65816 bit be LONG-I and the other one be LONG-A.

8048 relative jumps are pretty painful to learn the first time.

When I first tried them back in the 80s I thought they were like z80 relative jumps and I never got any assembler errors when I went outside of the page.... But so many software crashes, and the assemblers I had at the time didn't allow any checking like making sure the code was within the current page. That became a manual task everytime I assembled it.
 
But they aren't relative jumps? They're "short" jumps. 8048 code is typically organized into pages as a result.

And I'm guessing you hadn't been exposed to the 1802, which also has same-page short jumps, and that was in 1976.
 
But they aren't relative jumps? They're "short" jumps. 8048 code is typically organized into pages as a result.

And I'm guessing you hadn't been exposed to the 1802, which also has same-page short jumps, and that was in 1976.

They are somewhat relative - ie, relative to the page, not the PC - And yes, very short. An 8 bit address and it fixes the same page address.

It's been a while, and while I did a LOT of programming on 8048 in the 80s, they were defunct in the 90s and so I switched to the MCS-51 - if which my only regret was the lack of a bus register capability in any of the models or derivatives.

And I had zero exposure to the MCS-48 - I found an assembler, some demo code, a glass-window CPU and then I worked my way across from the z80 around 1987, so I made assumptions about what the 8 bit address meant from that background. It doesn't translate well when the labels were all 16 bit, but the words in the MCS-48 are smaller, and the jumps are just concatenated 8 bit absolute jumps. I had zero formal training on any CPU - and manuals were difficult to get, and difficult to understand from a z80 programmer's perspective. So it was a case of learning what went wrong when the program reached 256 bytes in size.
 
I did write a cross-assembler for the 8x48 many years ago. That got used for a number of projects, as the company used the 8748 for a lot of dedicated jobs.

You just had to keep your eye on what was happening at the page boundaries...

It was subsequently replaced with a commercial meta cross-assembler (that could handle multiple processors) as my original was written in Z80 assembler for a specific hardware platform, and the industry then moved over to the PC as these small, niche companies went bust.

I couldn't be bothered to re-platform my assembler... No money in it!

Dave
 
Back
Top