migrated to ACME assembler

commit 145d64aa6e78838ed07cefed372f0ad6a4687e97
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 20:16:57 2020 +0200

    ACME adaptation

commit 885209d7822286744ea53232ae7461472a01d5d6
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 19:57:25 2020 +0200

    ACME adaptation

commit 334d84486bc603551887e7cbeb59d329f2224cc7
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 18:29:15 2020 +0200

    ACME adaptation

commit b5966f49bcd8f0ca79cbec93819a31238924707e
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 18:09:31 2020 +0200

    ACME adaptation

commit 786536a93a5eab5e676fca99625b4eb094a554e7
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 17:24:48 2020 +0200

    ACME adaptation

commit 704c70dfb1f5d68775d6f3da220803b8a3990f56
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 15:07:12 2020 +0200

    ACME adaptation

commit 136874964c9083b375f151475310f9636871fc72
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 14:45:14 2020 +0200

    ACME adaptation

commit 8eca0d5700b72d04336e72c5cd3a68e18b85f96d
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 14:06:52 2020 +0200

    ACME adaptation

commit 11d29eb7ee318239d782f85498b6d0524624d5c4
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 13:56:45 2020 +0200

    ACME apaptation

commit c9b5e5e04cceb92c66bc027e6440bc0f7c5a499f
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 13:49:04 2020 +0200

    ACME adaptation

commit f5cc254cbc921f07863807468cb3fe26b410b409
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 13:01:18 2020 +0200

    ACME adaptation

commit e135a27bf9c30cc0965379c954564e06406303b1
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 19 21:55:01 2020 +0200

    ACME adaptation

commit e9dfddf90d9e2795e88b7da40ae050d733faeb56
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 19 21:48:47 2020 +0200

    Makefile fix

commit 07030104c65cf5e5beeacf6d629ccb9245e58657
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 19 21:42:00 2020 +0200

    ACME adaptation

commit f824362ee5bcfbffca86c430b57773b2ffd65655
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 19 20:14:56 2020 +0200

    ACME adaptation

commit 3a3c59007dcd4940d89b8669f34ca56b61c25fdf
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 18 21:51:45 2020 +0200

    ACME adaptation

commit 6790ef7bc88a41de2881c69b7524dd4ab8c74b5d
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 18 20:35:23 2020 +0200

    ACME adaptation

commit 38ad18b90e9ec713aa7ca49576b3388ce1733357
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 18 18:46:20 2020 +0200

    ACME adaptation

commit 541340371122a9702f7b2d9771c298223cffd0e9
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 18 16:49:46 2020 +0200

    ACME adaptation

commit 25cfd5e186459be1a260d3eb8cfff767838de370
Author: FeralChild64 <you@example.com>
Date:   Thu Sep 17 20:13:33 2020 +0200

    ACME adaptation

commit f61599444d5b1d03d8fd8e4a6a7c3b85069bedb3
Author: FeralChild64 <you@example.com>
Date:   Thu Sep 17 19:29:23 2020 +0200

    ACME adaptation

commit b290be31ec7bb2e5723607697da1bbc621c84429
Author: FeralChild64 <you@example.com>
Date:   Thu Sep 17 17:20:14 2020 +0200

    ACME adaptation

commit 877be9e856880d98fd4bcb25b42aaaacda9dc463
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 16 21:47:38 2020 +0200

    ACME adaptation

commit bb20edaf85d386e41d5c2f715b745b68fbd3362e
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 16 21:31:30 2020 +0200

    ACME adaptation

commit c5d31bd8685abce37c8e254d15aac20bd1570d9f
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 16 18:40:49 2020 +0200

    ACME adaptation

commit 29349826b38f8a89649171559dc8cf24c560aff1
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 23:35:47 2020 +0200

    ACME adaptation

commit 8bcd6a621c4b11766d0cf34f79858ba90a67248e
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 22:52:25 2020 +0200

    ACME adaptation

commit e87a69edc2ce4bfcc460c31e08dcc352a985f88d
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 22:43:27 2020 +0200

    ACME adaptation

commit f49a097bd52e96d00b866c02bda7121e4543233c
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 19:02:07 2020 +0200

    ACME adaptation

commit fa0e9214a633b8e8f867cc70925b390940dcd426
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 17:47:19 2020 +0200

    ACME adaptation

