Exetools  

Go Back   Exetools > General > Developer Section

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-10-2021, 05:34
Git's Avatar
Git Git is offline
Old Git
 
Join Date: Mar 2002
Location: Torino
Posts: 1,116
Rept. Given: 220
Rept. Rcvd 265 Times in 157 Posts
Thanks Given: 110
Thanks Rcvd at 220 Times in 126 Posts
Git Reputation: 200-299 Git Reputation: 200-299 Git Reputation: 200-299
CPU module. Code sits in the eprom. Operands that are in RAM are addressed by the operand addressing mode. For example, VARA += VARB :

Code segment :

000 MOV R0, #VARA ; R0 contains address of RAM variable VARA
002 MOV R1, #VARB ; R1 contains address of RAM variable VARB
004 MOV A, @R0 ; Get contents of VARA into accumulator
005 ADD A, @R1 ; Add contents of VARV to accumulator
006 MOV @R0, A ; Put results back into VARA

Data Segment :
000 VARA: .DS 1 ; Reserve 1 byte in RAM for VARA
001 VARB: .DS 1 ; Reserve 1 byte in RAM for VARB

It's a little more complicated in that the registers are in RAM and take 0x00 to 0x17, so RAM variables can start at 0x17. Makes no difference to the problem in hand though.

Git
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IDA Pro NIOS2 Processor Module blue_devil Community Tools 0 09-26-2023 22:49
Team Project: PHP Processor v1.2??? padawan General Discussion 21 02-24-2004 07:57


All times are GMT +8. The time now is 03:34.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )