Jump to content
IGNORED

Assmebly language for the Atari v's the x86


Recommended Posts

When I started programming the Amiga in C, I had 512K and one floppy.
The next night I had two floppies. :D
I'd kick off a compile before going to bed, and if I woke up in the night I'd listen for disk access.
If I didn't hear the drive grinding away, I'd get up and look to see if it needed a disk or if there was an error.

After a week or two of that I started running out of RAM.
I think we upgraded my A1000 to 1.5MB of RAM and I had a batch file to copy include files to the RAM disk.
No more RAM issues and I didn't have to swap in the 3rd disk. I could just go to bed and sleep.

I worked on an embeded system around 1989. They gave me a 4.77MHz 8088 system. And they had me doing integration builds.
I think the first integration build was 60 minutes!
I ran across the manual to the motherboard in the computer and found it had a turbo mode (12MHz?). I opened it up, soldered across the jumper and builds dropped to just over 20 minutes. But I couldn't even edit while I waited like on the Amiga.

Link to comment
Share on other sites

....

...One thing that really hit me was how superior the segment:offset addressing mechanism of the PC was in comparison to the cramped indirect page zero addressing on the Atari! This feature alone must have been very persuasive to the first pioneers who jumped ship from Atari to PC in the middle eighties! It also made me smile no end while reading a book on x86 assembly to hear the author complain about DOS real-mode! 'Just try the A8' I thought!

....

Oh no, not that crap. Intel decision to allow segment:offset to overlap at paragraph (16bytes) level because they couldn't come up with anything better than adding two 16 bits quantities offset by 4 bits (how about the segment instead is just 4 bits) MUST BE one of the ugliest hack I've ever seen, they had a 16bit processor and wanted to address more than 64K of memory .... and didn't like classic pagination so a simple ADDER makes the pain go away ... NOT. Add to that that the segment does not autoincrement when the offset rolls over and you have a lot of weird code at the boundaries.

 

Now segmented memory in protected mode (32bits) is a different thing.... to be fair though in 64bits they dropped most of that crap and went linear, or he OS did (flat segments all overlapping, all on the same 64bit addressing space, yeahhhh).

 

The Atari page zero is not really Atari mess but a "smart" 6502 way to immediately gain 256 registers (more or less given the RAM of the time was faster than the CPU or almost) and the cheapest way to do 16bit indirect jumping [by using the extended registers aka page 0].... now fixed 256 bytes size stack in page 1 .... that was stupidshortsighted but hey that was fixed in the 65816, very few ever knew.

 

No one that I know of has any fond memory of segmented 16bits x86 real mode programming (yet that's how the BIOS runs sigh to this day) ... I remember needing to choose in C if your memory-model is tiny/small/medium/large/huge ... whatever .... even them the compiler gods didn't really know how to deal with it so they passed the buck onto the programmer for the most part.

 

Don't even get me started once they had more than 1MB .... HMA junk, EMM this, XMM that .... stinking pile of crap.

They even let a weird fluke in the 386: "Unreal mode"

https://en.wikipedia.org/wiki/Unreal_mode

 

I mean Linux kernel (or any modern kernel) has now the 2MB no fly zone to work around all the crap that the first 2MB of memory can entail, it's a minefield.

 

Page zero only had issue if the manufacturer decided to stick into it way too many HW register (C64 I am looking at you) so you ended up with very few available locations to you could use.

  • Like 2
Link to comment
Share on other sites

The Atari page zero is not really Atari mess but a "smart" 6502 way to immediately gain 256 registers (more or less given the RAM of the time was faster than the CPU or almost) and the cheapest way to do 16bit indirect jumping [by using the extended registers aka page 0].... now fixed 256 bytes size stack in page 1 .... that was stupidshortsighted but hey that was fixed in the 65816, very few ever knew.

 

Some guys like to call page 0 registers. Here is why they shouldn't be called registers..

None of the instruction set treats them like a register. They all treat them like RAM.

 

There is no:

LD $00,#$14

 

You have to:

LDA #$14

STA $00

 

The idea came from the 6800 but it doesn't have the addressing from page 0, I'm not sue where it got the idea. I doubt it was the first to use that.

 

The 6502 has no 16 bit index registers. Sure it could put address inline, but it needs some in RAM if you are writing ROM code.

If they don't put them on page 0, it takes 2 bytes for the address of the pointer and two bytes for the pointer.

By using page zero, it takes 1 byte for the address of the pointer, and two bytes for the pointer.

It's just about size and speed of the code.

 

Link to comment
Share on other sites

 

 

Page zero only had issue if the manufacturer decided to stick into it way too many HW register (C64 I am looking at you) so you ended up with very few available locations to you could use.

 

What? all 2 of them (0 and 1)? :)

 

Everything else is just used by the kernel and the first thing anyone does is shuts that off anyway, leaving you with almost everything.

  • Like 2
Link to comment
Share on other sites

 

What? all 2 of them (0 and 1)? :)

 

Everything else is just used by the kernel and the first thing anyone does is shuts that off anyway, leaving you with almost everything.

You got me, many decades ago when I tried I didn't disable anything and it was only 4 safe locations (or something like that).

 

https://www.c64-wiki.com/wiki/Zeropage

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...