From 35a18609864470b3dc49f3a9a6cb6ec93e57300d Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Thu, 25 Feb 2021 12:43:11 -0500 Subject: - Implemented the multiply expression into the assembler. - Implemented support for the SIB addressing mode into the assembler. SIB is short for "Scale Index, and Base", and works much like x86's version of SIB (scale*index+base), although my version supports any scale value between 1, and 256. - Redid the line shifting routine in SuBEditor. It now uses memcpy, and memset to do that, and also supports shifting the line left, or right by any number of characters. --- programs/sub-suite/tmp-stuff/cmd_cpy.c | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 programs/sub-suite/tmp-stuff/cmd_cpy.c (limited to 'programs/sub-suite/tmp-stuff/cmd_cpy.c') diff --git a/programs/sub-suite/tmp-stuff/cmd_cpy.c b/programs/sub-suite/tmp-stuff/cmd_cpy.c deleted file mode 100644 index 6b89e7d..0000000 --- a/programs/sub-suite/tmp-stuff/cmd_cpy.c +++ /dev/null @@ -1,33 +0,0 @@ -#include - -int cmd_size = 0x400; -int maxcol = 80; - -extern uint8_t scr_row; -extern uint8_t scr_col; -extern uint8_t scr_str; - -int find_end(char *str, int pos) { - int i; - for (i = pos; str[i] != '\0'; i++); - return i; -} - -void cmd_cpy(char *scr_buf, char *cmd_buf, int pos) { - int end_line = (find_end(scr_buf, pos)/(maxcol+1)) - scr_str; - int start_line = (find_start(scr_buf, end_line) + scr_str) * (maxcol+1); - - for (int i = 0, done = 0; !done; i++) { - uint64_t tmp = (uint64_t)scr_buf[i]; - for (int j = 0; j < 8; j++ , tmp >>= 8) { - int idx = (i*8) + j; - uint8_t tmp2 = tmp; - if (idx >= cmd_size || !tmp2) { - done = 1; - cmd_buf[idx] = '\0'; - break; - } - cmd_buf[idx] = tmp2; - } - } -} -- cgit v1.2.3-13-gbd6f