1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-17 00:29:31 +00:00
This commit is contained in:
polluks2 2024-05-06 21:01:50 -04:00 committed by GitHub
commit 79354b5c06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 133 additions and 53 deletions

View File

@ -15,6 +15,8 @@ IndReg := $01 ; Controls indirect indexed load-store bank
TXTPTR := $85 ; Far pointer into BASIC source code
FNAM := $90 ; Far pointer to LOAD/SAVE file-name
FNAM_SEG := $92
STATUS := $9C ; Kernal I/O completion status
FNAM_LEN := $9D ; Holds length of file-name
; ---------------------------------------------------------------------------

View File

@ -15,6 +15,8 @@ IndReg := $01 ; Controls indirect indexed load-store bank
TXTPTR := $85 ; Far pointer into BASIC source code
FNAM := $90 ; Far pointer to LOAD/SAVE file-name
FNAM_SEG := $92
STATUS := $9C ; Kernal I/O completion status
FNAM_LEN := $9D ; Holds length of file-name
; ---------------------------------------------------------------------------

View File

@ -10,6 +10,7 @@ VARTAB := $2A ; Pointer to start of BASIC variables
MEMSIZE := $34 ; Size of memory installed
TXTPTR := $77 ; Pointer into BASIC source code
TIME := $8D ; 60HZ clock
STATUS := $96 ; IEC status byte
KEY_COUNT := $9E ; Number of keys in input buffer
RVS := $9F ; Reverse flag
CURS_FLAG := $A7 ; 1 = cursor off

View File

@ -9,7 +9,6 @@
.import push0, callmain
.import RESTOR, BSOUT, CLRCH
.import __MAIN_START__, __MAIN_SIZE__, __STACKSIZE__
.importzp ST
.include "zeropage.inc"
.include "c128.inc"
@ -92,7 +91,7 @@ L2: lda zpsave,x
; Place the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Reset the stack and the memory configuration.

View File

@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $90 ; IEC status byte
.export initst
.include "c128.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc

View File

@ -10,9 +10,9 @@
.import initlib, donelib
.import callmain, zerobss
.import MEMTOP, RESTOR, BSOUT, CLRCH
.importzp ST
.include "zeropage.inc"
.include "c16.inc"
; ------------------------------------------------------------------------
; Startup code
@ -76,7 +76,7 @@ L2: lda zpsave,x
; Store the return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the stack pointer.

View File

@ -10,9 +10,9 @@
.import BSOUT
.import __MAIN_START__, __MAIN_SIZE__ ; Linker generated
.import __STACKSIZE__ ; from configure file
.importzp ST
.include "zeropage.inc"
.include "c64.inc"
; ------------------------------------------------------------------------
@ -62,7 +62,7 @@ L2: lda zpsave,x
; Place the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the system stuff.

View File

@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $90 ; IEC status byte
.export initst
.include "c64.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc

View File

@ -10,7 +10,8 @@
.import isdisk
.import opencmdchannel
.import closecmdchannel
.importzp ST
.import initst
.import READST
.importzp tmp2
;------------------------------------------------------------------------------
@ -40,8 +41,7 @@ next: inx
; only [in|de]crement the reference count of the shared cmdchannel
; so we need to explicitly initialize ST here
lda #$00
sta ST
jsr initst
stx tmp2
jsr opencmdchannel
@ -49,10 +49,7 @@ next: inx
jsr closecmdchannel
ldx tmp2
; As we had to reference ST above anyway we can as well do so
; here too (instead of calling READST)
lda ST
jsr READST
; Either the Kernal calls above were successfull or there was
; already a cmdchannel to the device open - which is a pretty

View File

@ -16,11 +16,9 @@
jsr sys_bank
sty ktmp ; Save Y register
ldy #$9C ; STATUS
ldy #STATUS
lda (sysp0),y ; Load STATUS from system bank
ldy ktmp
jmp restore_bank ; Will set condition codes on A
.endproc

View File

@ -22,7 +22,7 @@
sty ktmp
txa
ldy #$90 ; FNAM
ldy #FNAM
sta (sysp0),y
lda ktmp
@ -33,13 +33,10 @@
ldy #$92 ; FNAM_SEG
sta (sysp0),y
ldy #$9D ; FNAM_LEN
ldy #FNAM_LEN
pla
sta (sysp0),y
ldy ktmp
jmp restore_bank
.endproc

