Age | Commit message (Collapse) | Author |
|
This fixes a bug where it would zero out the info of
the next malloc'd block.
|
|
This fixes a bug where when shifting the line left, it
would overwrite everything after the cursor with the
character at the cursor's position.
The reason this was happening is because memcpy copies
from start to end, and because the destination is more
than one byte ahead of the source, it overwrites the
next length source bytes, which will repeat until it's
copied n bytes.
|
|
direction version of memcpy.
This can help with some subroutines/functions like
shftln, which need to copy data in a certain direction
depending on the condition.
|
|
`b`.
|
|
registers.
This was due to print_char clobbering `d` when calling
get_index.
|
|
This helps reduce code duplication, and makes it
easier to both read, and add new handlers.
|
|
This subroutine gets the index of a given character
from a string.
This will help in replacing some routines like
get_ctrlidx, isdelm, and isdelm2.
|
|
using SIB, rather than with lsl.
This doesn't increase, or decrease the code size, but
does make it both more compact, and easier to read.
|
|
This makes the code much smaller than the previous
version.
|
|
sequence for the escape character.
|
|
with deeper scope local symbols.
This is done to make the code easier to read.
|
|
in the assembler.
- Rewrote more of the SuB Suite to use the new calling
convention.
- Fixed a bug to do with SIB operands in the
emulator's disassembler.
- Made the MMV instruction not require a loop prefix
for copying data.
|
|
- 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.
|
|
This is because the previous commit actually created
a bug, rather than fixing one.
- Added JMP, and JSR to the ortho extension, and
implemented them both in the assembler, and
emulator.
|
|
- Started work on implementing the Super VIA emulation.
- Added support for disabling disassembly per
instruction, when in debug mode.
- Did some more work on rewriting the SuB Suite to
work with the new calling convention.
- Rewrote the symbol handling code in the emulator's
assembler, to make it both simpler, and to add
support for arbitrarily deep symbol scopes.
- Added support for arbitrarily deep local symbol
scopes.
For example, to declare a symbol of depth 2, you add
two '@' characters to the start of the symbol name.
In other words, the number of '@' characters before
the symbol name is what determines the scope of that
symbol.
And to use a symbol thats outside the current
scope, you would use the same syntax as using a
struct member, so you would do `global.local`.
|
|
both the assembler, and the emulator.
I finally figured out how I could get support for the
Ortho extension implemented into the old assembler.
The only reason for doing this, is to buy me some
while I start work on the new assembler, and to help
me get an idea for how to do the same in the new
assembler.
|
|
This is the biggest milestone I've reached for this
project, since the base extension changes alot about
what Sux can do by default, and now makes it a viable
instruction set for modern day use, when compared
with other instruction sets.
|
|
- Made the debug print for the CPU flags more
readable.
- Started work on implementing line number support
into SuBAsm.
|
|
|
|
This is to allow for making the stack bigger for
anything that needs to change the size of it.
- Made the SuB Suite set the stack pointer to the end
of the usable RAM, and allow for changing the stack
size.
In this case, the size of the stack is currently set
to 192K, with the end of the heap being just below
the stack.
|
|
implementation of free(), although it's commented
out.
- Removed the sbc() function from the emulator, since
sbc can be done by just inverting the second operand
of adc.
|
|
emulator's memory.
All reads outside of the emulator's memory give back
$/0xFF bytes, while all writes outside of the
emulator's memory are ignored.
- Implemented malloc(), and free() in the SuB Suite.
In order to do this, I had to add support for a heap,
which I did by reserving the first 3 banks of the
address space (the first 192K), and by adding a
routine that finds the end of the RAM.
In this case, I set the starting address for the
routine at bank 3 (bank 4 with one indexing), but,
the routine's starting address isn't hardcoded, and
thus, any starting address can be passed as an
argument.
The routine uses the fact that we can now read/write
outside the emulator's memory, and also uses the
fact that writing outside the emulator's memory will
be ignored, and that reading outside the emulator's
memory will always read $/0xFF bytes, and uses that
to signal that it's reached the end of the RAM.
- Added a test program for getting the size of RAM
starting at address $/0x20000.
|
|
|
|
handled.
- Added a function called fix_symtree(), which when
called. will rearrange the symbol tree based on the
order they're declared in by the token stream.
The reason I wrote this, was to make sure the symbol
tree could be printed correctly.
- Optimized print_symtree() to now use tail recursion.
- Started adding all of the SuB Suite's structs.
|
|
- Optimized the memory read, and write functions.
- Made the emulator faster, and cleaner in general.
|
|
- Simplified the effective address functions.
- Made SuBEditor a bit faster.
- JSR, and RTS now support using the RS prefix, which
is used to specify the return address size, with an
RS prefix of 0 being a return address size of 64
bits, rather than 8 bits.
|
|
It now uses a struct to store the escape sequence.
Before it handles the escape sequence, it parses it,
which includes things like getting any arguments
that are supplied, and getting the mode type.
- Moved the code that handles control codes to a
separate function.
The reason for doing this was because I wanted to make
the escape sequence handling faster, but also make the
code more readable at the same time.
I got the idea to do this from st, a terminal emulator
created by the suckless.org project.
|
|
expressions to the emulator's assembler.
|
|
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".
|
|
- Changed the file structure of the SuB Suite, so that
all variable declarations, symbols, and constants
are in a single file.
- Moved the C library functionss into a separate
file, and made them use stack frames.
- Added support for using the emulator's assembler for
realtime debugging, to enter it, get in to stepping
mode by pressing Ctrl+s, press any other key, then
press F1,
The reason for having to press some other key before
pressing F1 is because it only allows entering the
assembler when the keyboard is not ready.
- Added the ".res" directive to the emulator's
assembler, the ".res" directive tells the assembler
to reserve however many bytes specified by the
operand.
- Fixed some bugs in the emulator's assembler.
|
|
- Added a new preifx called the OF prefix, which adds
the contents of a specific register to the current
operand.
- Added a table generator, which parses opcode table
csv files.
|
|
- Fixed some bugs in the emulator's assembler.
- Worked on SuBAsm's lexer some more.
- Created a new directory for the SuB suite, and moved
all of the SuB suite's files in there.
|