]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avrcpm/avr/macros.inc
* More rcall --> lcall changes.
[avrcpm.git] / avrcpm / avr / macros.inc
index 669938ebbc7c03eef14ce20bfc5fef895a1de7a4..5152902f3f2ff09a5da8ab120b1025ffeb05b060 100644 (file)
        ldi    @0h, high(@1)
 .endm
 
+;------------------------------------------------
+; load 16 bit direct from data space
+
+.macro ldsw
+       lds    @0l, @1 
+       lds    @0h, @1+1
+.endm
+
+;------------------------------------------------
+; store 16 bit direct to data space
+
+.macro stsw
+       sts    @0,  @1l 
+       sts    @0+1,@1h
+.endm
+
 ;------------------------------------------------
 ; add 16 bit constant to register pair
 
 ;      call    @0
 
     .ifdef @0
-      .if abs(PC - @0) > 2048
+      .if abs(PC - @0) > 2047
        call    @0
       .else
        rcall   @0
 ;      printstring "String"
 
 .macro printstring
-  call printstr
+  .if FLASHEND > 0x0fff
+       call    printstr
+  .else
+       rcall   printstr
+  .endif
   .if strlen(@0) % 2
     .db @0,0
   .else