How do I define a ram buffer in assembly.

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do I define a ram buffer in assembly.

For example if I have the code

Char C_buffer[10];
Test()
{
C_buffer[5]++;
}
In a assembly file this will look like this
File name Test.S

.data
A_buffer:
; But what do I put at this location ????????

.text
Test:
lds R16, C_buffer+5
Inc R16
std C_buffer+5, R16
ret

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

> .data
> A_buffer:
> ; But what do I put at this location ????????

.space 10

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is an example of a 5 byte buffer:

.dseg
databytes:.BYTE 5

and the code to store and retrieve data:

.def temp = R18

sts databytes+1, temp
lds temp, databytes+1