Subversion Repositories MB01 Project

Rev

Blame | Last modification | View Log | Download | RSS feed

;----------------------------------------------------------
; BIOS.INC
; PROGETTO: B1601
;
; funzioni BIOS
;----------------------------------------------------------

; il file puo' essere incluso solo all'interno di GLOBAL.INC
.IFNDEF         _GLOBAL_INC_
.EXIT           "ERROR: This file cannot be included."
.ENDIF

; system functions numbers (for cop instruction)
FN_TASKSW       .EQU    $00


FN_SETBRK       .EQU    $7F
FN_CBMFSCMD     .EQU    $80
FN_CBMFSRW      .EQU    $81
FN_CBMFSCLS     .EQU    $82

; equates for parameters access in system function
STKCNT          .SET    $04
STKYR           .SET    $09
STKXR           .SET    $0B
STKCR           .SET    $0D
STKSR           .SET    $0F
STKPCL          .SET    $10
STKPBR          .SET    $12
STKPRMS         .SET    $13


; CBM EMULATOR
CBMCOLD         .EQU    $FEFF00

OSINIT          .EQU    $F90000
MONITOR         .EQU    $FF0000
SYSMON          .EQU    $FF0003
BRKMON          .EQU    $FF0006
ALTSYSMON       .EQU    $FF0009

;---------------------------------------------------------------------------
; system call functions
;---------------------------------------------------------------------------

; set rtc time
RTCSETT         .MACRO
        .MLIST
        cop     $19
        .DB     $00
        .MNLIST
.ENDM

; set rtc date
RTCSETD         .MACRO
        .MLIST
        cop     $19
        .DB     $01
        .MNLIST
.ENDM

; get rtc time
RTCGETT         .MACRO
        .MLIST
        cop     $19
        .DB     $02
        .MNLIST
.ENDM

; get rtc date
RTCGETD         .MACRO
        .MLIST
        cop     $19
        .DB     $03
        .MNLIST
.ENDM

; task switch (no parm's, no arg's)
TASKSW          .MACRO
        .MLIST
        cop     FN_TASKSW
        .DB     $00
        .MNLIST
.ENDM

SCNPRINT        .MACRO
        .MLIST
        cop     $01
        .MNLIST
.ENDM

TXTPRINT        .MACRO
        .MLIST
        cop     $02
        .MNLIST
.ENDM

SCNSTROUT       .MACRO
        .MLIST
        cop     $03
        .MNLIST
.ENDM

TXTSTROUT       .MACRO
        .MLIST
        cop     $04
        .MNLIST
.ENDM

SCNCHAROUT      .MACRO
        .MLIST
        cop     $05
        .MNLIST
.ENDM

TXTCHAROUT      .MACRO
        .MLIST
        cop     $06
        .MNLIST
.ENDM

SCNPRCHAR       .MACRO
        .MLIST
        cop     $07
        .MNLIST
.ENDM

SCN_CR  .MACRO
        .MLIST
        SCNPRCHAR
        .MLIST
        .DB     $0D
        .MNLIST
.ENDM

TXTPRCHAR       .MACRO
        .MLIST
        cop     $08
        .MNLIST
.ENDM

TXT_CR  .MACRO
        .MLIST
        TXTPRCHAR
        .MLIST
        .DB     $0D
        .MNLIST
.ENDM

SCNPASSTR       .MACRO
        .MLIST
        cop     $0B
        .MNLIST
.ENDM

SCNTXTSTR       .MACRO
        .MLIST
        cop     $0C
        .MNLIST
.ENDM

SCNBUFOUT       .MACRO
        .MLIST
        cop     $0D
        .MNLIST
.ENDM

TXTBUFOUT       .MACRO
        .MLIST
        cop     $0E
        .MNLIST
.ENDM

KBCHARIN        .MACRO
        .MLIST
        cop     $0F
        .MNLIST
.ENDM

TXTCHARIN       .MACRO
        .MLIST
        cop     $10
        .MNLIST
.ENDM

BPRINTF         .MACRO
        .MLIST
        cop     $11
        .MNLIST
.ENDM

BSPRINTF        .MACRO
        .MLIST
        cop     $12
        .MNLIST
.ENDM

BVPRINTF        .MACRO
        .MLIST
        cop     $13
        .MNLIST
.ENDM

BSPRINTF2       .MACRO
        .MLIST
        cop     $14
        .MNLIST
.ENDM

DEVCHAROUT      .MACRO
        .MLIST
        cop     $15
        .MNLIST
.ENDM

DEVCHARIN       .MACRO
        .MLIST
        cop     $16
        .MNLIST
.ENDM

KBGETIN         .MACRO
        .MLIST
        cop     $17
        .MNLIST
.ENDM

SCNINIT         .MACRO
        .MLIST
        cop     $18
        .DB     $00
        .MNLIST
.ENDM

