diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2020-08-08 18:11:35 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2020-08-08 18:11:35 -0400 |
commit | f16af793a58a9f398fc598a0c129e3bb90eb61f6 (patch) | |
tree | 2f674574f2955a1bc52ee3a6818516226833ea9b /programs/sub-suite/libc.s | |
parent | 1ec19679b3db209429b0897f6ccda6d09d018a70 (diff) |
- Refactored the opcode table, in order to make the
instruction formatting simpler.
- Refactored the instruction table of the emulator's
assembler, it now has two parts, the addressing mode
bits, and the base value.
The base value is what's used to generate the actual
opcode, with the addressing mode bits telling the
assembler what addressing modes this instruction
supports.
The reason for doing this was to use less space. For
comparison, the previous version used 870 bytes for
the instruction table, while the new version uses
only 222 bytes. The new version is nearly 4 times
smaller than the pervious version.
- The B register based ALU instructions now use their
own addressing mode, and are specified by using 'b'
as the operand for those instructions.
For example, to add the Accumulator with the B
register, you now use "ADC B" instead of "AAB".
Diffstat (limited to 'programs/sub-suite/libc.s')
-rw-r--r-- | programs/sub-suite/libc.s | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/programs/sub-suite/libc.s b/programs/sub-suite/libc.s index bd55f9c..d13d983 100644 --- a/programs/sub-suite/libc.s +++ b/programs/sub-suite/libc.s @@ -31,7 +31,7 @@ strtoull: lda.q sp+1 ; Get the value from the value buffer. mul sp+19 ; Multiply the value by the base. clc ; Prepare for a non carrying add. - aab ; Add the digit value to the total value. + adc b ; Add the digit value to the total value. sta.q sp+1 ; Place the value in the value buffer. iny ; Increment the string index. and #0 ; Reset A. @@ -96,7 +96,7 @@ strcasecmp: jsr tolower ; Convert the character of string 2 to lowercase. tab ; Place it in B. pla ; Get the character of string 1 back. - cab ; Is the character of both strings, the same? + cmp b ; Is the character of both strings, the same? plb ; Get the islong flag back. bne cmpr ; No, so check if we're too short, or too long. iny ; Yes, so increment the index. |