stack_machine.git
5 years agoFix the result storage and dispatching after long add, mul and div
Nick Downing [Wed, 19 Jun 2019 07:18:40 +0000 (17:18 +1000)]
Fix the result storage and dispatching after long add, mul and div

5 years agoFix all relative jumps to be in range, debug multiply and divide calling stuff
Nick Downing [Wed, 19 Jun 2019 00:50:55 +0000 (10:50 +1000)]
Fix all relative jumps to be in range, debug multiply and divide calling stuff

5 years agoRevamp register usage in math package for shifts, multiplies and divides to remove...
Nick Downing [Tue, 18 Jun 2019 14:23:09 +0000 (00:23 +1000)]
Revamp register usage in math package for shifts, multiplies and divides to remove redundant register swappage and reduce the number of routines to be provided, implement long divide, need to update interpreter pages for new conventions

5 years agoFirst cut at page 2 for long maths, makes everything too large
Nick Downing [Tue, 18 Jun 2019 11:27:21 +0000 (21:27 +1000)]
First cut at page 2 for long maths, makes everything too large

5 years agoRevert sm2.asm to commit 557827e, reimplement in sm3.asm with a less optimal approach...
Nick Downing [Tue, 18 Jun 2019 08:22:37 +0000 (18:22 +1000)]
Revert sm2.asm to commit 557827e, reimplement in sm3.asm with a less optimal approach with better separation between stack machine and math package, includes a first cut at the long math package but not the long page or long division yet

5 years agoImplement first part of page2 (redirections to page0 for load/store operations)
Nick Downing [Mon, 17 Jun 2019 00:23:17 +0000 (10:23 +1000)]
Implement first part of page2 (redirections to page0 for load/store operations)

5 years agoInfrastructure for long math using a new page 2, fills up page 0, no page 2 yet
Nick Downing [Sun, 16 Jun 2019 13:40:12 +0000 (23:40 +1000)]
Infrastructure for long math using a new page 2, fills up page 0, no page 2 yet

5 years agoRemove unused stack addressing modes
Nick Downing [Sun, 16 Jun 2019 12:52:55 +0000 (22:52 +1000)]
Remove unused stack addressing modes

5 years agoImplement new calling convention with automatic C-style stack cleanup
Nick Downing [Sun, 16 Jun 2019 11:34:43 +0000 (21:34 +1000)]
Implement new calling convention with automatic C-style stack cleanup

5 years agoSave space and implement page1_imm_call, page1_call, page0_ret (not used yet)
Nick Downing [Sun, 16 Jun 2019 11:29:10 +0000 (21:29 +1000)]
Save space and implement page1_imm_call, page1_call, page0_ret (not used yet)

5 years agoAdd imm_xchg_w and xchg_w commands, change XXXrev to xchg_XXX, tidy up slightly
Nick Downing [Sun, 16 Jun 2019 11:08:35 +0000 (21:08 +1000)]
Add imm_xchg_w and xchg_w commands, change XXXrev to xchg_XXX, tidy up slightly

5 years agoWorking factorial program with the new stack machine
Nick Downing [Sun, 16 Jun 2019 10:55:31 +0000 (20:55 +1000)]
Working factorial program with the new stack machine

5 years agoFirst cut at more efficient smodal stack machine using several interpreter pages
Nick Downing [Sun, 16 Jun 2019 06:20:13 +0000 (16:20 +1000)]
First cut at more efficient smodal stack machine using several interpreter pages

5 years agoAdd CORDIC demo code from Peter Knoppers (DDJ article)
Nick Downing [Thu, 13 Jun 2019 16:32:49 +0000 (02:32 +1000)]
Add CORDIC demo code from Peter Knoppers (DDJ article)

5 years agoUnroll the multiply, reinstate the state machine test code
Nick Downing [Thu, 13 Jun 2019 16:24:33 +0000 (02:24 +1000)]
Unroll the multiply, reinstate the state machine test code