SCNCLR          .MACRO
        .MLIST
        cop     $18
        .DB     $01
        .MNLIST
.ENDM

SCNGETPOS       .MACRO
        .MLIST
        cop     $18
        .DB     $02
        .MNLIST
.ENDM

SCNSETPOS       .MACRO
        .MLIST
        cop     $18
        .DB     $03
        .MNLIST
.ENDM

SCNGETORG       .MACRO
        .MLIST
        cop     $18
        .DB     $04
        .MNLIST
.ENDM

SCNKEYFLG       .MACRO
        .MLIST
        cop     $18
        .DB     $05
        .MNLIST
.ENDM

SCNKEYCLR       .MACRO
        .MLIST
        cop     $18
        .DB     $06
        .MNLIST
.ENDM

SCNKEYBRK       .MACRO
        .MLIST
        cop     $18
        .DB     $07
        .MNLIST
.ENDM

SCNKEYBUF       .MACRO
        .MLIST
        cop     $18
        .DB     $08
        .MNLIST
.ENDM

;------------------------------

FDCRESET        .MACRO
        .MLIST
        cop     $30
        .DB     $00
        .MNLIST
.ENDM

FDCINIT         .MACRO
        .MLIST
        cop     $30
        .DB     $01
        .MNLIST
.ENDM

FDNEWRD         .MACRO
        .MLIST
        cop     $30
        .DB     $02
        .MNLIST
.ENDM

FDCTST          .MACRO
        .MLIST
        cop     $30
        .DB     $03
        .MNLIST
.ENDM

FDCGETFMT       .MACRO
        .MLIST
        cop     $30
        .DB     $04
        .MNLIST
.ENDM

FDCGETST        .MACRO
        .MLIST
        cop     $30
        .DB     $02
        .MNLIST
.ENDM

FDCREAD         .MACRO
        .MLIST
        cop     $31
        .DB     $00
        .MNLIST
.ENDM

FDCVERF         .MACRO
        .MLIST
        cop     $31
        .DB     $01
        .MNLIST
.ENDM

FDCWRITE        .MACRO
        .MLIST
        cop     $31
        .DB     $02
        .MNLIST
.ENDM

FDCFORMAT       .MACRO
        .MLIST
        cop     $33
        .MNLIST
.ENDM

FDCVERFMT       .MACRO
        .MLIST
        cop     $34
        .MNLIST
.ENDM


FDCTKRD         .MACRO
        .MLIST
        cop     $35
        .DB     $00
        .MNLIST
.ENDM

FDCTKVERF       .MACRO
        .MLIST
        cop     $35
        .DB     $01
        .MNLIST
.ENDM

FDCTKWR         .MACRO
        .MLIST
        cop     $35
        .DB     $02
        .MNLIST
.ENDM

FDCMKFS         .MACRO
        .MLIST
        cop     $36
        .MNLIST
.ENDM

ATAREAD         .MACRO
        .MLIST
        cop     $40
        .DB     $00
        .MNLIST
.ENDM

ATAVERF         .MACRO
        .MLIST
        cop     $40
        .DB     $01
        .MNLIST
.ENDM

ATAWRITE        .MACRO
        .MLIST
        cop     $40
        .DB     $02
        .MNLIST
.ENDM

ATACTL          .MACRO
        .MLIST
        cop     $41
        .MNLIST
.ENDM

ATADMARD        .MACRO
        .MLIST
        cop     $42
        .DB     $00
        .MNLIST
.ENDM

ATADMAWR        .MACRO
        .MLIST
        cop     $42
        .DB     $01
        .MNLIST
.ENDM

TRUENAM         .MACRO
        .MLIST
        cop     $FE
        .MNLIST
.ENDM


;============================================00

; SETBRK        set break level of a process
;
;       in:     C  = pages number to increase or decrease
;                    if C = 0 return current break level
;               CF = 0 -> increase pages, 1 -> decrease pages
;       out:    C  = previous break level if no error (CF = 0)
;               C  = maximum available pages or max. pages to decrease
SETBRK          .MACRO
        .MLIST
        cop     FN_SETBRK
        .MNLIST
.ENDM

; CBMFSCMD
CBMFSCMD        .MACRO
        .MLIST
        cop     FN_CBMFSCMD
        .MNLIST
.ENDM

CBMFSRD         .MACRO
        .MLIST
        cop     FN_CBMFSRW
        .DB     $00
        .MNLIST
.ENDM

CBMFSWR         .MACRO
        .MLIST
        cop     FN_CBMFSRW
        .DB     $01
        .MNLIST
.ENDM

CBMFSCLS        .MACRO
        .MLIST
        cop     FN_CBMFSCLS
        .MNLIST
.ENDM

;-------------- LIB

getopt          .EQU    $FA0000
strlen          .EQU    $FA0003
strcpy          .EQU    $FA0006