Direct memory access issue with fill.asm

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Direct memory access issue with fill.asm

Nick
Hi I'm working on the fill.asm project.  I can't figure out how to keep adding 1 to the pointer at "SCREEN."  Each time the loop restarts it resets the A register.  I can't figure out how to keep the memory address in the A register static.   Any advice would be greatly appreciated.   Also tell me if I'm going about this in a totally incorrect way.  thanks
Reply | Threaded
Open this post in threaded view
|

Re: Direct memory access issue with fill.asm

cadet1620
Administrator
SCREEN is a constant. You need to set a variable in RAM to SCREEN before your loop, use the variable as a pointer to write to the screen,and increment the variable at the bottom of your loop, resetting it when it gets too high.

Variables work just like R0, R1 and R2 in the Mult.asm program, except that you give them a name. Variables that contain pointers need to be loaded into A so that the RAM they point to can be accessed:
    @myPointer
    A=M
    D=M     // D = RAM[myPointer]

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Direct memory access issue with fill.asm

Nick
Thanks a lot I got it to work.