Skip to content

Commit 25278f7

Browse files
Added Conditional Branching , Added Load and Move , Reduced Data Stack Size to 16 from 20
1 parent 4a0ee4e commit 25278f7

9 files changed

Lines changed: 669 additions & 35 deletions

File tree

build/v0.0218.04.45/uvr_build.hex

Lines changed: 442 additions & 0 deletions
Large diffs are not rendered by default.

include/command.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
#define cerase 23 //erase --done (message left)
2323

24+
#define cmove 181 //.move
2425

25-
#define ctoggle 209 //.toggle --done
2626
#define hwport 100 //.hwport --done
2727
#define cdefine 37 // .define --done
2828
#define cprog 117 // prog --done
@@ -41,11 +41,11 @@
4141
#define cassign 176 // .assign --done
4242

4343
#define cdelete 65 // .delete
44-
#define cload 250 //.load
45-
#define ccopy 125 //.copy
46-
#define cif 168 // .if
44+
#define cload 250 //.load --done
45+
#define ccopy 125 //.copy --done
46+
#define cif 168 // .if --done
4747
#define cloop 146 // .loop
48-
#define cfi 141 // .fi
48+
4949
#define cgoto 59 // .goto
5050
#define cblock 21 // .block
5151

@@ -55,11 +55,14 @@
5555
#define crshift 212 // rshift --done
5656
#define clshift 20 // lshift --done
5757

58-
59-
60-
58+
#define cfi 141 // .fi --done
59+
#define endifl 30
60+
#define endifh 30
61+
#define fcheckfi 225
62+
#define scheckfi 255
6163

6264
// cls handling done by clear_terminal system routine.
6365

6466

65-
#endif //command_h
67+
#endif //command_h
68+

include/flags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define dat_flag 253 //.datax
3030

3131
#define operand_exceeds 119 // exceeds
32-
#define operand_preceeds 215 // preceeds
32+
#define operand_precedes 199 // preceeds
3333
#define operand_equ 131 // equ
3434
#define operand_neq 139 // neq
3535

include/handlers.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ static inline void assign_handler(void);
2525

2626
static void rshift_handler(void);
2727
static void lshift_handler(void);
28-
static inline void if_handler(void);
28+
static void if_handler(void);
2929
static inline void hwport_handler(void);
30-
static void toggle_handler(void);
30+
3131

3232
static inline void copy_handler(void);
33+
static void fi_handler(void);
3334

35+
static void load_handler(void);
3436

3537

3638

include/parser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static inline void assign_parser(void);
3030

3131
static void dual_operand_line_parser(void); //increment //decrement //not //delete //print //assign
3232

33+
static inline void fi_parser(void);
3334

3435
static void if_parser(void);
3536
static inline void hwport_parser(void);

include/uvr_const.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
#define buffer_size 32
2424

25+
#define prog_buffer_size 80
26+
27+
2528

2629

2730

@@ -88,6 +91,7 @@ __code static char running_program_msg[35] = "\033[33mExecuting script at runtim
8891
#define ERR_NONPERMITTED_ACCESS 0x05
8992
#define ERR_INVALID_BLOCK 0x06
9093
#define ERR_INVALID_OPERAND 0x07
94+
#define ERR_MISSING_FI 0x08
9195
#define NO_ERROR 0x00
9296

9397

include/uvr_variable.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ volatile unsigned int __data __at (0x3E) result = 0;
3131
//=============================== MULTIPLEXED BUFFER ===========================================
3232

3333
volatile unsigned char __data __at (0x40) input_buffer[32] = {0};
34-
volatile unsigned char __data __at (0x60) virtual_data_stack[10][2] = {{0}};
34+
volatile unsigned char __data __at (0x60) virtual_data_stack[8][2] = {{0}};
35+
volatile unsigned char __data __at(0x71) local_loop_stack[2] = {0};
36+
volatile unsigned char __data __at(0x73) local_conditional_stack[2] = {0};
3537
volatile unsigned char __data __at (0x75) result_char_buffer[5] = {'0'};
3638
volatile unsigned int __data __at(0x7A) temp_integer = 0;
3739

include/virtual_stack_manager.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#ifndef virtual_stack_manager_h
22
#define virtual_stack_manager_h
33

4-
#define data_stack_limit 10
4+
#define data_stack_limit 8
55
#define symbol 0
66
#define data_segment 1
77

8+
#define loop_var 0
9+
#define return_addr 1
10+
11+
#define condition 0
12+
#define skip_addr 1
13+
14+
815
static unsigned char fetch_data_variable(unsigned char);
916
static void create_data_variable(unsigned char);
1017
static void assign_data_variable(unsigned char,unsigned char);

0 commit comments

Comments
 (0)