; ; File generated by cc65 v 2.11.0 ; .fopt compiler,"cc65 v 2.11.0" .setcpu "6502" .smart on .autoimport on .case on .debuginfo on .importzp sp, sreg, regsave, regbank, tmp1, ptr1, ptr2 .macpack longbranch .dbg file, "em_load.c", 3558, 1055441303 .dbg file, "../../include/string.h", 4676, 1116364269 .dbg file, "../../include/stddef.h", 2974, 1061022172 .dbg file, "../../include/unistd.h", 3912, 1061022172 .dbg file, "../../include/fcntl.h", 3407, 1101568713 .dbg file, "../../include/modload.h", 4987, 1039740094 .dbg file, "../../include/em.h", 6261, 1044916305 .dbg file, "../../include/em/em-kernel.h", 3817, 1044916305 .import _read .import _open .import _close .import _mod_load .export _em_load_driver .import _em_install .import _em_uninstall .import _em_drv ; --------------------------------------------------------------- ; unsigned char __fastcall__ em_load_driver (const unsigned char*) ; --------------------------------------------------------------- .segment "CODE" .proc _em_load_driver .segment "DATA" L0004: .addr _read .res 8,$00 .segment "CODE" ; ; { ; .dbg line, "em_load.c", 47 jsr pushax ; ; if (em_drv != 0) { ; .dbg line, "em_load.c", 54 jsr decsp1 lda _em_drv ora _em_drv+1 beq L0006 ; ; em_uninstall (); ; .dbg line, "em_load.c", 55 jsr _em_uninstall ; ; ctrl.callerdata = open (name, O_RDONLY); ; .dbg line, "em_load.c", 59 L0006: jsr decsp4 ldy #$06 jsr ldaxysp ldy #$02 sta (sp),y iny txa sta (sp),y lda #$01 ldy #$00 sta (sp),y iny lda #$00 sta (sp),y ldy #$04 jsr _open sta L0004+2 stx L0004+2+1 ; ; if (ctrl.callerdata >= 0) { ; .dbg line, "em_load.c", 60 txa bmi L0015 ; ; Res = mod_load (&ctrl); ; .dbg line, "em_load.c", 63 lda #<(L0004) ldx #>(L0004) jsr _mod_load ldy #$00 sta (sp),y ; ; close (ctrl.callerdata); ; .dbg line, "em_load.c", 66 lda L0004+2 ldx L0004+2+1 jsr _close ; ; if (Res == MLOAD_OK) { ; .dbg line, "em_load.c", 69 ldy #$00 lda (sp),y bne L0015 ; ; return em_install (ctrl.module); ; .dbg line, "em_load.c", 72 lda L0004+4 ldx L0004+4+1 jsr _em_install jmp incsp3 ; ; return EM_ERR_CANNOT_LOAD; ; .dbg line, "em_load.c", 78 L0015: ldx #$00 lda #$02 ; ; } ; .dbg line, "em_load.c", 79 jmp incsp3 .dbg line .endproc