4004 emulator

Back to General discussions forum

Quandray     2015-11-06 16:53:01
User avatar

How large can my code be? The code pointer (or instruction pointer) has 12 bits so it can address 4096 bytes but the console output subroutine is at $3E0.

Rodion (admin)     2015-11-06 18:02:56
User avatar

Hm-m-m. That's confusing. It looks that when I was writing the code, I mistakenly used values like 3xx instead of Fxxfor "top" addresses. I believe it was because I read that real systems like Busycom 141-PF calculator were using 4 ROM pages...

Our emulator itself have no strict limit (its IP is not limited by 12 bits). Moreover there is no problem with addresses 3F0, 3E0 and 3FF as they do not contain real code and only are triggered (as a kind of magic) when JMS instruction is used with them. So real code can overlap them almost with no problems.

We just needed some "magic" to provide functions for "virtual console" - another (more proper) idea was working via IO ports but they require at least two operations to address, as I remember...

As I understand real 400X-chips based system have a number of limitations (about jumping between ROM pages etc.) which should be considered when coding.

GlideThestral     2015-11-06 18:21:49

As I understand, limit of program in 4004 is 4KB (12 bit), but conditional jumps can go only to the same 256-byte page. JMS and JUN can jump across pages.

To use more than one page emulator should give opportunity to insert "page break" - to start another part of code in new page.

Quandray     2015-11-07 15:32:35
User avatar

Sorry, ignore this, I see that Micro-Life is limited to 256 bytes

Please login and solve 5 problems to be able to post at forum