Variables: Difference between revisions

68000 Assembly
(added Diego entry)
(68000 Assembly)
Line 22:
Multiple variables may be defined in a single line as follows:
<lang 11l>Int p, a, d</lang>
=={{header|360 Assembly}}==
;assignment, reference, referencing:
<lang 360asm>* value of F
L 2,F assigment r2=f
* reference (or address) of F
LA 3,F reference r3=@f
* referencing (or indexing) of reg3 (r3->f)
L 4,0(3) referencing r4=%r3=%@f=f</lang>
;declarations, initialization, datatypes:
<lang 360asm>* declarations length
C DS C character 1
X DS X character hexa 1
B DS B character bin 1
H DS H half word 2
F DS F full word 4
E DS F single float 4
D DS D double float 8
L DS L extended float 16
S DS CL12 string 12
P DS PL16 packed decimal 16
Z DS ZL32 zoned decimal 32
* declarations + initialization
CI DC C'7' character 1
XI DC X'F7' character hexa 1
BI DC B'11110111' character bin 1
HI DC H'7' half word 2
FI DC F'7' full word 4
EI DC F'7.8E3' single float 4
DI DC D'7.8E3' double float 8
LI DC L'7.8E3' extended float 16
SI DC CL12'789' string 12
PI DC PL16'7' packed decimal 16
ZI DC ZL32'7' zoned decimal 32</lang>
;scope
In BAL (Basic Assembler Language), variables are global and there is no scope.
 
=={{header|6502 Assembly}}==
===Declaration===
Line 97 ⟶ 133:
STA VRAM_DATA</lang>
 
=={{header|36068000 Assembly}}==
Typically a variable is just a named memory location that exists in RAM. For ROM cartridge software, <code>equ</code> directives are used to assign names to memory locations. For programs that run from disk, which are loaded into RAM and executed from there, the <code>DC</code> directives can also be used, and then the programmer places a label in front of those directives.
;assignment, reference, referencing:
<lang 360asm>* value of F
L 2,F assigment r2=f
* reference (or address) of F
LA 3,F reference r3=@f
* referencing (or indexing) of reg3 (r3->f)
L 4,0(3) referencing r4=%r3=%@f=f</lang>
;declarations, initialization, datatypes:
<lang 360asm>* declarations length
C DS C character 1
X DS X character hexa 1
B DS B character bin 1
H DS H half word 2
F DS F full word 4
E DS F single float 4
D DS D double float 8
L DS L extended float 16
S DS CL12 string 12
P DS PL16 packed decimal 16
Z DS ZL32 zoned decimal 32
* declarations + initialization
CI DC C'7' character 1
XI DC X'F7' character hexa 1
BI DC B'11110111' character bin 1
HI DC H'7' half word 2
FI DC F'7' full word 4
EI DC F'7.8E3' single float 4
DI DC D'7.8E3' double float 8
LI DC L'7.8E3' extended float 16
SI DC CL12'789' string 12
PI DC PL16'7' packed decimal 16
ZI DC ZL32'7' zoned decimal 32</lang>
;scope
In BAL (Basic Assembler Language), variables are global and there is no scope.
 
=={{header|8086 Assembly}}==
1,489

edits