diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-02-25 12:43:11 -0500 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-02-25 12:43:11 -0500 |
commit | 35a18609864470b3dc49f3a9a6cb6ec93e57300d (patch) | |
tree | c52364211b25723b2cf4595ed6c4bc2d45195062 /programs/sub-suite/tmp-stuff/cmd_cpy.c | |
parent | 8d7f27d9a0b61d3694a62f3e54be885d8073f02b (diff) |
- 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.
Diffstat (limited to 'programs/sub-suite/tmp-stuff/cmd_cpy.c')
-rw-r--r-- | programs/sub-suite/tmp-stuff/cmd_cpy.c | 33 |
1 files changed, 0 insertions, 33 deletions
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 <stdint.h> - -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; - } - } -} |