Content originally posted in LPCWare by acelink1 on Sun Mar 16 03:36:41 MST 2014
@ TheFallGuy. Say I wanted to load R0 with a 32bit number like this:
MOVW R0, 0xFFFFFFFF //1 cycle
The assembler will not allow this syntax, so Instead I have to write it like this:
MOVW R0, 0xFFFF // 1 cycle
MOVT R0, 0xFFFF // 1 cycle. Both = 2 cycles
When drawing to a VGA screen timing is criticle and even if your timing is out by 1 cycle the screen will move or jitter.
This is why I wanted to use the 1 cycle 32bit syntax but as you said, Thumb is 16bit code and you have to break the address down in to 2.
I totally understand this. It's like an 8bit processor trying to read memory addresses above 256 Bytes.
You must use 2 bytes like this: LO+256*HI=address.
;External Sram memory address = 1536
;8-BIT 6502 ASSEMBLER
LDA #0
STA 203
LDA #6
STA 204
LDY #10
LDA (203),Y ; LOAD A WITH MEM ADDRESS 1536 + 10
STA 40000,Y ; POKE TO SCREEN MEMORY ADDRESS +10
I could use the 2 cycle method but the MCU would have to be running at 400Mhz or more for what I need to do with my project.
I probably need to look into the Larger Cortex A chips I've heard so much about but not yet researched them.
I will when I get to work on Monday.
Thanks TheFallGuy
Pete :)