; ; File generated by cc65 v 2.19 - Git ab8bb268 ; .fopt compiler,"cc65 v 2.19 - Git ab8bb268" .setcpu "6502" .smart on .autoimport on .case on .debuginfo off .importzp sp, sreg, regsave, regbank .importzp tmp1, tmp2, tmp3, tmp4, ptr1, ptr2, ptr3, ptr4 .macpack longbranch .import _cbm_k_readst .export _cbm_load .import _cbm_open .import _cbm_close .import _cbm_read ; --------------------------------------------------------------- ; unsigned int __near__ __fastcall__ cbm_load (const char *name, unsigned char device, void *data) ; --------------------------------------------------------------- .segment "CODE" .proc _cbm_load: near .segment "CODE" jsr pushax jsr decsp4 jsr push0 lda #$01 jsr pusha ldy #$09 lda (sp),y jsr pusha lda #$00 jsr pusha ldy #$0D jsr ldaxysp jsr _cbm_open cmp #$00 beq L0002 ldx #$00 txa jmp L0001 L0002: lda #$01 jsr pusha lda #$05 jsr leaa0sp jsr pushax ldx #$00 lda #$02 jsr _cbm_read cpx #$00 bne L0011 cmp #$02 beq L0003 L0011: lda #$01 jsr _cbm_close ldx #$00 txa jmp L0001 L0003: ldy #$06 lda (sp),y iny ora (sp),y bne L0005 ldy #$05 jsr ldaxysp ldy #$06 jsr staxysp L0005: lda #$01 jsr pusha ldy #$0A jsr pushwysp ldx #$7F lda #$FF jsr _cbm_read ldy #$02 jsr staxysp jsr addeq0sp ldy #$03 jsr ldaxysp clc ldy #$06 adc (sp),y pha txa iny adc (sp),y tax pla dey jsr staxysp ldy #$03 lda (sp),y cmp #$7F bne L000F dey lda (sp),y cmp #$FF bne L000F jsr _cbm_k_readst cmp #$00 beq L0005 L000F: lda #$01 jsr _cbm_close ldy #$03 jsr ldaxysp cpx #$80 bcc L000E ldx #$00 txa jsr stax0sp L000E: jsr ldax0sp L0001: ldy #$0B jmp addysp .endproc