logs archiveIRC Archive / Undernet / #asm / 2006 / February / 11 / 1
DEADBEEFh
yo
Jojo`
I'm using the LC-3 instruction set, I'm trying to optimize my code. Lets say the PC contains x3010 and the following memory locations contain the values: x3050 -> x70A4, x70A2 -> x70A3, x70A3 -> xFFFF, x70A4 -> x123B.
<Jojo`> Then I have the following LC-3 instructions x3010: 1110 1100 0011 1111, x3011: 0110 1000 1100 0000, x3012: 0110 1101 0000 0000
<Jojo`> What single instruction could replace the above three?
TCA
You're going to have to give us the backstory on that one
Jojo`
well
1110 is the opcode for LEA
so, 1110 1100 0011 1111, is LEA R6 <- PC + x003F
so in the register R6 is being set w/ the memory value of x3011 + x30FF = x3050
thats the first instruction
TCA
Unfortunately, I don't think any of us are familiar with that instruction set
Jojo`
well ignore the instruction set
the asm is similar
0110 1000 1100 0000 would be LDR: R4 <- R3 + 00000 (i.e- base+offset)
TCA
Give us the three instruction with detailed descriptions of what they do in conjuction
Jojo`
LEA = load effective address, computes address of PC + signed offset and stores result into a register
first four bits is the opcode, next three bits is destination register, and last 9 bits is PCOffset
so 1100 110 000111111 would be: LEA R6 PC+x003F
next two instructions
use the 0110, use the LDR instruction
Load into register using Base+Offset
EwIck
always 32-bit opcodes?
         

