Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ec3af96
Merge pull request #165 from dcamarmas/master
dcamarmas Jul 16, 2021
c6d6d26
Merge pull request #167 from acaldero/master
dcamarmas Jul 16, 2021
e014a4f
3.0: creator memory UI updated
dcamarmas Jul 16, 2021
f91f29b
Merge pull request #115 from dcamarmas/3.0
acaldero Jul 16, 2021
658d57e
3.0: minor improvements on creator_memory
acaldero Jul 16, 2021
c466cce
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
809182c
3.0: minor updates on memory
acaldero Jul 17, 2021
704a986
3.0: minor updates on memory
acaldero Jul 17, 2021
315c96f
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
2ba9c43
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
74a8fb4
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
e2e6a16
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
5c1f5fd
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
36e4c3c
3.0: minor updates on memory
acaldero Jul 17, 2021
6ee9bdb
3.0: minor updates on memory
acaldero Jul 17, 2021
9389374
3.0: minor updates on memory
acaldero Jul 17, 2021
161a3b1
3.0: minor updates on memory
acaldero Jul 17, 2021
652e2c5
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
b2918ad
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
7dd6d14
3.0: minor improvements on creator_memory
acaldero Jul 17, 2021
d88f392
3.0: minor updates on memory
acaldero Jul 18, 2021
1258618
3.0: minor updates on memory
acaldero Jul 18, 2021
0289c60
3.0: minor updates on memory
acaldero Jul 18, 2021
d0adf1c
3.0: minor updates on memory
acaldero Jul 18, 2021
6c76849
3.0: minor updates on memory
acaldero Jul 18, 2021
27b31df
3.0: minor updates on memory
acaldero Jul 18, 2021
b23b673
3.0: minor updates on memory
acaldero Jul 18, 2021
8769325
3.0: minor updates on memory
acaldero Jul 18, 2021
91ebb40
3.0: minor updates on memory
acaldero Jul 18, 2021
8baba89
3.0: minor updates on memory
acaldero Jul 18, 2021
5903274
3.0: minor updates on memory
acaldero Jul 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
668 changes: 204 additions & 464 deletions components/simulator/creator_uielto_memory.js

Large diffs are not rendered by default.

493 changes: 493 additions & 0 deletions components/simulator/creator_uielto_memory_old.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3248,7 +3248,7 @@
<!-- Data memory -->
<b-tab title="Data" active>

<table-mem :memory="memory"
<table-mem :main_memory="main_memory"
:memory_segment="memory_hash[0]"
:track_stack_names="track_stack_names"
:callee_subrutine="callee_subrutine"
Expand All @@ -3272,7 +3272,7 @@
<!-- Text memory -->
<b-tab title="Text">

<table-mem :memory="memory"
<table-mem :main_memory="main_memory"
:memory_segment="memory_hash[1]"
:track_stack_names="track_stack_names"
:callee_subrutine="callee_subrutine"
Expand All @@ -3284,7 +3284,7 @@
<!-- Stack memory -->
<b-tab title="Stack">

<table-mem :memory="memory"
<table-mem :main_memory="main_memory"
:memory_segment="memory_hash[2]"
:track_stack_names="track_stack_names"
:callee_subrutine="callee_subrutine"
Expand Down
118 changes: 68 additions & 50 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,14 @@ try
],







/*Memory*/
/*
* Memory
*/
memory: memory, //TODO: delete
memory_hash: ["data_memory", "instructions_memory", "stack_memory"],
memory: memory,
main_memory: {},

row_index: null, //TODO: try to include in a component
row_index: null, //TODO: try to include in a component
selected_space_view: null, //TODO: try to include in a component
selected_stack_view: null, //TODO: try to include in a component

Expand Down Expand Up @@ -2751,9 +2749,17 @@ try
/* update/reset */
app._data.totalStats = 0;
app._data.instructions = instructions;

if (false == OLD_CODE_ACTIVE)
{
}
else // if (true == OLD_CODE_ACTIVE)
{
app._data.memory[memory_hash[1]] = memory[memory_hash[1]];
app._data.memory[memory_hash[0]] = memory[memory_hash[0]];
app._data.memory[memory_hash[2]] = memory[memory_hash[2]];
}

tokenIndex = 0;
app.reset(true);

Expand Down Expand Up @@ -2915,18 +2921,26 @@ try
},

