Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/30/00 19:42
Read: times


 
#6075 - RE: memory access
John,
Yes, there is a 00h rom and a 00h ram at the same time. This is actually a cool thing.

In the Intel assembler you can place table in rom at say 1000h by using the following:

cseg ;code segment or rom
.org 1000h ;place at 1000h
MY_TABLE: ;a label for you table

access with this line:

movc a,MY_TABLE + offset_into_table

movc means move from code into the accumulator from the destination "MY_TABLE + offset_into_table".
To get a byte in internal ram would require the mov instruction as in:

mov a,address_of_byte_wanted

movx is for external ram and oh yeah, it starts at 00h as well.

In C it is even easier.

unsigned char code MY_TABLE[]= 'whatever';

Access with the obvious:

My_variable = MY_TABLE[index];

Check the tutorial for the assembly language instructions, its well done!
Allen

List of 8 messages in thread
TopicAuthorDate
memory access            01/01/70 00:00      
RE: memory access            01/01/70 00:00      
RE: memory access            01/01/70 00:00      
RE: memory access            01/01/70 00:00      
RE: memory access            01/01/70 00:00      
RE: memory access            01/01/70 00:00      
RE: memory access            01/01/70 00:00      
RE: memory access            01/01/70 00:00      

Back to Subject List