PROG GRAM MING
CLASS
This commit is contained in:
parent
56b52fbb8b
commit
76c27be5b3
9 changed files with 116 additions and 10 deletions
14
js/Byte.js
14
js/Byte.js
|
@ -80,6 +80,20 @@ var Word = (function () {
|
||||||
this.value = typeof high == "number" ? [new Byte((high & ~0xFF) >> 8), new Byte(high & 0xFF)] : [high, low];
|
this.value = typeof high == "number" ? [new Byte((high & ~0xFF) >> 8), new Byte(high & 0xFF)] : [high, low];
|
||||||
};
|
};
|
||||||
Word.prototype.SetHigh = function (value) {
|
Word.prototype.SetHigh = function (value) {
|
||||||
|
this.value[0] = typeof value == "number" ? new Byte(value) : value;
|
||||||
|
};
|
||||||
|
Word.prototype.SetLow = function (value) {
|
||||||
|
this.value[1] = typeof value == "number" ? new Byte(value) : value;
|
||||||
|
};
|
||||||
|
Word.prototype.Add = function (value) {
|
||||||
|
value = typeof value == "number" ? new Word(value) : value;
|
||||||
|
var overflow = [this.value[0].Add(value.High()), this.value[1].Add(value.Low())];
|
||||||
|
};
|
||||||
|
Word.prototype.AddByte = function (value) {
|
||||||
|
value = typeof value == "number" ? new Byte(value) : value;
|
||||||
|
var over = this.value[1].Add(value);
|
||||||
|
over = this.value[0].Add(over);
|
||||||
|
return new Word(over.Get());
|
||||||
};
|
};
|
||||||
return Word;
|
return Word;
|
||||||
})();
|
})();
|
||||||
|
|
File diff suppressed because one or more lines are too long
27
js/Byte.ts
27
js/Byte.ts
|
@ -110,7 +110,32 @@ class Word {
|
||||||
this.value = typeof high == "number" ? [new Byte((high & ~0xFF) >> 8), new Byte(high & 0xFF)] : [high, low];
|
this.value = typeof high == "number" ? [new Byte((high & ~0xFF) >> 8), new Byte(high & 0xFF)] : [high, low];
|
||||||
}
|
}
|
||||||
|
|
||||||
public SetHigh(value: Byte) {
|
public SetHigh(value: number);
|
||||||
|
public SetHigh(value: Byte);
|
||||||
|
public SetHigh(value: any) {
|
||||||
|
this.value[0] = typeof value == "number" ? new Byte(value) : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SetLow(value: number);
|
||||||
|
public SetLow(value: Byte);
|
||||||
|
public SetLow(value: any) {
|
||||||
|
this.value[1] = typeof value == "number" ? new Byte(value) : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Add(value: number): Word;
|
||||||
|
public Add(value: Word): Word;
|
||||||
|
public Add(value: any): Word {
|
||||||
|
value = typeof value == "number" ? new Word(value) : value;
|
||||||
|
var overflow = [this.value[0].Add(value.High()), this.value[1].Add(value.Low())];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AddByte(value: number): Word;
|
||||||
|
public AddByte(value: Byte): Word;
|
||||||
|
public AddByte(value: any): Word {
|
||||||
|
value = typeof value == "number" ? new Byte(value) : value;
|
||||||
|
var over = this.value[1].Add(value);
|
||||||
|
over = this.value[0].Add(over);
|
||||||
|
return new Word(over.Get());
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -21,6 +21,10 @@ var Registers = (function () {
|
||||||
var tmp = "ABCDEFHLIR";
|
var tmp = "ABCDEFHLIR";
|
||||||
for (var i; i < tmp.length; i++)
|
for (var i; i < tmp.length; i++)
|
||||||
Registers.byteRegisters[tmp[i]] = new Byte(0);
|
Registers.byteRegisters[tmp[i]] = new Byte(0);
|
||||||
|
Registers.shadowRegisters["AF"] = new Word(0);
|
||||||
|
Registers.shadowRegisters["BC"] = new Word(0);
|
||||||
|
Registers.shadowRegisters["DE"] = new Word(0);
|
||||||
|
Registers.shadowRegisters["HL"] = new Word(0);
|
||||||
};
|
};
|
||||||
Registers.GenerateWord = function (high, low) {
|
Registers.GenerateWord = function (high, low) {
|
||||||
return new Word(Registers.byteRegisters[high], Registers.byteRegisters[low]);
|
return new Word(Registers.byteRegisters[high], Registers.byteRegisters[low]);
|
||||||
|
@ -32,7 +36,22 @@ var Registers = (function () {
|
||||||
Registers.GetFlag = function (flag) {
|
Registers.GetFlag = function (flag) {
|
||||||
return Registers.byteRegisters["F"].Test(flag);
|
return Registers.byteRegisters["F"].Test(flag);
|
||||||
};
|
};
|
||||||
Registers.ExchangeAccumlatorFlags = function () {
|
Registers.ExchangeAFShadow = function () {
|
||||||
|
var tmp = Registers.shadowRegisters["AF"];
|
||||||
|
Registers.shadowRegisters["AF"].Set(Registers.byteRegisters["A"], Registers.byteRegisters["F"]);
|
||||||
|
Registers.byteRegisters["A"] = tmp.High();
|
||||||
|
Registers.byteRegisters["F"] = tmp.Low();
|
||||||
|
};
|
||||||
|
Registers.ExchangeShadow = function () {
|
||||||
|
var regs = ["BC", "DE", "HL"];
|
||||||
|
for (var reg in regs) {
|
||||||
|
var tmp = Registers.shadowRegisters[regs[reg]];
|
||||||
|
Registers.shadowRegisters[regs[reg]].Set(Registers.byteRegisters[regs[reg][0]], Registers.byteRegisters[regs[reg][1]]);
|
||||||
|
Registers.byteRegisters[regs[reg][0]] = tmp.High();
|
||||||
|
Registers.byteRegisters[regs[reg][1]] = tmp.Low();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Registers.Exchange = function (a, b) {
|
||||||
};
|
};
|
||||||
Registers.byteRegisters = [];
|
Registers.byteRegisters = [];
|
||||||
Registers.shadowRegisters = [];
|
Registers.shadowRegisters = [];
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"Registers.js","sourceRoot":"","sources":["Registers.ts"],"names":["Flags","Registers","Registers.constructor","Registers.Init","Registers.GenerateWord","Registers.SetFlag","Registers.GetFlag","Registers.ExchangeAccumlatorFlags"],"mappings":"AAAA,gCAAgC;AAEhC,IAAK,KAAmE;AAAxE,WAAK,KAAK;IAAGA,mCAAKA;IAAEA,qCAAMA;IAAEA,qCAAMA;IAAEA,uCAAOA;IAAEA,iCAAIA;IAAEA,uCAAOA;IAAEA,iCAAIA;IAAEA,iCAAIA;AAACA,CAACA,EAAnE,KAAK,KAAL,KAAK,QAA8D;AAExE,IAAM,SAAS;IAAfC,SAAMA,SAASA;IAmCfC,CAACA;IA7BiBD,cAAIA,GAAlBA;QACIE,SAASA,CAACA,aAAaA,CAACA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AAuBA,GAArCA;IAEAM,CAACA;IAjCaN,uBAAaA,GAAWA,EAAEA,CAACA;IAC3BA,yBAAeA,GAAWA,EAAEA,CAACA;IAC7BA,wBAAcA,GAASA,IAAIA,IAAIA,CAACA,CAACA,CAACA,CAACA;IACnCA,sBAAYA,GAASA,IAAIA,IAAIA,CAACA,CAACA,CAACA,CAACA;IA+BnDA,gBAACA;AAADA,CAACA,AAnCD,IAmCC"}
|
{"version":3,"file":"Registers.js","sourceRoot":"","sources":["Registers.ts"],"names":["Flags","Registers","Registers.constructor","Registers.Init","Registers.GenerateWord","Registers.SetFlag","Registers.GetFlag","Registers.ExchangeAFShadow","Registers.ExchangeShadow","Registers.Exchange"],"mappings":"AAAA,gCAAgC;AAEhC,IAAK,KAAmE;AAAxE,WAAK,KAAK;IAAGA,mCAAKA;IAAEA,qCAAMA;IAAEA,qCAAMA;IAAEA,uCAAOA;IAAEA,iCAAIA;IAAEA,uCAAOA;IAAEA,iCAAIA;IAAEA,iCAAIA;AAACA,CAACA,EAAnE,KAAK,KAAL,KAAK,QAA8D;AAExE,IAAM,SAAS;IAAfC,SAAMA,SAASA;IAuDfC,CAACA;IAjDiBD,cAAIA,GAAlBA;QACIE,SAASA,CAACA,aAAaA,CAACA,KAAKA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,CAACA,CAACA,CAACA;QAC7CA,SAASA,CAACA,aAAaA,CAACA,KAAKA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,CAACA,CAACA,CAACA;QAC7CA,SAASA,CAACA,aAAaA,CAACA,KAAKA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,CAACA,CAACA,CAACA;QAC7CA,SAASA,CAACA,aAAaA,CAACA,KAAKA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,CAACA,CAACA,CAACA;QAE7CA,IAAIA,GAAGA,GAAGA,YAAYA,CAACA;QACvBA,GAAGA,CAAAA,CAACA,GAAGA,CAACA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,CAACA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CA,SAASA,CAACA,eAAeA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,SAASA,CAACA,aAAaA,CAACA,GAAGA,CAACA,EAAEA,SAASA,CAACA,aAAaA,CAACA,GAAGA,CAACA,CAACA,CAACA;QAChGA,SAASA,CAACA,aAAaA,CAACA,GAAGA,CAACA,GAAGA,GAAGA,CAACA,IAAIA,EAAEA,CAACA;QAC1CA,SAASA,CAACA,aAAaA,CAACA,GAAGA,CAACA,GAAGA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;IAC7CA,CAACA;IAEaN,wBAAcA,GAA5BA;QACIO,IAAIA,IAAIA,GAAGA,CAACA,IAAIA,EAAEA,IAAIA,EAAEA,IAAIA,CAACA,CAACA;QAC9BA,GAAGA,CAAAA,CAACA,GAAGA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,CAACA,CAACA;YAClBA,IAAIA,GAAGA,GAAGA,SAASA,CAACA,eAAeA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA;YAC/CA,SAASA,CAACA,eAAeA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,GAAGA,CAACA,SAASA,CAACA,aAAaA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,EAAEA,SAASA,CAACA,aAAaA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;YACvHA,SAASA,CAACA,aAAaA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA,IAAIA,EAAEA,CAACA;YACnDA,SAASA,CAACA,aAAaA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;QACtDA,CAACA;IACLA,CAACA;IAEaP,kBAAQA,GAAtBA,UAAuBA,CAASA,EAAEA,CAASA;IAE3CQ,CAACA;IArDaR,uBAAaA,GAAWA,EAAEA,CAACA;IAC3BA,yBAAeA,GAAWA,EAAEA,CAACA;IAC7BA,wBAAcA,GAASA,IAAIA,IAAIA,CAACA,CAACA,CAACA,CAACA;IACnCA,sBAAYA,GAASA,IAAIA,IAAIA,CAACA,CAACA,CAACA,CAACA;IAmDnDA,gBAACA;AAADA,CAACA,AAvDD,IAuDC"}
|
|
@ -4,7 +4,7 @@ enum Flags { CARRY, ADDSUB, PARITY, UNUSED1, HALF, UNUSED2, ZERO, SIGN }
|
||||||
|
|
||||||
class Registers {
|
class Registers {
|
||||||
public static byteRegisters: Byte[] = [];
|
public static byteRegisters: Byte[] = [];
|
||||||
public static shadowRegisters: Byte[] = [];
|
public static shadowRegisters: Word[] = [];
|
||||||
public static programCounter: Word = new Word(0);
|
public static programCounter: Word = new Word(0);
|
||||||
public static stackPointer: Word = new Word(0);
|
public static stackPointer: Word = new Word(0);
|
||||||
|
|
||||||
|
@ -18,7 +18,10 @@ class Registers {
|
||||||
for(var i; i < tmp.length; i++)
|
for(var i; i < tmp.length; i++)
|
||||||
Registers.byteRegisters[tmp[i]] = new Byte(0);
|
Registers.byteRegisters[tmp[i]] = new Byte(0);
|
||||||
|
|
||||||
|
Registers.shadowRegisters["AF"] = new Word(0);
|
||||||
|
Registers.shadowRegisters["BC"] = new Word(0);
|
||||||
|
Registers.shadowRegisters["DE"] = new Word(0);
|
||||||
|
Registers.shadowRegisters["HL"] = new Word(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GenerateWord(high: string, low: string): Word {
|
public static GenerateWord(high: string, low: string): Word {
|
||||||
|
@ -34,7 +37,24 @@ class Registers {
|
||||||
return Registers.byteRegisters["F"].Test(flag);
|
return Registers.byteRegisters["F"].Test(flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ExchangeAccumlatorFlags() {
|
public static ExchangeAFShadow() {
|
||||||
|
var tmp = Registers.shadowRegisters["AF"];
|
||||||
|
Registers.shadowRegisters["AF"].Set(Registers.byteRegisters["A"], Registers.byteRegisters["F"]);
|
||||||
|
Registers.byteRegisters["A"] = tmp.High();
|
||||||
|
Registers.byteRegisters["F"] = tmp.Low();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ExchangeShadow() {
|
||||||
|
var regs = ["BC", "DE", "HL"];
|
||||||
|
for(var reg in regs) {
|
||||||
|
var tmp = Registers.shadowRegisters[regs[reg]];
|
||||||
|
Registers.shadowRegisters[regs[reg]].Set(Registers.byteRegisters[regs[reg][0]], Registers.byteRegisters[regs[reg][1]]);
|
||||||
|
Registers.byteRegisters[regs[reg][0]] = tmp.High();
|
||||||
|
Registers.byteRegisters[regs[reg][1]] = tmp.Low();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Exchange(a: string, b: string) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -44,6 +44,19 @@ TI.Opcodes[0x07] = function (args) {
|
||||||
return [1, 4];
|
return [1, 4];
|
||||||
};
|
};
|
||||||
TI.Opcodes[0x08] = function (args) {
|
TI.Opcodes[0x08] = function (args) {
|
||||||
return [];
|
Registers.ExchangeAFShadow();
|
||||||
|
return [1, 4];
|
||||||
|
};
|
||||||
|
TI.Opcodes[0x09] = function (args) {
|
||||||
|
// add hl, bc
|
||||||
|
return [1, 11];
|
||||||
|
};
|
||||||
|
TI.Opcodes[0x0A] = function (args) {
|
||||||
|
Registers.byteRegisters["A"] = Memory.Get(Registers.GenerateWord("B", "C"));
|
||||||
|
return [1, 7];
|
||||||
|
};
|
||||||
|
TI.Opcodes[0x0B] = function (args) {
|
||||||
|
// dec b
|
||||||
|
return [1, 4];
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=0x0.js.map
|
//# sourceMappingURL=0x0.js.map
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"0x0.js","sourceRoot":"","sources":["0x0.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kCAAkC;AAClC,qCAAqC;AACrC,wCAAwC;AACxC,iCAAiC;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CAAC;IAC7E,SAAS,CAAC,OAAO,CAAC,cAAY,EAAE,KAAK,CAAC,CAAC;IACvC,SAAS,CAAC,OAAO,CAAC,YAAU,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;AAEF,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IACpC,SAAS,CAAC,gBAAgB,EAAE,CAAC;IAC7B,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC;AAEF,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IAEpC,AADA,aAAa;IACb,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IACpC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAC,GAAG,CAAC,CAAC,CAAC;IAC3E,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;AAEF,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAS,IAAY;IAEpC,AADA,QAAQ;IACR,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC"}
|
|
@ -53,6 +53,21 @@ TI.Opcodes[0x07] = function(args: Byte[]): number[] {
|
||||||
};
|
};
|
||||||
|
|
||||||
TI.Opcodes[0x08] = function(args: Byte[]): number[] {
|
TI.Opcodes[0x08] = function(args: Byte[]): number[] {
|
||||||
|
Registers.ExchangeAFShadow();
|
||||||
return []
|
return [1,4];
|
||||||
|
};
|
||||||
|
|
||||||
|
TI.Opcodes[0x09] = function(args: Byte[]): number[] {
|
||||||
|
// add hl, bc
|
||||||
|
return [1, 11];
|
||||||
|
};
|
||||||
|
|
||||||
|
TI.Opcodes[0x0A] = function(args: Byte[]): number[] {
|
||||||
|
Registers.byteRegisters["A"] = Memory.Get(Registers.GenerateWord("B","C"));
|
||||||
|
return [1, 7];
|
||||||
|
};
|
||||||
|
|
||||||
|
TI.Opcodes[0x0B] = function(args: Byte[]): number[] {
|
||||||
|
// dec b
|
||||||
|
return [1, 4];
|
||||||
};
|
};
|
Loading…
Reference in a new issue