/*Save a binary in a local file*/
library_save(){
if(assembly_compiler() == -1){
return;
library_save ()
{
if (assembly_compiler() == -1) {
return;
}
promise.then((message) => {
if(message == "-1"){
return;
}
if(memory[memory_hash[0]].length != 0){
show_notification('You can not enter data in a library', 'danger') ;
return;

if (false == OLD_CODE_ACTIVE)
{
}
else // if (true == OLD_CODE_ACTIVE)
{
if (memory[memory_hash[0]].length != 0) {
show_notification('You can not enter data in a library', 'danger') ;
return;
}
}

for (var i = 0; i < instructions_binary.length; i++){
console_log(instructions_binary[i].Label)
Expand Down Expand Up @@ -3303,9 +3317,9 @@ try




/*Convert hexadecimal number to floating point number*/
hex2float ( hexvalue ){
hex2float ( hexvalue )
{
/*var sign = (hexvalue & 0x80000000) ? -1 : 1;
var exponent = ((hexvalue >> 23) & 0xff) - 127;
var mantissa = 1 + ((hexvalue & 0x7fffff) / 0x800000);
Expand Down Expand Up @@ -3377,12 +3391,14 @@ try



/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


change_data_view(e, type)
{
//TODO:
// 1) try to include in the memory component


//TODO: delete when all dependences are remove
change_data_view(e, type){
app._data.data_mode = e;

if(e == "registers"){
Expand All @@ -3409,8 +3425,17 @@ try
creator_ga('data', 'data.view', 'data.view.' + app._data.data_mode);
},

//TODO: try to include in a component
change_space_view(){
change_space_view()
{
//TODO:
// 1) try to include in the memory component
// 2) update code to new memory API (don't use memory abstraction datatype directly)

if (false == OLD_CODE_ACTIVE)
{
}
else // if (true == OLD_CODE_ACTIVE)
{
if(app._data.selected_space_view == "sig_int"){
var hex = "";
for (var j = 0; j < 4; j++) {
Expand Down Expand Up @@ -3474,15 +3499,27 @@ try
i++;
}
app._data.memory = memory;
}
},

//TODO: try to include in a component
hide_space_modal(){
hide_space_modal()
{
//TODO:
// 1) try to include in the memory component
app._data.selected_space_view = null;
},

//TODO: try to include in a component
change_stack_view(){
change_stack_view()
{
//TODO:
// 1) try to include in the memory component
// 2) update code to new memory API (don't use memory abstraction datatype directly)

if (false == OLD_CODE_ACTIVE)
{
}
else // if (true == OLD_CODE_ACTIVE)
{
if(app._data.selected_stack_view == "sig_int"){
var hex = "";
for (var j = 0; j < 4; j++) {
Expand Down Expand Up @@ -3512,37 +3549,18 @@ try
memory[memory_hash[2]][app._data.row_index].Value = this.hex2char8(hex);
}
app._data.memory = memory;
}
},

//TODO: try to include in a component
hide_stack_modal(){
hide_stack_modal()
{
//TODO:
// 1) try to include in the memory component
app._data.selected_stack_view = null;
},

























/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


/*Stop user interface refresh*/
Expand Down
23 changes: 15 additions & 8 deletions js/creator_compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ function data_segment_compiler()
return ret ;
}

data_address = ret.addr ;
label = null;

console_log("byte Terminado");
Expand Down Expand Up @@ -1253,6 +1254,7 @@ function data_segment_compiler()
return ret ;
}

data_address = ret.addr ;
label = null;

console_log("half Terminado");
Expand Down Expand Up @@ -1330,6 +1332,8 @@ function data_segment_compiler()
if (ret.status != 'ok') {
return ret ;
}

data_address = ret.addr ;
label = null;

console_log("word Terminado");
Expand Down Expand Up @@ -1409,6 +1413,7 @@ function data_segment_compiler()
return ret ;
}

data_address = ret.addr ;
label = null;

console_log("double word Terminado");
Expand Down Expand Up @@ -1497,11 +1502,12 @@ function data_segment_compiler()

console_log(auxTokenString);

data_compiler(auxTokenString, architecture.directives[j].size, label, token, "float")
ret = data_compiler(auxTokenString, architecture.directives[j].size, label, token, "float")
if (ret.status != 'ok') {
return ret ;
return ret ;
}

data_address = ret.addr ;
label = null;

console_log("float Terminado");
Expand Down Expand Up @@ -1589,11 +1595,12 @@ function data_segment_compiler()

console_log(auxTokenString);

data_compiler(auxTokenString, architecture.directives[j].size, label, token, "double")
ret = data_compiler(auxTokenString, architecture.directives[j].size, label, token, "double")
if (ret.status != 'ok') {
return ret ;
}

data_address = ret.addr ;
label = null;

console_log("double Terminado");
Expand Down Expand Up @@ -1649,7 +1656,7 @@ function data_segment_compiler()
break;
}

data_address = creator_memory_storestring ( string, string.length, data_address, label, "ascii", align );
data_address = creator_memory_storestring(string, string.length, data_address, label, "ascii", align);

console_log("ascii_not_null_end Terminado");

Expand Down Expand Up @@ -1709,7 +1716,7 @@ function data_segment_compiler()
return packCompileError('m17', "", 'error', "danger") ;
}

data_address = creator_memory_storestring ( string, string.length, data_address, label, "asciiz", align );
data_address = creator_memory_storestring(string, string.length, data_address, label, "asciiz", align);

console_log("ascii_null_end Terminado");

Expand Down Expand Up @@ -1758,8 +1765,7 @@ function data_segment_compiler()
}

var size = parseInt(token) * architecture.directives[j].size;

data_address = creator_memory_storestring ( null, size, data_address, label, "space", align );
data_address = creator_memory_storestring(size, size, data_address, label, "space", align);

next_token();
token = get_token();
Expand Down Expand Up @@ -1833,10 +1839,11 @@ function data_compiler ( value, size, dataLabel, DefValue, type )
} ;

var r = crex_memory_data_compiler(value, size, dataLabel, DefValue, type) ;
if (r != "") {
if (r.msg != "") {
return packCompileError(r, "", 'error', "danger") ;
}

ret.addr = r.addr ;
return ret;
}

Expand Down
Loading