[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.1693928 [View]
File: 72 KB, 1200x369, bfebb9c09fd8012f2fe600163e41dd5b.gif [View same] [iqdb] [saucenao] [google]
1693928

DIY CPU anon here again:
I just realized that I didn't leave any way to access the stack pointer in my instruction format.
I could just make an instruction specifically for loading and storing the stack pointer, but I'm out of opcodes and I wanted everything to be highly orthogonal anyways.
Would it be retarded to just access the SP register via IN/OUT instructions?
I was planning on putting configuration registers on the IO port bus anyways, to allow for easy peripheral and co-processor integration.

Also, I had another thought on my 8k jump limitation:
What if I used the 12-bit target as the 12 most significant bits and then filled the lower 4 bits with 0.
I was already planing on the targets being forced to be word aligned, making the target address effectively 13 bits.
That would mean that I could jump to 8k subroutines, spaced every 8 bytes.
Since my instructions are all 2 bytes, and the shortest possible function is 2 instructions long (an instruction and then return), that means it would only cause about 4 bytes of wasted space, more or less.
It would take a bit more work on the assembler's part to align all the subroutines, but it doesn't seem like it would be that bad

Navigation
View posts[+24][+48][+96]