12-30-2013, 11:59 PM
(This post was last modified: 12-31-2013, 12:17 AM by Cutlassw30.)
The standard IS is a stupid idea. It kills change (cough x86).... What we need is a standard assembly level language in which we can transfer down to other ISs to exploit what they offer in terms of functpnallity and speed. A few set ideas would be needed such as interrupts and segmentation registers for virtual memory management to allow for a full system architecture however we should still be able to change the IS at anytime and just recompile the language to suit the new IS.
If we do make sort of a standard to follow I would recommend a few basic functions.
Arithmetic operations:
Their should be 4 types of arithmetic operations.
Unsigned For mult/div
Signed For mult/div
Immediate value argument
Then for branches.
I really hate the way x86 dose branching, the whole idea of using a CMP instruction before jump if equal to is really annoying and very slow IMO.
Op code 5 bits
Register arguments 4 bits
0-5 6-9 10-13 14-15
[op-5][RAA-4][RAB-4][nul-2] instruction uses no immediate
0-5 6-9 10-15
[op-5][RAA-4][IMM-6] instruction uses immediate (mem offset)
0-5 6-15
[op-5][IMM-10] instruction uses long immediate (jumps)
I think with branching however the CMP instruction is the only way around this so i digress on this point. (after all I want 1 cycle 16 bit loads from serial memory).
Registers.
AR: accumulator, used in almost all instructions. arithmetic, logical, function calls, etc
BR: base, only register that can be used as a memory offset MEM[BR+IMM]
CR: Used like the variable "i" in programming, used in loop instruction.
DR: Almost like a second accumulator, stores overflows from arithmetic operations, used as second arguments in function calls.
ER Used only for context switching (if we implement modes such as protected and real mode this register is not usable in protected mode).
FR: Holds flags of all operations preformed.
SI: Source of all memory operations
DI: Drain of all memory operations
R9-16: Gen purpose.
I will write more shit later.
If we do make sort of a standard to follow I would recommend a few basic functions.
Arithmetic operations:
Their should be 4 types of arithmetic operations.
Unsigned For mult/div
Signed For mult/div
Immediate value argument
Then for branches.
I really hate the way x86 dose branching, the whole idea of using a CMP instruction before jump if equal to is really annoying and very slow IMO.
Op code 5 bits
Register arguments 4 bits
0-5 6-9 10-13 14-15
[op-5][RAA-4][RAB-4][nul-2] instruction uses no immediate
0-5 6-9 10-15
[op-5][RAA-4][IMM-6] instruction uses immediate (mem offset)
0-5 6-15
[op-5][IMM-10] instruction uses long immediate (jumps)
I think with branching however the CMP instruction is the only way around this so i digress on this point. (after all I want 1 cycle 16 bit loads from serial memory).
Registers.
AR: accumulator, used in almost all instructions. arithmetic, logical, function calls, etc
BR: base, only register that can be used as a memory offset MEM[BR+IMM]
CR: Used like the variable "i" in programming, used in loop instruction.
DR: Almost like a second accumulator, stores overflows from arithmetic operations, used as second arguments in function calls.
ER Used only for context switching (if we implement modes such as protected and real mode this register is not usable in protected mode).
FR: Holds flags of all operations preformed.
SI: Source of all memory operations
DI: Drain of all memory operations
R9-16: Gen purpose.
I will write more shit later.