21
libsrc/cbm510/status.s Normal file
View File

@ -0,0 +1,21 @@
;
; Stefan Haubenthal, 2023-01-16
;
.export initst
.include "extzp.inc"
.include "cbm510.inc"
.proc initst
ldx IndReg
ldy #$0F
sty IndReg ; Switch to the system bank
ldy #STATUS
lda #$00 ; Initialize value
sta (sysp0),y
stx IndReg
rts
.endproc

View File

@ -394,7 +394,7 @@ _exit: pha ; Save the return code
; Place the program return code into BASIC's status variable.
pla
ldy #$9C ; ST
ldy #STATUS
sta (sysp0),y
; Set up the welcome code at the stack bottom in the system bank.

View File

@ -16,11 +16,9 @@
jsr sys_bank
sty ktmp ; Save Y register
ldy #$9C ; STATUS
ldy #STATUS
lda (sysp0),y ; Load STATUS from system bank
ldy ktmp
jmp restore_bank ; Will set condition codes on A
.endproc

View File

@ -22,7 +22,7 @@
sty ktmp
txa
ldy #$90 ; FNAM
ldy #FNAM
sta (sysp0),y
lda ktmp
@ -30,14 +30,13 @@
sta (sysp0),y
lda ExecReg ; Assume name is always in this segment
ldy #$92 ; FNAM_SEG
ldy #FNAM_SEG
sta (sysp0),y
ldy #$9D ; FNAM_LEN
ldy #FNAM_LEN
pla
sta (sysp0),y
ldy ktmp
jmp restore_bank
.endproc

21
libsrc/cbm610/status.s Normal file
View File

@ -0,0 +1,21 @@
;
; Stefan Haubenthal, 2023-01-16
;
.export initst
.include "extzp.inc"
.include "cbm610.inc"
.proc initst
ldx IndReg
ldy #$0F
sty IndReg ; Switch to the system bank
ldy #STATUS
lda #$00 ; Initialize value
sta (sysp0),y
stx IndReg
rts
.endproc

View File

@ -6,12 +6,12 @@
;
.export checkst
.importzp ST
.include "pet.inc"
.proc checkst
lda ST
lda STATUS
beq @L1
lda #5 ; ### Device not present
sec

View File

@ -8,7 +8,6 @@
.import zerobss, push0
.import callmain
.import CLRCH, BSOUT
.importzp ST
.include "zeropage.inc"
.include "pet.inc"
@ -80,7 +79,7 @@ L2: lda zpsave,x
; Store the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the stack pointer.

View File

@ -5,14 +5,12 @@
;
.export READST
.importzp ST
.include "pet.inc"
.proc READST
lda ST
lda STATUS
rts
.endproc

View File

@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $96 ; IEC status byte
.export initst
.include "pet.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc

View File

@ -11,7 +11,6 @@
.import __INTERRUPTOR_COUNT__
.import __MAIN_START__, __MAIN_SIZE__ ; Linker generated
.import __STACKSIZE__ ; Linker generated
.importzp ST
.include "zeropage.inc"
.include "plus4.inc"
@ -106,7 +105,7 @@ L2: lda zpsave,x
; Place the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the stack pointer.

View File

@ -7,12 +7,11 @@
.export READST
.include "plus4.inc"
.importzp ST
; Read the status byte from the zero page instead of banking in the ROM
.proc READST
lda ST ; Load status
lda STATUS ; Load status
rts ; Return to caller
.endproc

View File

@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $90 ; IEC status byte
.export initst
.include "plus4.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc

View File

@ -10,9 +10,9 @@
.import RESTOR, BSOUT, CLRCH
.import __MAIN_START__, __MAIN_SIZE__ ; Linker generated
.import __STACKSIZE__ ; Linker generated
.importzp ST
.include "zeropage.inc"
.include "vic20.inc"
; ------------------------------------------------------------------------
; Startup code
@ -72,7 +72,7 @@ L2: lda zpsave,x
; Place the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the stack pointer.

View File

@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $90 ; IEC status byte
.export initst
.include "vic20.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc