diff --git a/Makefile b/Makefile index d86dc743..b3cbdd37 100644 --- a/Makefile +++ b/Makefile @@ -68,52 +68,56 @@ SRCDIR_DOS_M65 = $(SRCDIR_COMMON) \ SRCDIR_MON_M65 = $(SRCDIR_COMMON) \ src/mon_m65 -SRC_BASIC = $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s)) -SRC_KERNAL = $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) -SRC_DOS_M65 = $(foreach dir,$(SRCDIR_DOS_M65),$(wildcard $(dir)/*.s)) -SRC_MON_M65 = $(foreach dir,$(SRCDIR_MON_M65),$(wildcard $(dir)/*.s)) -SRC_TOOLS = $(wildcard tools/*.c,tools/*.cc) +SRCDIR_ZVM_M65 = $(SRCDIR_COMMON) \ + src/zvm_m65 -DIR_ACME = assembler/acme/src -HDR_ACME = $(filter-out $(wildcard $(DIR_ACME)/_*.h),$(wildcard $(DIR_ACME)/*.h)) -SRC_ACME = $(DIR_ACME)/acme.c $(DIR_ACME)/platform.c $(DIR_ACME)/alu.c $(DIR_ACME)/typesystem.c \ - $(DIR_ACME)/cliargs.c $(DIR_ACME)/global.c $(DIR_ACME)/output.c $(DIR_ACME)/flow.c \ - $(DIR_ACME)/macro.c $(DIR_ACME)/cpu.c $(DIR_ACME)/encoding.c $(DIR_ACME)/pseudoopcodes.c \ - $(DIR_ACME)/dynabuf.c $(DIR_ACME)/mnemo.c $(DIR_ACME)/input.c $(DIR_ACME)/section.c \ - $(DIR_ACME)/symbol.c $(DIR_ACME)/tree.c +SRC_BASIC = $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s)) +SRC_KERNAL = $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) +SRC_DOS_M65 = $(foreach dir,$(SRCDIR_DOS_M65),$(wildcard $(dir)/*.s)) +SRC_MON_M65 = $(foreach dir,$(SRCDIR_MON_M65),$(wildcard $(dir)/*.s)) +SRC_ZVM_M65 = $(foreach dir,$(SRCDIR_ZVM_M65),$(wildcard $(dir)/*.s)) +SRC_TOOLS = $(wildcard tools/*.c,tools/*.cc) -CRT_BIN_LIST = assets/cartridge/header-cart.bin \ - assets/cartridge/header-seg0.bin \ - assets/cartridge/header-seg1.bin \ - assets/cartridge/header-seg2.bin \ - assets/cartridge/header-seg3.bin +DIR_ACME = assembler/acme/src +HDR_ACME = $(filter-out $(wildcard $(DIR_ACME)/_*.h),$(wildcard $(DIR_ACME)/*.h)) +SRC_ACME = $(DIR_ACME)/acme.c $(DIR_ACME)/platform.c $(DIR_ACME)/alu.c $(DIR_ACME)/typesystem.c \ + $(DIR_ACME)/cliargs.c $(DIR_ACME)/global.c $(DIR_ACME)/output.c $(DIR_ACME)/flow.c \ + $(DIR_ACME)/macro.c $(DIR_ACME)/cpu.c $(DIR_ACME)/encoding.c $(DIR_ACME)/pseudoopcodes.c \ + $(DIR_ACME)/dynabuf.c $(DIR_ACME)/mnemo.c $(DIR_ACME)/input.c $(DIR_ACME)/section.c \ + $(DIR_ACME)/symbol.c $(DIR_ACME)/tree.c + +CRT_BIN_LIST = assets/cartridge/header-cart.bin \ + assets/cartridge/header-seg0.bin \ + assets/cartridge/header-seg1.bin \ + assets/cartridge/header-seg2.bin \ + assets/cartridge/header-seg3.bin # Generated files -GEN_BASIC = build/,generated/,float_constants.s -GEN_KERNAL = +GEN_BASIC = build/,generated/,float_constants.s +GEN_KERNAL = # List of build directories -DIR_CUS = build/target_custom -DIR_GEN = build/target_generic -DIR_GENCRT = build/target_generic_crt -DIR_TST = build/target_testing -DIR_M65 = build/target_mega65 -DIR_U64 = build/target_ultimate64 -DIR_U64CRT = build/target_ultimate64_crt -DIR_X16 = build/target_cx16 +DIR_CUS = build/target_custom +DIR_GEN = build/target_generic +DIR_GENCRT = build/target_generic_crt +DIR_TST = build/target_testing +DIR_M65 = build/target_mega65 +DIR_U64 = build/target_ultimate64 +DIR_U64CRT = build/target_ultimate64_crt +DIR_X16 = build/target_cx16 # List of config files -CFG_CUS = src/,,config_custom.s -CFG_GEN = src/,,config_generic.s -CFG_GENCRT = src/,,config_generic_crt.s -CFG_TST = src/,,config_testing.s -CFG_M65 = src/,,config_mega65.s -CFG_U64 = src/,,config_ultimate64.s -CFG_X16 = src/,,config_cx16.s -CFG_U64CRT = src/,,config_ultimate64_crt.s +CFG_CUS = src/,,config_custom.s +CFG_GEN = src/,,config_generic.s +CFG_GENCRT = src/,,config_generic_crt.s +CFG_TST = src/,,config_testing.s +CFG_M65 = src/,,config_mega65.s +CFG_U64 = src/,,config_ultimate64.s +CFG_X16 = src/,,config_cx16.s +CFG_U64CRT = src/,,config_ultimate64_crt.s # List of files with generated strings @@ -128,10 +132,11 @@ GEN_STR_X16 = $(DIR_X16)/,generated/,packed_strings.s # Dependencies - helper variables -DEP_BASIC = $(SRC_BASIC) $(SRCDIR_BASIC) $(GEN_BASIC) -DEP_KERNAL = $(SRC_KERNAL) $(SRCDIR_KERNAL) $(GEN_KERNAL) -DEP_DOS_M65 = $(SRC_DOS_M65) $(SRCDIR_DOS_M65) -DEP_MON_M65 = $(SRC_MON_M65) $(SRCDIR_MON_M65) +DEP_BASIC = $(SRC_BASIC) $(SRCDIR_BASIC) $(GEN_BASIC) +DEP_KERNAL = $(SRC_KERNAL) $(SRCDIR_KERNAL) $(GEN_KERNAL) +DEP_DOS_M65 = $(SRC_DOS_M65) $(SRCDIR_DOS_M65) +DEP_MON_M65 = $(SRC_MON_M65) $(SRCDIR_MON_M65) +DEP_ZVM_M65 = $(SRC_ZVM_M65) $(SRCDIR_ZVM_M65) # List of tools @@ -210,7 +215,8 @@ SEG_LIST_M65 = $(DIR_M65)/basic.seg_0 \ $(DIR_M65)/kernal.seg_C \ $(DIR_M65)/kernal.seg_1 \ $(DIR_M65)/dos.seg_1 \ - $(DIR_M65)/mon.seg_1 + $(DIR_M65)/mon.seg_1 \ + $(DIR_M65)/zvm.seg_1 SEG_LIST_X16 = $(DIR_X16)/basic.seg_0 \ $(DIR_X16)/basic.seg_1 \ @@ -368,7 +374,9 @@ $(DIR_M65)/kernal.seg_1 $(DIR_M65)/KERNAL_1_combined.vs $(DIR_M65)/KERNAL_1_comb $(DIR_M65)/dos.seg_1 $(DIR_M65)/DOS_1_combined.vs $(DIR_M65)/DOS_1_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_DOS_M65) $(CFG_M65) $(DIR_M65)/mon.seg_1 $(DIR_M65)/MON_1_combined.vs $(DIR_M65)/MON_1_combined.sym: \ - $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_MON_M65) $(CFG_M65) + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_MON_M65) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym +$(DIR_M65)/zvm.seg_1 $(DIR_M65)/ZVM_1_combined.vs $(DIR_M65)/ZVM_1_combined.sym: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_ZVM_M65) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym $(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1_combined.vs $(DIR_X16)/BASIC_1_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(GEN_STR_X16) $(DIR_X16)/KERNAL_0_combined.sym $(DIR_X16)/BASIC_0_combined.sym @@ -502,7 +510,7 @@ $(DIR_U64CRT)/kernal.seg_1 $(DIR_U64CRT)/KERNAL_1_combined.vs $(DIR_U64CRT)/KERN @rm -f $@* $(DIR_U64CRT)/kernal.seg_1 $(DIR_U64CRT)/KERNAL_1* @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r CRT -s KERNAL_1 -i KERNAL_1-ultimate64-crt -o kernal.seg_1 -d $(DIR_U64CRT) -l 8000 -h 9fff $(CFG_U64CRT) $(GEN_STR_U64CRT) $(SRCDIR_KERNAL) $(GEN_KERNAL) -# Rules - BASIC, KERNAL, DOS and MON intermediate files, for MEGA65 +# Rules - BASIC, KERNAL, DOS, MON, and ZVM intermediate files, for MEGA65 $(DIR_M65)/OUTB_0.BIN $(DIR_M65)/BASIC_0_combined.vs $(DIR_M65)/BASIC_0_combined.sym: @mkdir -p $(DIR_M65) @@ -539,6 +547,11 @@ $(DIR_M65)/mon.seg_1 $(DIR_M65)/MON_1_combined.vs $(DIR_M65)/MON_1_combined.sym: @rm -f $@* $(DIR_M65)/mon.seg_1 $(DIR_M65)/MON_1* @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s MON_1 -i MON_1-mega65 -o mon.seg_1 -d $(DIR_M65) -l 4000 -h 5fff $(CFG_M65) $(SRCDIR_MON_M65) +$(DIR_M65)/zvm.seg_1 $(DIR_M65)/ZVM_1_combined.vs $(DIR_M65)/ZVM_1_combined.sym: + @mkdir -p $(DIR_M65) + @rm -f $@* $(DIR_M65)/zvm.seg_1 $(DIR_M65)/ZVM_1* + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s ZVM_1 -i ZVM_1-mega65 -o zvm.seg_1 -d $(DIR_M65) -l 2000 -h 7fff $(CFG_M65) $(SRCDIR_ZVM_M65) + # Rules - BASIC and KERNAL intermediate files, for Commander X16 $(DIR_X16)/OUTB_0.BIN $(DIR_X16)/BASIC_0_combined.vs $(DIR_X16)/BASIC_0_combined.sym: @@ -720,9 +733,10 @@ $(TARGET_U64CRT_X): $(SEG_LIST_U64CRT) $(CRT_BIN_LIST) build/padding_8_KB # $0:$D000 - 4 KB - legacy mode chargen # $0:$E000 - 8 KB - KERNAL segment 0 # $1:$0000 - 8 KB - Machine Language MONITOR -# $1:$2000 - 56 KB - unused for now, padding +# $1:$2000 - 24 KB - Z80 Virtual Machine for CP/M +# $1:$8000 - 32 KB - unused for now, padding; most likely will be used for BASIC extensions -$(TARGET_M65_x_ORF) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/padding_16_KB build/padding_4_KB $(TARGET_CHR_ORF) build/chargen_openroms.patched $(TARGET_CHR_PXL) build/chargen_pxlfont.patched +$(TARGET_M65_x_ORF) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/padding_16_KB $(TARGET_CHR_ORF) build/chargen_openroms.patched $(TARGET_CHR_PXL) build/chargen_pxlfont.patched @echo @echo @echo @@ -738,8 +752,7 @@ $(TARGET_M65_x_ORF) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/padding_16_KB bui @cat $(TARGET_CHR_ORF) >> $(TARGET_M65_x_ORF) @cat $(DIR_M65)/kernal.seg_0 >> $(TARGET_M65_x_ORF) @cat $(DIR_M65)/mon.seg_1 >> $(TARGET_M65_x_ORF) - @cat build/padding_8_KB >> $(TARGET_M65_x_ORF) - @cat build/padding_16_KB >> $(TARGET_M65_x_ORF) + @cat $(DIR_M65)/zvm.seg_1 >> $(TARGET_M65_x_ORF) @cat build/padding_16_KB >> $(TARGET_M65_x_ORF) @cat build/padding_16_KB >> $(TARGET_M65_x_ORF) @echo @@ -757,8 +770,7 @@ $(TARGET_M65_x_ORF) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/padding_16_KB bui @cat $(TARGET_CHR_PXL) >> $(TARGET_M65_x_PXL) @cat $(DIR_M65)/kernal.seg_0 >> $(TARGET_M65_x_PXL) @cat $(DIR_M65)/mon.seg_1 >> $(TARGET_M65_x_PXL) - @cat build/padding_8_KB >> $(TARGET_M65_x_PXL) - @cat build/padding_16_KB >> $(TARGET_M65_x_PXL) + @cat $(DIR_M65)/zvm.seg_1 >> $(TARGET_M65_x_PXL) @cat build/padding_16_KB >> $(TARGET_M65_x_PXL) @cat build/padding_16_KB >> $(TARGET_M65_x_PXL) @echo diff --git a/src/aliases/,aliases_ram_lowmem_m65.s b/src/aliases/,aliases_ram_lowmem_m65.s index ee955201..b4b050ee 100644 --- a/src/aliases/,aliases_ram_lowmem_m65.s +++ b/src/aliases/,aliases_ram_lowmem_m65.s @@ -35,7 +35,18 @@ ; $400-$57F - reserved for BASIC - ; $400-$57F -- UNUSED -- reserved for BASIC + ; $400-$54F -- UNUSED -- reserved for BASIC + + ; $558-$57F - reserved for MONITOR + + !addr MON_XVEC = $550 ; $550-$551 monitor exit vector + !addr MON_Ix_Mne = $552 ; index to mnemonics table + !addr MON_Op_Mne = $553 ; 3 bytes for mnemonic + !addr MON_Op_Ix = $554 ; type of constant + !addr MON_Op_Len = $555 ; length of operand + !addr MON_Disk_Track = $556 ; logical track 1 -> 255 + !addr MON_Disk_Sector = $557 ; logical sector 0 -> 255 + !addr MON_DATA = $558 ; $558-$57F 40 bytes, buffer for hunt and filename ; $580-$5FF - reserved for KERNAL diff --git a/src/kernal/board_m65/mega65_proxies_monitor.s b/src/kernal/board_m65/mega65_proxies_monitor.s index 6cb1869c..5329b781 100644 --- a/src/kernal/board_m65/mega65_proxies_monitor.s +++ b/src/kernal/board_m65/mega65_proxies_monitor.s @@ -2,7 +2,7 @@ ;; #LAYOUT# * * #IGNORE ; -; Proxies for calling MEGA65 segment KERNAL_0 routines from KERNAL_1 +; Proxies for calling MEGA65 segment KERNAL_0 routines from MON_1 ; @@ -22,3 +22,47 @@ proxy_M1_CHROUT: proxy_M1_end: jmp map_MON_1 + + +; Routines below typicaly do not change mapping - but it is still possible they'll do + + +proxy_M1_SECOND: + + jsr SECOND + bra proxy_M1_end + +proxy_M1_TKSA: + + jsr TKSA + bra proxy_M1_end + +proxy_M1_ACPTR: + + jsr ACPTR + bra proxy_M1_end + +proxy_M1_CIOUT: + + jsr CIOUT + bra proxy_M1_end + +proxy_M1_UNTLK: + + jsr UNTLK + bra proxy_M1_end + +proxy_M1_UNLSN: + + jsr UNLSN + bra proxy_M1_end + +proxy_M1_LISTEN: + + jsr LISTEN + bra proxy_M1_end + +proxy_M1_TALK: + + jsr TALK + bra proxy_M1_end diff --git a/src/mon_m65/,imports_monitor.s b/src/mon_m65/,imports_monitor.s index 3c916417..139f9d09 100644 --- a/src/mon_m65/,imports_monitor.s +++ b/src/mon_m65/,imports_monitor.s @@ -4,7 +4,19 @@ ; Definitions for calling MEGA65 segment KERNAL_0 routines from MON_1 ; +;; #ALIAS# SETMSG = KERNAL_0.SETMSG +;; #ALIAS# STOP = KERNAL_0.STOP + ;; #ALIAS# map_NORMAL = KERNAL_0.map_NORMAL - +;; #ALIAS# map_MON_1 = KERNAL_0.map_MON_1 + ;; #ALIAS# CHRIN = KERNAL_0.proxy_M1_CHRIN ;; #ALIAS# CHROUT = KERNAL_0.proxy_M1_CHROUT +;; #ALIAS# SECOND = KERNAL_0.proxy_M1_SECOND +;; #ALIAS# TKSA = KERNAL_0.proxy_M1_TKSA +;; #ALIAS# ACPTR = KERNAL_0.proxy_M1_ACPTR +;; #ALIAS# CIOUT = KERNAL_0.proxy_M1_CIOUT +;; #ALIAS# UNTLK = KERNAL_0.proxy_M1_UNTLK +;; #ALIAS# UNLSN = KERNAL_0.proxy_M1_UNLSN +;; #ALIAS# LISTEN = KERNAL_0.proxy_M1_LISTEN +;; #ALIAS# TALK = KERNAL_0.proxy_M1_TALK diff --git a/src/mon_m65/bsmon.s b/src/mon_m65/bsmon.s index 5dda8ab3..4c81e588 100644 --- a/src/mon_m65/bsmon.s +++ b/src/mon_m65/bsmon.s @@ -58,31 +58,10 @@ !addr Dig_Cnt = $6e !addr Buf_Index = $6f -!addr MODE_80 = $d7 ; 80 column / 40 volumn flag +!addr MODE_80 = $d7 ; 80 column / 40 volumn flag ; XXX add routine to detect this -!addr X_Vector = $400 ; exit vector (ROM version dependent) -!addr Ix_Mne = $402 ; index to mnemonics table -!addr Op_Mne = $403 ; 3 bytes for mnemonic -!addr Op_Ix = $406 ; type of constant -!addr Op_Len = $407 ; length of operand -!addr Disk_Unit = $408 ; unit = device -!addr Disk_Track = $409 ; logical track 1 -> 255 -!addr Disk_Sector = $40A ; logical sector 0 -> 255 -!addr Disk_Status = $40B ; BCD value of status - -!addr Mon_Data = $410 ; 40 bytes, buffer for hunt and filename -!addr Disk_Msg = $440 ; 40 bytes, disk status as text message - -!addr SETMSG = $ff90 -!addr SECOND = $ff93 -!addr TKSA = $ff96 -!addr ACPTR = $ffa5 -!addr CIOUT = $ffa8 -!addr UNTALK = $ffab -!addr UNLSN = $ffae -!addr LISTEN = $ffb1 -!addr TALK = $ffb4 -!addr STOP = $ffe1 +!addr Disk_Status = $40A ; BCD value of status +!addr Disk_Msg = $410 ; 40 bytes, disk status as text message ; XXX get rid of this buffer ; ******* @@ -133,9 +112,9 @@ Mon_Call LDA #map_NORMAL STA PCL - STA X_Vector + STA MON_XVEC STX PCH - STX X_Vector+1 + STX MON_XVEC+1 ; ******* Mon_Start @@ -315,7 +294,7 @@ Jump_Table Mon_Exit ; ****** - JMP (X_Vector) + JMP (MON_XVEC) ; ******* LAC_To_PC @@ -770,7 +749,7 @@ Mon_Hunt CMP #0 LBEQ Mon_Error ; null string -@lpstr STA Mon_Data,Y +@lpstr STA MON_DATA,Y INY JSR Get_Char BEQ @hunt @@ -780,7 +759,7 @@ Mon_Hunt @bin JSR Got_LAC @lpbin LDA Long_AC - STA Mon_Data,Y + STA MON_DATA,Y INY JSR Get_LAC BCS @hunt @@ -792,7 +771,7 @@ Mon_Hunt @lpstart LDY #0 @lpins JSR Fetch - CMP Mon_Data,Y + CMP MON_DATA,Y BNE @next INY CPY Long_DA @@ -821,9 +800,9 @@ Load_Save ; STY FNLEN ; STY FNBANK ; STY IOSTATUS - ; LDA #>Mon_Data + ; LDA #>MON_DATA ; STA FNADR+1 - ; LDA # not 2nd. char CMP #'B' BNE @labb ; 2nd. char != 'B' - LDZ Op_Mne + LDZ MON_Op_Mne CPZ #'L' BNE @labb ; 1st. Char != 'L' SMB6 Op_Flag ; flag long branch DEX ; skip 'L' -@labb STA Op_Mne,X ; next mne character +@labb STA MON_Op_Mne,X ; next mne character INX CPX #3 BNE @getin ; encode 3 letter mnemonic -@lpenc LDA Op_Mne-1,X +@lpenc LDA MON_Op_Mne-1,X SEC SBC #$3f ; offset LDY #5 ; 5 bit code @@ -973,7 +952,7 @@ Mon_Assemble BPL @lpfind JMP Mon_Error -@found STX Ix_Mne +@found STX MON_Ix_Mne ; find 1st. opcode for this mnemonic @@ -1021,10 +1000,10 @@ Mon_Assemble LDA Long_AC+1 BNE @labf ; high byte not zero DEY ; Y=1 byte operand -@labf LDX Op_Ix ; X = operand value # +@labf LDX MON_Op_Ix ; X = operand value # TYA ; A = 1:byte or 2:word - STA Op_Len,X ; store operand length - INC Op_Ix ; ++index to operand value + STA MON_Op_Len,X ; store operand length + INC MON_Op_Ix ; ++index to operand value TXA ; A = current index BNE @labg ; -> at 2nd. byte JSR LAC_To_LCT ; Long_CT = 1st. operand @@ -1067,7 +1046,7 @@ Mon_Assemble @comma CMP #',' BNE @stack - LDA Op_Ix ; operand value # + LDA MON_Op_Ix ; operand value # BEQ @error LDX #4 ; outside comma LDA Mode_Flags @@ -1101,7 +1080,7 @@ Mon_Assemble @rbra CMP #']' BNE @right BBR5 Op_Flag,@error - LDA Op_Ix + LDA MON_Op_Ix LBEQ Mon_Error ; no value LDA Mode_Flags CMP #$40 ; ( @@ -1115,7 +1094,7 @@ Mon_Assemble @right CMP #')' BNE @X - LDA Op_Ix + LDA MON_Op_Ix LBEQ Mon_Error ; no value LDA Mode_Flags CMP #$40 ; ( @@ -1129,7 +1108,7 @@ Mon_Assemble @X CMP #'X' BNE @Y - LDA Op_Ix + LDA MON_Op_Ix LBEQ Mon_Error LDA Mode_Flags CMP #$60 @@ -1143,7 +1122,7 @@ Mon_Assemble @Y CMP #'Y' BNE @Z - LDA Op_Ix + LDA MON_Op_Ix LBEQ Mon_Error LDA Mode_Flags CMP #$4c ; ($nn), @@ -1159,7 +1138,7 @@ Mon_Assemble @Z CMP #'Z' LBNE Mon_Error - LDA Op_Ix + LDA MON_Op_Ix LBEQ Mon_Error LDA Mode_Flags CMP #$4c ; $nn, @@ -1169,11 +1148,11 @@ Mon_Assemble ; BBR BBS RMB SMB two operands -@adjust LDA Ix_Mne - LDX Op_Ix ; # if values +@adjust LDA MON_Ix_Mne + LDX MON_Op_Ix ; # if values BEQ @match ; -> no operand DEX - BEQ @one ; -> one operand + BEQ @one ; -> one operand DEX LBNE Mon_Error ; -> error if more than 2 CMP #5 ; BBR @@ -1223,16 +1202,16 @@ Mon_Assemble @match JSR Mode_Index @lpmatch JSR Match_Mode BEQ @okmat - LDA Op_Len + LDA MON_Op_Len LBEQ Mon_Error LDA Mode_Flags LBMI Mon_Error AND #%00111111 STA Mode_Flags - INC Op_Len + INC MON_Op_Len JSR Size_To_Mode BRA @lpmatch -@okmat LDY Op_Len +@okmat LDY MON_Op_Len TXA ; store instruction bytes @@ -1350,7 +1329,7 @@ Match_Mode @next INX ; next opcode BEQ @error LDY MNE_Index,X - CPY Ix_Mne ; same mnemonic ? + CPY MON_Ix_Mne ; same mnemonic ? BEQ @loop ; -> compare again BRA @next @@ -1376,7 +1355,7 @@ Mode_Index Size_To_Mode ; ********** - LDA Op_Len + LDA MON_Op_Len LSR ROR ROR @@ -2214,7 +2193,7 @@ Get_Disk_Status BCS @loop LDA #0 STA Disk_Msg,Y - JSR UNTALK + JSR UNTLK LDA Disk_Status RTS @@ -2256,7 +2235,7 @@ DOS_U ; XXX connect it somehow to command list LBCC Mon_Error CMP #'3' ; U2: write LBCS Mon_Error - STA Mon_Data+1 ; U type + STA MON_DATA+1 ; U type INC Buf_Index JSR Get_LAC LBCS Mon_Error @@ -2265,12 +2244,12 @@ DOS_U ; XXX connect it somehow to command list JSR Get_LAC LBCS Mon_Error LDA Long_AC - STA Disk_Track + STA MON_Disk_Track JSR Get_LAC LBCS Mon_Error LDA Long_AC - STA Disk_Sector + STA MON_Disk_Sector JSR Get_LAC JSR LAC_To_LCT ; Long_CT = sector count @@ -2278,7 +2257,7 @@ DOS_U ; XXX connect it somehow to command list JSR Open_Disk_Buffer -@loop LDA Mon_Data+1 +@loop LDA MON_DATA+1 LSR BEQ @write JSR Find_next_Sector @@ -2291,7 +2270,7 @@ DOS_U ; XXX connect it somehow to command list BNE @error @next JSR Inc_LPC_Page - INC Disk_Sector + INC MON_Disk_Sector DEW Long_CT BPL @loop @@ -2310,8 +2289,8 @@ Find_next_Sector CMP #$66 ; illegal track or sector BNE @error ; error LDA #0 - STA Disk_Sector - INC Disk_Track ; try next track + STA MON_Disk_Sector + INC MON_Disk_Track ; try next track JSR Build_U_String JSR Send_Disk_Command JSR Get_Disk_Status @@ -2349,7 +2328,7 @@ Send_Disk_Command ; *************** JSR Open_Command_Channel -@loop LDA Mon_Data,Y +@loop LDA MON_DATA,Y BEQ @end JSR CIOUT INY @@ -2370,7 +2349,7 @@ Read_Sector STA [Long_PC],Z INZ BNE @loop - JMP UNTALK + JMP UNTLK ; ********** Write_Sector @@ -2399,16 +2378,16 @@ Set_TS @100 CMP #100 BCC @10 - INC Mon_Data,X + INC MON_DATA,X SBC #100 BRA @100 @10 CMP #10 BCC @1 - INC Mon_Data+1,X + INC MON_DATA+1,X SBC #10 BRA @10 @1 ORA #'0' - STA Mon_Data+2,X + STA MON_DATA+2,X RTS ; @[u],U1 mem track startsec [endsec] : read disk sector(s) @@ -2421,16 +2400,16 @@ Build_U_String LDX #14 @loop LDA U1,X - STA Mon_Data,X + STA MON_DATA,X DEX CPX #2 BCS @loop LDA #'U' - STA Mon_Data - LDA Disk_Track + STA MON_DATA + LDA MON_Disk_Track LDX #7 JSR Set_TS - LDA Disk_Sector + LDA MON_Disk_Sector LDX #11 JMP Set_TS @@ -2787,7 +2766,7 @@ BP_ZERO !pet "b-p 9 0",0 ; set buffer pointer to 0 Reg_Text ; ****** JSR PRIMM - !pet KEY_RETURN, " pc sr ac xr yr zr bp sp nvebdizc", KEY_RETURN, "; ", KEY_ESC, "q",0 + !pet KEY_RETURN, " pc sr ac xr yr zr bp sp nvebdizc", KEY_RETURN, "; ",0 RTS ; ****** diff --git a/src/zvm_m65/dummy.s b/src/zvm_m65/dummy.s new file mode 100644 index 00000000..14351f49 --- /dev/null +++ b/src/zvm_m65/dummy.s @@ -0,0 +1,4 @@ + +; Z80 virtual machine - stub + + rts