Jojo`
addressing mode
no
16 bits
EwIck
err yeah, my bad
Jojo`
the 6-bit offset is literally taken from the instruction, bits [5 to 0]. The base register is specified by bits [8 to 6] of the instruction
so the address of the operand is obtained by adding a sign-extended 6-bit offset to a base register
in this case, 0110 100 011 000000, LDR: R4 <- R3 + 00000 (i.e- base register + offset)
oh in the instruction before, the PC is automatically incremented simultaneously at the same time the instruction is executed
so first instruction was at hex x3010
so PC is actually pointing to next instruction
at x3011
TCA
I think you're on your own, jojo
Jojo`
so, 1110 1100 0011 1111, is LEA R6 <- PC + x003F , would be x3011+ x003F = x3050
anyhow
the last instruction
0110 110 100 000000, LDR: R6 <- R4 + 00000
with the following memory locations containing the values: x3050 -> x70A4, x70A2 -> x70A3, x70A3 -> xFFFF, x70A4 -> x123B, already. what could i replace the above three instructions with a single instruction
TCA
No idea.
Jojo`
would i be able to replace all three with an instruction using indirect addressing mode?
TCA
No idea.
It's all meaningless to me
Why do you care what the memory locations have?
Jojo`
ie. - instead of the address *being* the address of the operand to be loaded, instead it *contains* the address of the operand to be loaded
i don't
its just an example
of trying to optmize some code
anyhow, a value is loaded into register R6 using the above three instructions, i want to find out, instead of doing three instructions, minimize it to a single instruction
TCA
Probably.. but I'm not familiar enough with the instruction set (nor exactly what you're doing) to be able to tell you what.
Jojo`
not really doing anything
just moving stuff around
from memory to registers
using different addressing modes
namely, immediate mode and base+offset
here's something i found on it: http://cs.gmu.edu/~setia/cs367/slides/lecture3.pdf
it's giving me a headache... blah =/
hellsphreak
then stop worrying about it. :)
TCA
Sage advice
hellsphreak
Thank you
Jojo`
hehe
_exe
Geez. A classmate sent me a message: "My only friend... my life ends here. I installed WoW and I'm going to play in an official server. My life ends here."
Jojo`
lol
TCA
What is an unofficial server?
Asmodee`
a pirate server i'd guess..
i wouldnt think the server code would be released though
TCA
It's not
And nobody has the kind of hardware you'd need
         

_exe
TCA: I think they "emulate" a server.
TCA
_exe: I seriously doubt that
Asmodee`
well if you ran a server with < 20 clients or so you probably wouldnt need much in terms of hardware
i dont know though... ive never played
Jojo`
wouldn't be much fun
:P
_exe
Heh, I don't. My friends do that all the time, because it's kinda expensive playing in a official server I think.
TCA
They play on an un-official WoW server?
_exe
.google WoW emulator linux
wisebot
Installing WoW Server on Linux - Wickle Wiki, "http://www.wickle.com/wiki/index.php/Installing_WoW_Server_on_Linux"
tow.com » blog » WWNC 2006, "http://www.tow.com/2006/01/14/wwnc-2006/"
_exe
Exactly.
wisebot
Electronic Recordkeeping > Preservation > Products > Emulators, "http://www-personal.si.umich.edu/~calz/ermlinks/prod_emu.htm"
TCA
Amazing
although, every link is broken
openwow is toast
wddg is gone
blackstorm is suspended
blizzhackers even forbids you to talk about server emulation
_exe
:_/
Asmodee`
i wonder if someone reversed the WoW protocol and related or if the source code was leaked
_exe
Later I can ask him which server he plays on.
TCA
I cannot possibly imagine why you wouldn't pay $15/month if you wanted to play
_exe
us$15/month is a lot to a 18yo guy from a third world country.
TCA
Right. And the zillions of chinese don't have a problem with it.. why?
_exe
I don't have idea. I'm not chinese.
My parents give me us$17/month, and I have to buy everything I need with that.
And I'm not poor.
TCA
Fair point
Personally, if I were a parent, I'd be more than happy to pay for an account
hellsphreak
I got 100 per month, plus $25 for each As I make each 6 weeksl.. And I was a straight A student with 7 classes
:p
TCA
Keeps them off the streets and enslaved.
It's one of those things I'd do if I were an evil overlord. 100. Finally, to keep my subjects permanently locked in a mindless trance, I will provide each of them with free unlimited Internet access.
Hellsphreak is our newest star pupil.
Sorry, _exe...
_exe
Heh, internet a great mind control tool.
Haha
Where are you from, hellsphreak ?
hellsphreak
My mom's uterus, I'm guessing
TCA
Well, if you go far enough back your dad's...
hellsphreak
Even that is beyond my comprehension. I'll stick with what I can grasp.
:p
_exe
Heh, okey.
hellsphreak
(Action) falls under pressure
OK, fine... You win. Texas.
TCA
Land of the cow patties
hellsphreak
Yadda yadda
TCA
Why is New Mexico so windy?
_exe
TCA's neighbor.
hellsphreak
But it has one thing that your land does not......
TCA
Because texas sucks, and arizona blows
hellsphreak
ME!
TCA
Fair enough
Jojo`
if a machine had an addressabilty of 1 byte (8 bits) and a total memory size of 64K bytes. how many bits would be required in the PC to address all of memory?
3 bits?
TCA
What do you mean by "had an addressability of 1 byte" ?
hellsphreak
You just will not give up, eh?
Jojo`
meaning memory has an address space of 2^8
locations that is
TCA
Right, well, you'll still need a 16-bit address
Jojo`
well actually addressability would be how many bits per location
TCA
If it can only see 256 bytes at a time, then you only need a byte pointer
But you'd need some way to tell you which bank you're looking at.
Otherwise your "total memory size of 64k bytes" is meaningless and you really mean to say "total memory size of 256 bytes"
Jojo`
but if it were 64k bytes of memory, how many bits would i need in the PC to address all of it if required?
TCA
16 bites
16-bits
Stupid fingers betraying me again
hellsphreak
They should betray you in other ways
(Action) slaps herslef
herslef
herself.....
*headdesk*
TCA
hahaha
hellsphreak
hush.
Jojo`
if the instruction length were kept at 16-bits
would that post a problem?
TCA
Yes, that would be a problem if it was a fixed width instruction set, and they were fixed to 16-bits
Unless you're clever. Like me.
And then you'd just use two instructions. A prefix instruction (next instruction is the address) and then the address
hellsphreak
I believe he wants to nib it down to just one instruction.
Now, as to why he wants to do this, is beyond me.
« prev 1 2 3 4 next »