commit 1b763b91e7a03e426227129c7f22f0ce57a4c197
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 17:17:10 2020 +0200

    ACME adaptation

commit e92a4b57b232cd85eb1e71090b8a89c7c8461ebc
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 17:15:37 2020 +0200

    ACME adaptation

commit de3c693e8a7e73ea5289198946058e3240894e6a
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 17:10:05 2020 +0200

    ACME adaptation

commit f9bd7ae0f04e932d613be9ed5cb19af9be5d338e
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 13 14:34:44 2020 +0200

    ACME adaptation

commit 694dee52555dbfc2b1f7f452a9671ff51106c057
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 13 14:16:14 2020 +0200

    ACME adaptation

commit 0af2c55edfcd22942d9f25417eb0d35f55b71604
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 11 17:38:09 2020 +0200

    ACME adaptation

commit 2015e17334bd56a1e8a13a5abc098d9c2e7ea44f
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 11 16:46:05 2020 +0200

    ACME adaptation

commit b1e972162798d60f4483cd6cc261e856c20c2c8c
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 11 16:24:31 2020 +0200

    ACME adaptation

commit 9d027e868466901ba53bf074a79ec8cf16273021
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 11 15:04:31 2020 +0200

    ACME adaptation

commit 957186deddd1aa4f3b4f1aa1f421e4239a584e57
Author: FeralChild64 <you@example.com>
Date:   Thu Sep 10 22:49:07 2020 +0200

    ACME adaptation

commit b8060f67a455cfac109f08d96b62c360d693b931
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 23:07:28 2020 +0200

    ACME adaptation

commit e54d004568f44bbfe5c070ef1d7cf3544112e497
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 22:58:20 2020 +0200

    ACME adaptation

commit f90b77f073c5a605cb31c6ee451f65c8a8aff7d8
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 22:12:09 2020 +0200

    ACME adaptation

commit b211bb4afcd9c58fe1f5c92f3007717d611cd531
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 22:01:40 2020 +0200

    ACME adaptation

commit 8d7ea343b07e9e08e5f77f3c414758a6cffd0440
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 21:38:34 2020 +0200

    ACME adaptation

commit 46413eb0d92d6400aba0ff8dfe556e61e8a44d78
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 21:07:47 2020 +0200

    ACME adaptation

commit 9f98f69ecc21f7b74a5eb89e247f5a2c6fcb655d
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 20:05:03 2020 +0200

    ACME adaptation

commit 7bb9f1cadc682c7e0a4a6796739d860d473ca110
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 19:55:12 2020 +0200

    ACME adaptation

commit 5fc115392b5bdca6b56f67ad866b1884d2d2bdf8
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 19:31:10 2020 +0200

    ACME adaptation

commit b7940fc60e568d859df9e3156f6bacc6d685b2cc
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 19:16:09 2020 +0200

    ACME adaptation

commit 56288cb97197561afa0816b29c134ec1190e8eab
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 18:48:23 2020 +0200

    ACME adaptation

commit 10401a60fc7922a53d782120ef6795d889140218
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 16:34:16 2020 +0200

    ACME adaptation

commit 8ce76e4d2b56837a691ae84b1a412a2ae32a157b
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 16:20:44 2020 +0200

    ACME adaptation

commit 33fade899fa6172ea6b5b5f6683bb61f544429fd
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 15:28:46 2020 +0200

    ACME adaptation

commit a416f04734402fcfbc57a933731376df2e0180a1
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 12:40:03 2020 +0200

    ACME adaptation

commit f8daee005b1d29f6912723be2ac94bc5fbeb0508
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 7 23:29:54 2020 +0200

    ACME adaptation

commit 83fe6bdd0b08a44fdbfc6eefe323a4b194ccaf5b
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 7 22:23:16 2020 +0200

    ACME adaptation

commit cb1f75620b9c83000a15c9c7f7acefdfee79a979
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 7 19:23:12 2020 +0200

    ACME adaptation

commit e524d517c933ae1f0aeb49764d307fadb4845025
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 6 08:24:25 2020 +0200

    ACME adaptation - replaced comments

commit 2ab572c3a21f4a78a7312d0e684bc11d91d1717a
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 5 17:59:10 2020 +0200

    ACME adaptation - replaced the assembler
This commit is contained in:
FeralChild64 committed 2020-09-20 20:22:36 +02:00
1 parent bfc8291e41
commit c8d255130c
685 files changed
+15835 -16296

