Difference between revisions of "Z80:Directives:USING"

From Learn @ Cemetech
Jump to navigationJump to search
(Initial automated import)
 
 
Line 6: Line 6:
  
 
=== Allowed inputs ===
 
=== Allowed inputs ===
 
[!-- All possible uses of the directive --]
 
  
 
== Uses ==
 
== Uses ==
Line 38: Line 36:
  
 
== See Also ==
 
== See Also ==
 
[!-- Related directives --]
 
  
 
{{lowercase}}
 
{{lowercase}}

Latest revision as of 08:23, 5 February 2016

Allows access to a module's local labels from the current module. The current module always takes priority, and any modules added through .using are given more priority based on the how early they were added.

Syntax

   .using module

Allowed inputs

Uses

   .module Main
   _label = 1
   .endmodule
   
   .module Test1
       ld a,_label ; Assembler error.
   .endmodule
   
   .module Test2
   .using Main
       ld a,_label ; a = 1.
   .endmodule
   
   .module Test3
   .using Main
       ld a,_label ; a = 2
   _label = 2
   .endmodule
   
   .module Test4
   .using Test3
   .using Main
       ld a,_label ; a = 2 (Test 3 takes priority)
   .endmodule


See Also