Address of a variable: Difference between revisions

Content added Content deleted
Line 23: Line 23:
J DS F</lang>
J DS F</lang>
=={{header|8086 Assembly}}==
=={{header|8086 Assembly}}==
When programming in assembly language yourself (i.e. not having a compiler do it for you), generally the addresses of variables are known in advance and chosen by the programmer rather than dynamically determined by the compiler. Therefore you pretty much always know a variable's address at all times. However there is a little more work that needs to be done to get the address in 8086 Assembly compared to assembly for other machines.
{{works with|https://www.dosbox.com/|DOSBox}}
{{works with|https://www.dosbox.com|DOSBox}}


<lang asm>.model small
<lang asm>.model small
Line 30: Line 31:
UserRam 256 DUP (0) ;define the next 256 bytes as user RAM, initialize them all to zero.
UserRam 256 DUP (0) ;define the next 256 bytes as user RAM, initialize them all to zero.


myString db "Hello World!",255
.code
.code