5 years agoMinor optimization due to unrolled loop not using b anymore
Nick Downing [Thu, 13 Jun 2019 16:12:01 +0000 (02:12 +1000)]
Minor optimization due to unrolled loop not using b anymore

5 years agoUnroll 8 bits division inner loop (2 versions, 4 entry points for 4 quadrants)
Nick Downing [Thu, 13 Jun 2019 16:07:13 +0000 (02:07 +1000)]
Unroll 8 bits division inner loop (2 versions, 4 entry points for 4 quadrants)

5 years agoOptimize layout of division code
Nick Downing [Thu, 13 Jun 2019 15:47:15 +0000 (01:47 +1000)]
Optimize layout of division code

5 years agoFix bugs, working signed division
Nick Downing [Thu, 13 Jun 2019 15:36:13 +0000 (01:36 +1000)]
Fix bugs, working signed division

5 years agoFirst cut at the full signed division with separate code for each quadrant, some...
Nick Downing [Thu, 13 Jun 2019 14:22:25 +0000 (00:22 +1000)]
First cut at the full signed division with separate code for each quadrant, some quadrants do not work yet, an issue is needing to clear cf before sbc hl,de

5 years agoFurther minor optimizations
Nick Downing [Thu, 13 Jun 2019 12:36:10 +0000 (22:36 +1000)]
Further minor optimizations

5 years agoMake division routine only do inc/dec on zero crossing, and other improvements
Nick Downing [Thu, 13 Jun 2019 12:09:08 +0000 (22:09 +1000)]
Make division routine only do inc/dec on zero crossing, and other improvements

5 years agoNew non-restoring division routine, sub-optimal but justified to always work
Nick Downing [Wed, 12 Jun 2019 12:39:26 +0000 (22:39 +1000)]
New non-restoring division routine, sub-optimal but justified to always work

5 years agoImprove loops and fallthru
Nick Downing [Mon, 10 Jun 2019 11:09:51 +0000 (21:09 +1000)]
Improve loops and fallthru

5 years agoImproved way that uses cf to do most of the adjustment needed for zero crossing
Nick Downing [Mon, 10 Jun 2019 10:05:44 +0000 (20:05 +1000)]
Improved way that uses cf to do most of the adjustment needed for zero crossing

5 years agoFirst cut at non-restoring division
Nick Downing [Mon, 10 Jun 2019 09:59:47 +0000 (19:59 +1000)]
First cut at non-restoring division

5 years agoAdd decimal factorial result printing using the division routines
Nick Downing [Mon, 10 Jun 2019 04:02:50 +0000 (14:02 +1000)]
Add decimal factorial result printing using the division routines

5 years agoImprove trace, add unsigned division
Nick Downing [Mon, 10 Jun 2019 03:47:46 +0000 (13:47 +1000)]
Improve trace, add unsigned division

5 years agoOptimize lower dispatcher used for control transfers, that takes pc in hl
Nick Downing [Mon, 10 Jun 2019 00:34:14 +0000 (10:34 +1000)]
Optimize lower dispatcher used for control transfers, that takes pc in hl

5 years agoOptimize rst 8 routine, ld hl,(bc)+
Nick Downing [Mon, 10 Jun 2019 00:27:03 +0000 (10:27 +1000)]
Optimize rst 8 routine, ld hl,(bc)+

5 years agoExchange roles of bc and de, adjust interface to math package which doesn't use excha...
Nick Downing [Mon, 10 Jun 2019 00:18:50 +0000 (10:18 +1000)]
Exchange roles of bc and de, adjust interface to math package which doesn't use exchanged bc and de, move some routines around to allow for slightly larger math opcodes, fix a bug which caused return to BDOS not to work

5 years agoInitial commit, can calculate a factorial recursively with C calling convetion
Nick Downing [Sun, 9 Jun 2019 23:28:05 +0000 (09:28 +1000)]
Initial commit, can calculate a factorial recursively with C calling convetion