]> git.sur5r.net Git - cc65/blobdiff - libsrc/em/em-kernel.s
Added setjmp/longjmp
[cc65] / libsrc / em / em-kernel.s
index bf4455e4b4541f151e29b912e3bff4503ca20930..1c9591e28d9b2c9b97c60c98a37a5a825504048c 100644 (file)
@@ -33,8 +33,7 @@ emd_copyto:     jmp     return0
 
 ; Driver header signature
 .rodata
-emd_sig:        .byte   $65, $6d, $64, $00      ; "emd", version
-emd_sig_len     = * - emd_sig
+emd_sig:        .byte   $65, $6d, $64, EMD_API_VERSION ; "emd", version
 
 
 ;----------------------------------------------------------------------------
@@ -50,7 +49,7 @@ _em_install:
 
 ; Check the driver signature
 
-        ldy     #emd_sig_len-1
+        ldy     #.sizeof(emd_sig)-1
 @L0:    lda     (ptr1),y
         cmp     emd_sig,y
         bne     inv_drv
@@ -59,12 +58,12 @@ _em_install:
 
 ; Copy the jump vectors
 
-        ldy     #EMD_HDR_JUMPTAB
+        ldy     #EMD_HDR::JUMPTAB
         ldx     #0
 @L1:    inx                             ; Skip the JMP opcode
         jsr     copy                    ; Copy one byte
         jsr     copy                    ; Copy one byte
-        cpx     #(EMD_HDR_JUMPCOUNT*3)
+        cpy     #(EMD_HDR::JUMPTAB + .sizeof(EMD_HDR::JUMPTAB))
         bne     @L1
 
         jmp     emd_install             ; Call driver install routine
@@ -79,8 +78,8 @@ inv_drv:
 ; Copy one byte from the jump vectors
 
 copy:   lda     (ptr1),y
+        sta     emd_vectors,x
         iny
-set:    sta     emd_vectors,x
         inx
         rts