]> git.sur5r.net Git - cc65/blob - libsrc/em/em_unload.s
Remove trailings spaces from CBM-related asm files
[cc65] / libsrc / em / em_unload.s
1 ;
2 ; Ullrich von Bassewitz, 2002-11-29
3 ;
4 ; unsigned char em_unload (void);
5 ; /* Unload the currently loaded driver. */
6
7
8         .import         em_clear_ptr
9
10         .include        "em-kernel.inc"
11         .include        "em-error.inc"
12         .include        "modload.inc"
13
14 _em_unload:
15         lda     _em_drv
16         ora     _em_drv+1
17         beq     no_driver               ; No driver
18
19         jsr     emd_uninstall           ; Deinstall the driver
20
21         lda     _em_drv
22         ldx     _em_drv+1
23         jsr     _mod_free               ; Free the driver
24
25         jmp     em_clear_ptr            ; Clear the driver pointer, return zero
26
27 no_driver:
28         tax                             ; X = 0
29         lda     #EM_ERR_NO_DRIVER
30         rts