No files matched your search

+97 -95
View File
@@ -1,52 +1,53 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# M65 * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# M65 * #TAKE
;; #LAYOUT# X16 BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
list_single_line:
#if (ROM_LAYOUT_M65 && SEGMENT_BASIC_0)
!ifdef SEGMENT_M65_BASIC_0 {
jsr map_BASIC_1
jsr_ind VB1__list_single_line
jmp map_NORMAL
jsr map_BASIC_1
jsr (VB1__list_single_line)
jmp map_NORMAL
#else
} else {
// Print line number - in a new line
; Print line number - in a new line
jsr print_return
ldy #3
#if ROM_LAYOUT_M65
!ifdef CONFIG_MB_M65 {
jsr peek_via_OLDTXT
#elif CONFIG_MEMORY_MODEL_60K
} else ifdef CONFIG_MEMORY_MODEL_60K {
jsr peek_under_roms
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
} else ifdef CONFIG_MEMORY_MODEL_46K_OR_50K {
jsr peek_under_roms_via_OLDTXT
#else // CONFIG_MEMORY_MODEL_38K
} else { ; CONFIG_MEMORY_MODEL_38K
lda (OLDTXT),y
#endif
}
pha
dey
#if ROM_LAYOUT_M65
!ifdef CONFIG_MB_M65 {
jsr peek_via_OLDTXT
#elif CONFIG_MEMORY_MODEL_60K
} else ifdef CONFIG_MEMORY_MODEL_60K {
jsr peek_under_roms
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
} else ifdef CONFIG_MEMORY_MODEL_46K_OR_50K {
jsr peek_under_roms_via_OLDTXT
#else // CONFIG_MEMORY_MODEL_38K
} else { ; CONFIG_MEMORY_MODEL_38K
lda (OLDTXT),y
#endif
}
tax
pla
jsr print_integer
jsr print_space
// Iterate through printing out the line
// contents
; Iterate through printing out the line
; contents
lda #0
sta QTSW
@@ -54,22 +55,22 @@ list_single_line:
list_print_loop:
#if ROM_LAYOUT_M65
!ifdef CONFIG_MB_M65 {
jsr peek_via_OLDTXT
#elif CONFIG_MEMORY_MODEL_60K
} else ifdef CONFIG_MEMORY_MODEL_60K {
ldx #<OLDTXT
jsr peek_under_roms
cmp #$00
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
} else ifdef CONFIG_MEMORY_MODEL_46K_OR_50K {
jsr peek_under_roms_via_OLDTXT
cmp #$00
#else // CONFIG_MEMORY_MODEL_38K
} else { ; CONFIG_MEMORY_MODEL_38K
lda (OLDTXT),y
#endif
}
bne !+
rts // end of line
!:
bne @1
rts ; end of line
@1:
cmp #$22
bne list_not_quote
lda QTSW
@@ -80,195 +81,197 @@ list_print_loop:
list_not_quote:
// Check quote mode, and display as literal if required
; Check quote mode, and display as literal if required
ldx QTSW
bne list_is_literal
cmp #$FF
beq list_is_pi
// Check for extended BASIC tokens
; Check for extended BASIC tokens
cmp #$01
beq list_display_token_01
#if !HAS_SMALL_BASIC
!ifndef HAS_SMALL_BASIC {
cmp #$02
beq list_display_token_02
#endif
#if ROM_LAYOUT_M65
}
!ifdef CONFIG_MB_M65 {
cmp #$03
beq list_display_token_03
#endif
}
// Check for literals
; Check for literals
cmp #$7F
bcc list_is_literal
// Display a token - V2 dialect
; Display a token - V2 dialect
list_display_token_V2:
// Save registers
; Save registers
tax
pha
phy_trash_a
+phy_trash_a
// Subtract $80 from token to get offset in token list
; Subtract $80 from token to get offset in token list
txa
and #$7F
tax
// Check if token is known
; Check if token is known
cpx #TK__MAXTOKEN_keywords_V2
bcs list_display_unknown_token
// Now ask for it to be printed
; Now ask for it to be printed
jsr print_packed_keyword_V2
// FALLTROUGH
; FALLTROUGH
list_token_displayed:
// Restore registers
ply_trash_a
; Restore registers
+ply_trash_a
pla
cmp #$8F
bne list_not_rem
// REM command locks quote flag on until the end of the line, allowing
// funny characters in REM statements without problem.
sta QTSW // Any value other than $00 or $FF will lock quote mode on, so the token value of REM is fine here
; REM command locks quote flag on until the end of the line, allowing
; funny characters in REM statements without problem.
sta QTSW ; Any value other than $00 or $FF will lock quote mode on, so the token value of REM is fine here
// FALLTHROUGH
; FALLTHROUGH
list_not_rem:
iny
bne list_print_loop // branch always
bne list_print_loop ; branch always
list_is_pi:
lda #$7E
// FALLTROUGH
; FALLTROUGH
list_is_literal:
pha
bit QTSW
bpl list_is_literal_known // in quote mode every character is allowed
bpl list_is_literal_known ; in quote mode every character is allowed
and #$7F
cmp #$12
beq list_is_literal_known // enabling/disabling reverse mode is allowed
beq list_is_literal_known ; enabling/disabling reverse mode is allowed
and #%01100000
bne list_is_literal_known
pla
// FALLTROUGH
; FALLTROUGH
list_is_unknown:
phy_trash_a
+phy_trash_a
lda #<str_rev_question
ldy #>str_rev_question
jsr STROUT
ply_trash_a
+ply_trash_a
jmp_8 !+
+bra list_is_literal_known_cont
list_is_literal_known:
pla
jsr JCHROUT
!:
; FALLTROUGH
list_is_literal_known_cont:
iny
bne_16 list_print_loop
+bne list_print_loop
rts // end of line
rts ; end of line
list_display_unknown_token:
pla
pla
jmp_8 list_is_unknown
+bra list_is_unknown
list_display_token_01:
// Display a 2-byte token - for extended BASIC
; Display a 2-byte token - for extended BASIC
jsr list_fetch_subtoken
// Check if token is known
; Check if token is known
cpx #TK__MAXTOKEN_keywords_01
bcs list_is_unknown
// Now ask for it to be printed
phy_trash_a
; Now ask for it to be printed
+phy_trash_a
jsr print_packed_keyword_01
// FALLTROUGH
; FALLTROUGH
list_display_token_ext_done:
ply_trash_a
+ply_trash_a
// Next iteration
jmp_8 list_not_rem
; Next iteration
+bra list_not_rem
#if !HAS_SMALL_BASIC
!ifndef HAS_SMALL_BASIC {
list_display_token_02:
// Display a 2-byte token - for extended BASIC
; Display a 2-byte token - for extended BASIC
jsr list_fetch_subtoken
// Check if token is known
; Check if token is known
cpx #TK__MAXTOKEN_keywords_02
bcs list_is_unknown
// Now ask for it to be printed
phy_trash_a
; Now ask for it to be printed
+phy_trash_a
jsr print_packed_keyword_02
jmp_8 list_display_token_ext_done
+bra list_display_token_ext_done
}
#endif
#if ROM_LAYOUT_M65
!ifdef CONFIG_MB_M65 {
list_display_token_03:
// Display a 2-byte token - for extended BASIC
; Display a 2-byte token - for extended BASIC
jsr list_fetch_subtoken
// Check if token is known
; Check if token is known
cpx #TK__MAXTOKEN_keywords_03
bcs list_is_unknown
// Now ask for it to be printed
phy_trash_a
; Now ask for it to be printed
+phy_trash_a
jsr print_packed_keyword_03
jmp_8 list_display_token_ext_done
#endif
+bra list_display_token_ext_done
}
list_fetch_subtoken:
// Fetch the sub-token
; Fetch the sub-token
iny
#if ROM_LAYOUT_M65
!ifdef CONFIG_MB_M65 {
jsr peek_via_OLDTXT
#elif CONFIG_MEMORY_MODEL_60K
} else ifdef CONFIG_MEMORY_MODEL_60K {
ldx #<OLDTXT
jsr peek_under_roms
cmp #$00
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
} else ifdef CONFIG_MEMORY_MODEL_46K_OR_50K {
jsr peek_under_roms_via_OLDTXT
cmp #$00
#else // CONFIG_MEMORY_MODEL_38K
} else { ; CONFIG_MEMORY_MODEL_38K
lda (OLDTXT),y
#endif
}
// Subtract $1 from token to get offset in token list
; Subtract $1 from token to get offset in token list
tax
beq list_fetch_subtoken_fail
dex
@@ -280,5 +283,4 @@ list_fetch_subtoken_fail:
dey
jmp list_display_unknown_token
#endif // ROM layout
} ; ROM layout
+12 -12
View File
@@ -1,28 +1,28 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# M65 BASIC_1 #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# M65 BASIC_1 #TAKE
;; #LAYOUT# X16 BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Print configured features and current video system on startup banner
//
;
; Print configured features and current video system on startup banner
;
#if CONFIG_SHOW_FEATURES
!ifdef CONFIG_SHOW_FEATURES {
print_features:
ldx #IDX__STR_FEATURES
jsr print_packed_misc_str
// FALLTROUGH
; FALLTROUGH
print_pal_ntsc:
ldx #IDX__STR_NTSC
lda TVSFLG
beq !+
beq @1
ldx #IDX__STR_PAL
!:
@1:
jmp print_packed_misc_str
#endif // CONFIG_SHOW_FEATURES
} ; CONFIG_SHOW_FEATURES
+21 -21
View File
@@ -1,50 +1,50 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Works similar to $BDCD in original C64 BASIC
//
;
; Works similar to $BDCD in original C64 BASIC
;
print_integer:
// Tested with original C64 ROMs, that it trashes FAC1 too
; Tested with original C64 ROMs, that it trashes FAC1 too
sta FAC1_exponent+1
stx FAC1_exponent+0
// Check for 0
; Check for 0
ora FAC1_exponent+0
bne print_integer_not_0
// Just print '0' and quit
; Just print '0' and quit
lda #$30
jmp JCHROUT
print_integer_not_0:
// Try to find the index of the first digit
; Try to find the index of the first digit
ldy #$04
!:
@1:
jsr print_integer_compare
bcs print_integer_digit
dey
bpl !- // branch always
bpl @1 ; branch always
print_integer_digit:
// Determine digit to print
; Determine digit to print
ldx #$00
!:
@2:
jsr print_integer_compare
bcc !+
bcc @3
// Raise digit, lower the integer
; Raise digit, lower the integer
inx
@@ -56,9 +56,9 @@ print_integer_digit:
sbc print_integer_tab_hi, y
sta FAC1_exponent+1
bcs !- // branch always
!:
// Convert digit in .X to PETSCII in .A and print it out
bcs @2 ; branch always
@3:
; Convert digit in .X to PETSCII in .A and print it out
txa
clc
@@ -66,11 +66,11 @@ print_integer_digit:
jsr JCHROUT
// Check if next iteration is needed
; Check if next iteration is needed
dey
bpl print_integer_digit
// The end
; The end
rts
+8 -8
View File
@@ -1,18 +1,18 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Helper compare subroutine for 'print_integer'
//
;
; Helper compare subroutine for 'print_integer'
;
print_integer_compare:
lda FAC1_exponent+1
cmp print_integer_tab_hi, y
bne !+
bne @1
lda FAC1_exponent+0
cmp print_integer_tab_lo, y
!:
@1:
rts
+11 -11
View File
@@ -1,15 +1,15 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Helper power of 10s table (high buytes) for 'print_integer'
//
;
; Helper power of 10s table (high buytes) for 'print_integer'
;
print_integer_tab_hi:
.byte >1
.byte >10
.byte >100
.byte >1000
.byte >10000
!byte >1
!byte >10
!byte >100
!byte >1000
!byte >10000
+11 -11
View File
@@ -1,15 +1,15 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Helper power of 10s table (low buytes) for 'print_integer'
//
;
; Helper power of 10s table (low buytes) for 'print_integer'
;
print_integer_tab_lo:
.byte <1
.byte <10
.byte <100
.byte <1000
.byte <10000
!byte <1
!byte <10
!byte <100
!byte <1000
!byte <10000
+20 -22
View File
@@ -1,43 +1,43 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# M65 BASIC_1 #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# M65 BASIC_1 #TAKE
;; #LAYOUT# X16 BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
#if CONFIG_COMPRESSION_LVL_2
!ifdef CONFIG_COMPRESSION_LVL_2 {
print_packed_error: // .X - error string index
print_packed_error: ; .X - error string index
lda #<packed_dict_errors
ldy #>packed_dict_errors
bne print_dict_packed_string // branch always
bne print_dict_packed_string ; branch always
print_packed_misc_str: // .X - misc string index
print_packed_misc_str: ; .X - misc string index
lda #<packed_dict_misc
ldy #>packed_dict_misc
// FALLTROUGH
; FALLTROUGH
print_dict_packed_string:
// Search for the packed string on the list
; Search for the packed string on the list
jsr print_packed_search
ldy #$00
!:
// At this point FRESPC contains a pointer to the string to display
// Fetch a byte-code
@1:
; At this point FRESPC contains a pointer to the string to display
; Fetch a byte-code
lda (FRESPC), y
beq print_dict_packed_string_end // branch if everything displayed
beq print_dict_packed_string_end ; branch if everything displayed
tax
dex
// Call 'print_freq_packed_string' - but preserve all the data needed to progress further
; Call 'print_freq_packed_string' - but preserve all the data needed to progress further
phy_trash_a
+phy_trash_a
lda FRESPC+0
pha
lda FRESPC+1
@@ -52,16 +52,14 @@ print_dict_packed_string:
sta FRESPC+1
pla
sta FRESPC+0
ply_trash_a
+ply_trash_a
// Next iteration
; Next iteration
iny
bne !- // branch always
bne @1 ; branch always
print_dict_packed_string_end:
rts
#endif
}
+60 -59
View File
@@ -1,125 +1,122 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# M65 * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# M65 * #TAKE
;; #LAYOUT# X16 BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
// This routine prints strings that have been packed using the 'generate_trings' tool.
// The general idea is to save space in the ROM.
; This routine prints strings that have been packed using the 'generate_trings' tool.
; The general idea is to save space in the ROM.
#if (ROM_LAYOUT_M65 && SEGMENT_BASIC_0)
!ifdef SEGMENT_M65_BASIC_0 {
print_packed_error:
jsr map_BASIC_1
jsr_ind VB1__print_packed_error
jmp map_NORMAL
jsr map_BASIC_1
jsr (VB1__print_packed_error)
jmp map_NORMAL
print_packed_misc_str:
jsr map_BASIC_1
jsr_ind VB1__print_packed_misc_str
jmp map_NORMAL
jsr map_BASIC_1
jsr (VB1__print_packed_misc_str)
jmp map_NORMAL
#else
} else {
#if !CONFIG_COMPRESSION_LVL_2
!ifndef CONFIG_COMPRESSION_LVL_2 {
print_packed_error: // .X - error string index
print_packed_error: ; .X - error string index
lda #<packed_freq_errors
ldy #>packed_freq_errors
bne print_freq_packed_string // branch always
bne print_freq_packed_string ; branch always
print_packed_misc_str: // .X - misc string index
print_packed_misc_str: ; .X - misc string index
lda #<packed_freq_misc
ldy #>packed_freq_misc
bne print_freq_packed_string // branch always
bne print_freq_packed_string ; branch always
}
#endif
print_packed_keyword_01: // .X - token number
print_packed_keyword_01: ; .X - token number
lda #<packed_freq_keywords_01
ldy #>packed_freq_keywords_01
bne print_freq_packed_string // branch always
bne print_freq_packed_string ; branch always
#if !HAS_SMALL_BASIC
!ifndef HAS_SMALL_BASIC {
print_packed_keyword_02: // .X - token number
print_packed_keyword_02: ; .X - token number
lda #<packed_freq_keywords_02
ldy #>packed_freq_keywords_02
bne print_freq_packed_string // branch always
bne print_freq_packed_string ; branch always
}
#endif
!ifdef CONFIG_MB_M65 {
#if ROM_LAYOUT_M65
print_packed_keyword_03: // .X - token number
print_packed_keyword_03: ; .X - token number
lda #<packed_freq_keywords_03
ldy #>packed_freq_keywords_03
bne print_freq_packed_string // branch always
bne print_freq_packed_string ; branch always
}
#endif
print_packed_keyword_V2: // .X - token number
print_packed_keyword_V2: ; .X - token number
lda #<packed_freq_keywords_V2
ldy #>packed_freq_keywords_V2
// FALLTROUGH
; FALLTROUGH
print_freq_packed_string: // not to be used directly XXX rename to print_packed_string
print_freq_packed_string: ; not to be used directly XXX rename to print_packed_string
// Search for the packed string on the list
; Search for the packed string on the list
jsr print_packed_search
// At this point FRESPC contains a pointer to the string to display
// and we should start from the lower nibble
; At this point FRESPC contains a pointer to the string to display
; and we should start from the lower nibble
ldy #$00
// FALLTROUGH
; FALLTROUGH
print_freq_packed_string_nibble_lo:
// Get the low nibble and check for the end of packed string
; Get the low nibble and check for the end of packed string
lda (FRESPC), y
and #$0F
beq print_freq_packed_string_end
// Not the end - check if this is a common character, encoded by a single nibble
; Not the end - check if this is a common character, encoded by a single nibble
cmp #$0F
beq print_freq_packed_string_3n_split
// Character is encoded by a single nibble - fetch it and display
; Character is encoded by a single nibble - fetch it and display
tax
lda packed_as_1n-1, x
jsr JCHROUT // preserves .Y
jsr JCHROUT ; preserves .Y
// FALLTROUGH
; FALLTROUGH
print_freq_packed_string_nibble_hi:
// Get the high nibble and check for the end of packed string
; Get the high nibble and check for the end of packed string
lda (FRESPC), y
and #$F0
beq print_freq_packed_string_end
// Not the end - check if this is a common character, encoded by a single nibble
; Not the end - check if this is a common character, encoded by a single nibble
cmp #$F0
beq print_freq_packed_string_3n_single
// Character is encoded by a single nibble - fetch it and display
; Character is encoded by a single nibble - fetch it and display
lsr
lsr
@@ -128,28 +125,32 @@ print_freq_packed_string_nibble_hi:
tax
lda packed_as_1n-1, x
jmp_8 !+
+bra print_freq_packed_string_3n_single_cont
print_freq_packed_string_3n_single:
// Character is encoded using 3 nibbles (1st is a mark, already interpreted)
; Character is encoded using 3 nibbles (1st is a mark, already interpreted)
iny
lda (FRESPC), y
tax
lda packed_as_3n-1, x
!:
jsr JCHROUT // preserves .Y
// Advance to next nibble
; FALLTROUGH
print_freq_packed_string_3n_single_cont:
jsr JCHROUT ; preserves .Y
; Advance to next nibble
iny
bne print_freq_packed_string_nibble_lo // branch always
bne print_freq_packed_string_nibble_lo ; branch always
print_freq_packed_string_3n_split:
// Character is encoded using 3 nibbles (1st is a mark, already interpreted),
// but the 2 remaining nibbles are in two neighbour bytes; use a stack to combine them
; Character is encoded using 3 nibbles (1st is a mark, already interpreted),
; but the 2 remaining nibbles are in two neighbour bytes; use a stack to combine them
lda (FRESPC), y
and #$F0
@@ -163,11 +164,11 @@ print_freq_packed_string_3n_split:
clc
adc STACK, x
txs // one cycle faster than PLA
txs ; one cycle faster than PLA
tax
lda packed_as_3n-1, x
jsr JCHROUT // preserves .Y
jsr JCHROUT ; preserves .Y
jmp print_freq_packed_string_nibble_hi
@@ -176,4 +177,4 @@ print_freq_packed_string_end:
rts
#endif // ROM layout
} ; ROM layout
+13 -13
View File
@@ -1,31 +1,31 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# M65 BASIC_1 #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# M65 BASIC_1 #TAKE
;; #LAYOUT# X16 BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
print_packed_search:
// First store the initial address of the packed strings list
; First store the initial address of the packed strings list
sta FRESPC+0
sty FRESPC+1
// Now find the address of the string to print out
// The implementation assumes no packed string is longer than 255 bytes, including trailing zero
!:
; Now find the address of the string to print out
; The implementation assumes no packed string is longer than 255 bytes, including trailing zero
@1:
cpx #$00
beq print_packed_done // branch if no need to advance anymore
beq print_packed_done ; branch if no need to advance anymore
dex
ldy #$00
!:
@2:
lda (FRESPC), y
iny
cmp #$00
bne !- // branch if not the end of packed string
bne @2 ; branch if not the end of packed string
clc // advance FREESPC pointer
clc ; advance FREESPC pointer
tya
adc FRESPC+0
sta FRESPC+0
@@ -33,7 +33,7 @@ print_packed_search:
adc FRESPC+1
sta FRESPC+1
jmp !--
+bra @1
print_packed_done: