16-Bit operations in assembly
cbmeeks
Posts: 634
Ok, I USED to know how to do this back in my 6502 days but I get very little asm time these days and I'm rusty..lol
Anyway, here is what I am trying to do.
I need to send a 16-bit address (15-bit, actually) to two ports.
I would like to do something like:
32768··RC
16384··RC
8192···RC
4096···RC
2048···RC
1024···RC
512····RC
256····RC
128····RB
64·····RB
32·····RB
16·····RB
8······RB
4······RB
2······RB
1······RB
Any clues where I can start?
Thanks!
cbmeeks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://metroidclassic.com
=========
DMCA Sucks
RIAA Sucks
Post Edited (cbmeeks) : 9/28/2005 1:58:31 PM GMT
Anyway, here is what I am trying to do.
I need to send a 16-bit address (15-bit, actually) to two ports.
I would like to do something like:
SET(512) // now, RB = %00000000 and RC = %00000001 SET(16788) // now, RB = %00010100 and RC = %10000011 etc...
32768··RC
16384··RC
8192···RC
4096···RC
2048···RC
1024···RC
512····RC
256····RC
128····RB
64·····RB
32·····RB
16·····RB
8······RB
4······RB
2······RB
1······RB
Any clues where I can start?
Thanks!
cbmeeks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://metroidclassic.com
=========
DMCA Sucks
RIAA Sucks
Post Edited (cbmeeks) : 9/28/2005 1:58:31 PM GMT
Comments
Value EQU 512
MOV RB,#(Value & 255)
MOV RC,#(Value >> 8)
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
Available now... SX-Video OSD module $59.95 www.sxvm.com
"I'm a man, but I can change, if I have to, I guess"
Red Green
·
I need "Value" to loop from 0 to 32,767
thanks
cbmeeks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://metroidclassic.com
=========
DMCA Sucks
RIAA Sucks
MOV RB, #addrLo
MOV RC, #addrHi
Or am I missing something?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
So, I could:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://metroidclassic.com
=========
DMCA Sucks
RIAA Sucks
MOV RB,addr
MOV RC,addr+1
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
Available now... SX-Video OSD module $59.95 www.sxvm.com
"I'm a man, but I can change, if I have to, I guess"
Red Green
·
if so wouldnt this work
mov ra , #1
clc
loop
rl ra
rl re
jmp loop
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
engineer, fireman, bowler, father, WoW addict [noparse];)[/noparse]
Dur...yeah, that looks better because I am moving the CONTENTS of addr...not the constant addr...lol
What I am actually tring to do is read the contents of SRAM.
I have built SRAM circuits that actually worked really well but my address bus was limited to 256 bytes (one port).
So, two ports gives me 64k which is exactly the amount I need (actually, 32k for now).
I am trying to make a PEEK and POKE command. :-D
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://metroidclassic.com
=========
DMCA Sucks
RIAA Sucks
That "other" post was from picomontoya@hotmail.com·at IP: 71.34.186.71 -- any of you that want to send him a , "Hey, that wasn't cool." note are welcome to do so.· We have changed his password, the avatar, and if he wants to play more games our IT staff are ready, happily willing, and extraordinarily able to fight back.
Sorry, gang.
Post Edited By Moderator (Jon Williams (Parallax)) : 9/29/2005 11:47:00 PM GMT
Just from reading all of the posts on here, just about every day, I know for a fact that he's a damn good helper when it comes to this stuff...· (And I can't forget you as well BEAU!)· I noticed at the bottom of the screen when I logged on that the newest member was Jon Williams [noparse][[/noparse]Parallax] and thought it was sorta peculiar, so after looking, it shows only 1 post and the screen name was created today, as well as the tone in his post above was a little off-beat for him. (Unless you didn't Google first! But that's another story!) :-)
~Jeff
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
P.S. This is what this part of the alphabet would look like if "Q" and "R" were eliminated.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
I'd assume you changed his e-mail address on the fake Jon's account, seeing as how he could recover the changed password with the lost password feature. [noparse];)[/noparse]
But I'm sure you already thought of that. [noparse];)[/noparse]
Knight.