implemented MERGE command

This commit is contained in:
FeralChild64 committed 2020-06-22 15:33:48 +02:00
1 parent 6639ac5609
commit c3335393c2
6 files changed
+105 -32

No files matched your search

@@ -50,6 +50,9 @@ cmd_load_got_params: // input for tape wedge
ldy TXTTAB+1
ldx TXTTAB+0
cmd_load_loadmerge: // entry point for 'cmd_merge'
lda VERCKB // LOAD or VERIFY
jsr JLOAD
-8
View File
@@ -1,8 +0,0 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
cmd_bload:
jmp do_NOT_IMPLEMENTED_error // XXX implement the command
@@ -0,0 +1,41 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
cmd_bverify:
// LOAD and VERIFY are very similar, from BASIC perspective there is almost no difference;
// just different parameter passed to Kernal and different error message in case of failure
lda #$01 // mark operation as VERIFY
skip_2_bytes_trash_nvz
cmd_bload:
lda #$00 // mark operation as LOAD
sta VERCKB
// Set default device and secondary address; channel is not important now
jsr select_device
ldy #$00 // secondary address 0 - it has to be loaded precisely where we want
jsr JSETFLS
// Fetch the file name
jsr fetch_filename
bcc !+
// No filename supplied - this should only be allowed for tape (device number below 8)
lda FA
and #%11111000
bne_16 do_MISSING_FILENAME_error
lda #$00
sta FNLEN
!:
// XXX finish the implementation
jmp do_NOT_IMPLEMENTED_error
@@ -1,8 +0,0 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
cmd_bverify:
jmp do_NOT_IMPLEMENTED_error // XXX implement the command
+43 -1
View File
@@ -5,4 +5,46 @@
cmd_merge:
jmp do_NOT_IMPLEMENTED_error // XXX implement the command
lda #$00 // mark operation as LOAD
sta VERCKB
// Set default device and secondary address; channel is not important now
jsr select_device
ldy #$00 // secondary address 0 - it has to be loaded precisely where we want
jsr JSETFLS
// Fetch the file name
jsr fetch_filename
bcc !+
// No filename supplied - this should only be allowed for tape (device number below 8)
lda FA
and #%11111000
bne_16 do_MISSING_FILENAME_error
lda #$00
sta FNLEN
!:
// Fetch device number
jsr fetch_device_secondary_uint8
bcs !+
sta FA
!:
// Perform loading - just for a different address
sec
lda VARTAB+0
sbc #$02
sta VARTAB+0
tax
bcs !+
dec VARTAB+1
!:
ldy VARTAB+1
jmp cmd_load_loadmerge // XXX check variable handling (VARTAB) after failure to load
+18 -15
View File
@@ -11,15 +11,9 @@ fetch_device_secondary:
// Fetch the device number
jsr injest_comma
bcs fetch_secondary
jsr fetch_device_secondary_uint8
bcs fetch_device_secondary_done
jsr injest_spaces
jsr basic_parse_line_number
lda LINNUM+1
bne_16 do_ILLEGAL_QUANTITY_error
lda LINNUM+0
sta FA
// FALLTROUGH
@@ -28,15 +22,9 @@ fetch_secondary:
// Fetch secondary address
jsr injest_comma
jsr fetch_device_secondary_uint8
bcs fetch_device_secondary_done
jsr injest_spaces
jsr basic_parse_line_number
lda LINNUM+1
bne_16 do_ILLEGAL_QUANTITY_error
lda LINNUM+0
sta SA
// FALLTROUGH
@@ -44,3 +32,18 @@ fetch_secondary:
fetch_device_secondary_done:
rts
fetch_device_secondary_uint8: // also called by 'cmd_merge'
jsr injest_comma
bcs !+
jsr injest_spaces
jsr basic_parse_line_number
lda LINNUM+1
bne_16 do_ILLEGAL_QUANTITY_error
lda LINNUM+0
clc
!:
rts