Sunday, June 25, 2006

Memory

I've now implemented and tested the 4 memory-access instructions:
  • lba - Load a byte from an immediate 8-bit address

  • sba - Store a byte to an immediate 8-bit address

  • lbr - Load a byte from an address that's the sum of the contents of a register and a 5-bit offset

  • sbr - Store a byte to an address that's the sum of the contents of a register and a 5-bit offset

The offset is currently unsigned, but I can see that it might be more useful as a signed value. I could easily sign-extend it in the memory address unit, but I haven't yet decided whether I should. There remains the question of whether it will ever get used at all, of course. Will programs that fit in 256 instructions actually feel the need for stack-pointer-relative local variables? We shall see.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home