Skip to content

Commit 3c04e2d

Browse files
committed
Change added to ADD instruction
Makes the carry be added as a carry in to the sum whenever doing an add
1 parent e299a98 commit 3c04e2d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/inst.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* set
88
* Original Creator: Colton Schmidt
99
* Date of Creation: 01/10/15
10-
* Last Editor: Colton Schmidt
11-
* Date of Last Edit: 01/10/15
10+
* Last Editor: Bailey Tye
11+
* Date of Last Edit: 25/02/16
1212
*/
1313

1414

@@ -93,6 +93,7 @@ void add(uint16_t addAddress){
9393
uint8_t temp1 = regA.data;
9494
uint8_t temp2 = MAINMEM[addAddress].data;
9595
uint8_t result = temp1 + temp2;
96+
result += (regSTAT.data & 0x1);
9697
regA.data = result & 0xF;
9798

9899
//Set overflow bit

0 commit comments

Comments
 (0)