mirror of
https://github.com/Russell-S-Harper/COMMON.git
synced 2024-09-29 18:56:22 +00:00
Adding I9 for context switching.
This commit is contained in:
parent
6ffe70daec
commit
9045e06439
@ -47,7 +47,7 @@
|
|||||||
; CMR pq 0f pq F <- Rp <=> Rq - compare registers
|
; CMR pq 0f pq F <- Rp <=> Rq - compare registers
|
||||||
|
|
||||||
; 40 bytes in page zero for common registers
|
; 40 bytes in page zero for common registers
|
||||||
_R0 = $100 - 4 * (10 + 9)
|
_R0 = $100 - 4 * (10 + 10)
|
||||||
_R1 = _R0 + 4
|
_R1 = _R0 + 4
|
||||||
_R2 = _R1 + 4
|
_R2 = _R1 + 4
|
||||||
_R3 = _R2 + 4
|
_R3 = _R2 + 4
|
||||||
@ -58,7 +58,7 @@ _R7 = _R6 + 4
|
|||||||
_R8 = _R7 + 4
|
_R8 = _R7 + 4
|
||||||
_R9 = _R8 + 4
|
_R9 = _R8 + 4
|
||||||
|
|
||||||
; 36 bytes in page zero for internal registers
|
; 40 bytes in page zero for internal registers
|
||||||
_I0 = _R9 + 4 ; workspace
|
_I0 = _R9 + 4 ; workspace
|
||||||
_I1 = _I0 + 4
|
_I1 = _I0 + 4
|
||||||
_I2 = _I1 + 4
|
_I2 = _I1 + 4
|
||||||
@ -66,8 +66,9 @@ _I3 = _I2 + 4
|
|||||||
_I4 = _I3 + 4
|
_I4 = _I3 + 4
|
||||||
_I5 = _I4 + 4
|
_I5 = _I4 + 4
|
||||||
_I6 = _I5 + 4 ; register I6 maintains common status
|
_I6 = _I5 + 4 ; register I6 maintains common status
|
||||||
_I7 = _I6 + 4 ; register I7 maintains process information for context switching
|
_I7 = _I6 + 4 ; register I7 maintains locations of process and allocated memory
|
||||||
_I8 = _I7 + 4 ; register I8 saves/restores processor status
|
_I8 = _I7 + 4 ; register I8 maintains process information for context switching
|
||||||
|
_I9 = _I8 + 4 ; register I9 saves/restores processor status
|
||||||
|
|
||||||
; register I6 maintains common status
|
; register I6 maintains common status
|
||||||
; (dd cc bb aa) aa: index for register stack RS / ccbb: program counter PC / dd: flags F UONPZLGE
|
; (dd cc bb aa) aa: index for register stack RS / ccbb: program counter PC / dd: flags F UONPZLGE
|
||||||
@ -87,15 +88,17 @@ _F_N = 32 ; if Rr < 0.0 (after TST)
|
|||||||
_F_O = 64 ; if overflow (after arithmetic operations)
|
_F_O = 64 ; if overflow (after arithmetic operations)
|
||||||
_F_U = 128 ; if underflow (after arithmetic operations)
|
_F_U = 128 ; if underflow (after arithmetic operations)
|
||||||
|
|
||||||
; register I7 maintains process information for context switching
|
; register I7 maintains locations of process and allocated memory
|
||||||
_PST = _I7 ; current process status
|
|
||||||
|
; register I8 maintains process information for context switching
|
||||||
|
_PST = _I8 ; current process status
|
||||||
_PSI = _PST + 1 ; process stack index to save/restore
|
_PSI = _PST + 1 ; process stack index to save/restore
|
||||||
_PD0 = _PSI + 1 ; two bytes for process
|
_PD0 = _PSI + 1 ; pending
|
||||||
_PD1 = _PD0 + 1
|
_PD1 = _PD0 + 1
|
||||||
|
|
||||||
; register I8 saves/restores processor status
|
; register I9 saves/restores processor status
|
||||||
; (dd cc bb aa) aa: accumulator, bb: index X, cc: index Y, dd: processor status
|
; (dd cc bb aa) aa: accumulator, bb: index X, cc: index Y, dd: processor status
|
||||||
_ACC = _I8 ; saved accumulator to restore
|
_ACC = _I9 ; saved accumulator to restore
|
||||||
_IDX = _ACC + 1 ; saved index X to restore
|
_IDX = _ACC + 1 ; saved index X to restore
|
||||||
_IDY = _IDX + 1 ; saved index Y to restore
|
_IDY = _IDX + 1 ; saved index Y to restore
|
||||||
_PS = _IDY + 1 ; saved processor status to restore
|
_PS = _IDY + 1 ; saved processor status to restore
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
|
|
||||||
/* Register I6 maintains common status */
|
/* Register I6 maintains common status */
|
||||||
#define _R0 0xb4
|
#define _R0 0xb0
|
||||||
#define _R8 0xd4
|
#define _R8 0xd0
|
||||||
#define _I0 0xdc
|
#define _I0 0xd8
|
||||||
#define _I6 0xf4
|
#define _I6 0xf0
|
||||||
#define _I8 0xfc
|
#define _I8 0xf8
|
||||||
|
|
||||||
/* (dd cc bb aa) aa: index for register stack RS / ccbb: program counter PC / dd: flags F UONPZLGE */
|
/* (dd cc bb aa) aa: index for register stack RS / ccbb: program counter PC / dd: flags F UONPZLGE */
|
||||||
#define _RSI _I6 /* register stack index */
|
#define _RSI _I6 /* register stack index */
|
||||||
|
Loading…
Reference in New Issue
Block a user