Simplify code

This commit is contained in:
Gabriel Tofvesson 2019-05-07 17:28:34 +02:00
parent a21c5c3320
commit 96f120a99d

View File

@ -21,27 +21,11 @@
#define LIST_START 0xE0 #define LIST_START 0xE0
#define LIST_END 0x00
#define HIGHEST_BUCKET 0xD2 #define HIGHEST_BUCKET 0xD2
#define BUCKET_SIZE 14
#define BUCKET_INDEX_TRACKER 0b11111000
#optable 0x0 @OT_0 // Generate jump-table ;)
#optable 0x1 @OT_1 #emit
#optable 0x2 @OT_2 >for i in range(16): print("#optable "+hex(i)+" @OT_"+hex(i)[2::])
#optable 0x3 @OT_3
#optable 0x4 @OT_4
#optable 0x5 @OT_5
#optable 0x6 @OT_6
#optable 0x7 @OT_7
#optable 0x8 @OT_8
#optable 0x9 @OT_9
#optable 0xa @OT_A
#optable 0xb @OT_B
#optable 0xc @OT_C
#optable 0xd @OT_D
#optable 0xe @OT_E
#optable 0xf @OT_F
// Generate program memory: // Generate program memory:
// Addresses 0xE0-0xFF ignored // Addresses 0xE0-0xFF ignored
@ -79,21 +63,13 @@ mov ar asr
mov pm lc mov pm lc
sub gr sub gr
// Do the merge thing
$MERGE
mov ar asr; declc; bls @MB_SPEC
mov pm ir
mov pc asr
mov ir pm; incpc
sub gr
// Copy elements to list // Copy elements to list
$MERGE_MOVE $MERGE
mov ar asr; declc; bls @MB_SPEC mov ar asr; declc; bls @MB_SPEC
mov pm ir mov pm ir
mov pc asr // This branch improves stability mov pc asr // This branch improves stability
mov ir pm; incpc; bls @MERGE_BOTTOM // Transfer value and copy more elements mov ir pm; incpc; bls @MERGE_BOTTOM // Transfer value and copy more elements
sub gr; bra @MERGE_MOVE sub gr; bra @MERGE
$MERGE_BOTTOM $MERGE_BOTTOM
sub gr sub gr