Fixed 2 bugs.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Thu, 10 Jan 2019 04:51:53 +0000 (20:51 -0800)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Thu, 10 Jan 2019 04:51:53 +0000 (20:51 -0800)
BUG1: Fixed `neddis` failing to print final word of code.

BUG2: Added CC_FLAGS to command line options in Makefiles
      for nedsim/nedasm/neddis.

nedasm/Makefile
neddis/Makefile
neddis/neddis.c
nedsim/Makefile

index 93fd797..c842161 100644 (file)
@@ -8,7 +8,7 @@ SRC != ls *.c
 all: nedasm
 
 nedasm:
 all: nedasm
 
 nedasm:
-       $(CC) -o $@ $(SRC)
+       $(CC) $(CC_FLAGS) -o $@ $(SRC)
 
 clean:
        @rm -f nedasm
 
 clean:
        @rm -f nedasm
index b24f14e..ca679de 100644 (file)
@@ -8,7 +8,7 @@ SRC != ls *.c
 all: neddis
 
 neddis:
 all: neddis
 
 neddis:
-       $(CC) -o $@ $(SRC)
+       $(CC) $(CC_FLAGS) -o $@ $(SRC)
 
 clean:
        @rm -f neddis
 
 clean:
        @rm -f neddis
index 306666e..957c56b 100644 (file)
@@ -323,7 +323,7 @@ main(int argc, char ** argv)
     uint32_t offset = aout_exec.a_entry;
     /* Since all NED instructions are one word (4 bytes) wide, read in one word increments. */
     uint32_t i = 1;
     uint32_t offset = aout_exec.a_entry;
     /* Since all NED instructions are one word (4 bytes) wide, read in one word increments. */
     uint32_t i = 1;
-    while (i < text_segment[0]) {
+    while (i <= text_segment[0]) {
         if (display_labels) {
             for (uint32_t i=0; i < symbol_count; i++) {
                 if (offset == symbol_table[i].n_value) {
         if (display_labels) {
             for (uint32_t i=0; i < symbol_count; i++) {
                 if (offset == symbol_table[i].n_value) {
index f34d74d..9ed1fe5 100644 (file)
@@ -8,7 +8,7 @@ SRC != ls *.c
 all: nedsim
 
 nedsim:
 all: nedsim
 
 nedsim:
-       $(CC) -o $@ $(SRC)
+       $(CC) $(CC_FLAGS) -o $@ $(SRC)
 
 clean:
        @rm -f nedsim
 
 clean:
        @rm -f nedsim