FAQ  •  Register  •  Login

trying to print from assembly

<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Mon May 20, 2013 6:38 pm

trying to print from assembly

this doesnt compile because the label is made outside of ASM tags

  Code:
function FASTCALL drawthis() as ubyte
asm
LD A,(landscapeeightiter)
INC A
LD (landscapeeightiter),A   

end asm
end function

for x=0 to 20
drawthis()
Print AT x,0;STR(PEEK(@landscapeeightiter))+"-"
next
STOP
landscapeeightiter:
ASM
defb 100
END ASM


im trying to print the value of the byte at the address, but also modify it in assembly
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon May 20, 2013 10:44 pm

Re: trying to print from assembly

slenkar wrote:this doesnt compile because the label is made outside of ASM tags

  Code:
function FASTCALL drawthis() as ubyte
asm
LD A,(landscapeeightiter)
INC A
LD (landscapeeightiter),A   

end asm
end function

for x=0 to 20
drawthis()
Print AT x,0;STR(PEEK(@landscapeeightiter))+"-"
next
STOP
landscapeeightiter:
ASM
defb 100
END ASM


im trying to print the value of the byte at the address, but also modify it in assembly


At the moment you can try in assembler:
  Code:
DIM a as Ubyte
...
LD a, (_variableName)

Just prefixing the variable name with "_" you get the mangled name. But this might change in the future. :?
This only works for *global* variables.
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Tue May 21, 2013 2:55 pm

Re: trying to print from assembly

ah yes thanks that works
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Thu May 23, 2013 4:04 pm

Re: trying to print from assembly

In addition you might find camel case useful.

landscapeEightIter might be more readable than landscapeeightiter

http://en.wikipedia.org/wiki/CamelCase

Return to How-To & Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO