| |
| |
| |
|
Page: 1 2 3 4
Comments:
<0> yo <1> 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. <1> <1> Then I have the following LC-3 instructions x3010: 1110 1100 0011 1111, x3011: 0110 1000 1100 0000, x3012: 0110 1101 0000 0000 <1> <1> What single instruction could replace the above three? <2> You're going to have to give us the backstory on that one <1> well <1> 1110 is the opcode for LEA <1> so, 1110 1100 0011 1111, is LEA R6 <- PC + x003F <1> so in the register R6 is being set w/ the memory value of x3011 + x30FF = x3050 <1> thats the first instruction <2> Unfortunately, I don't think any of us are familiar with that instruction set <1> well ignore the instruction set <1> the asm is similar <1> 0110 1000 1100 0000 would be LDR: R4 <- R3 + 00000 (i.e- base+offset) <2> Give us the three instruction with detailed descriptions of what they do in conjuction <1> LEA = load effective address, computes address of PC + signed offset and stores result into a register
<1> first four bits is the opcode, next three bits is destination register, and last 9 bits is PCOffset <1> so 1100 110 000111111 would be: LEA R6 PC+x003F <1> next two instructions <1> use the 0110, use the LDR instruction <1> Load into register using Base+Offset <3> always 32-bit opcodes? <1> addressing mode <1> no <1> 16 bits <3> err yeah, my bad <1> 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 <1> so the address of the operand is obtained by adding a sign-extended 6-bit offset to a base register <1> in this case, 0110 100 011 000000, LDR: R4 <- R3 + 00000 (i.e- base register + offset) <1> oh in the instruction before, the PC is automatically incremented simultaneously at the same time the instruction is executed <1> so first instruction was at hex x3010 <1> so PC is actually pointing to next instruction <1> at x3011 <2> I think you're on your own, jojo <1> so, 1110 1100 0011 1111, is LEA R6 <- PC + x003F , would be x3011+ x003F = x3050 <1> anyhow <1> the last instruction <1> 0110 110 100 000000, LDR: R6 <- R4 + 00000 <1> 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 <2> No idea. <1> would i be able to replace all three with an instruction using indirect addressing mode? <2> No idea. <2> It's all meaningless to me <2> Why do you care what the memory locations have? <1> 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 <1> i don't <1> its just an example <1> of trying to optmize some code <1> 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 <2> Probably.. but I'm not familiar enough with the instruction set (nor exactly what you're doing) to be able to tell you what. <1> not really doing anything <1> just moving stuff around <1> from memory to registers <1> using different addressing modes <1> namely, immediate mode and base+offset <1> here's something i found on it: http://cs.gmu.edu/~setia/cs367/slides/lecture3.pdf <1> it's giving me a headache... blah =/ <4> then stop worrying about it. :) <2> Sage advice <4> Thank you <1> hehe <5> Geez. A cl***mate 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." <1> lol <2> What is an unofficial server? <6> a pirate server i'd guess.. <6> i wouldnt think the server code would be released though <2> It's not <2> And nobody has the kind of hardware you'd need <5> TCA: I think they "emulate" a server. <2> _exe: I seriously doubt that <6> well if you ran a server with < 20 clients or so you probably wouldnt need much in terms of hardware <6> i dont know though... ive never played <1> wouldn't be much fun <1> :P <5> Heh, I don't. My friends do that all the time, because it's kinda expensive playing in a official server I think. <2> They play on an un-official WoW server? <5> .google WoW emulator linux
<7> Installing WoW Server on Linux - Wickle Wiki, "http://www.wickle.com/wiki/index.php/Installing_WoW_Server_on_Linux" <7> tow.com blog WWNC 2006, "http://www.tow.com/2006/01/14/wwnc-2006/" <5> Exactly. <7> Electronic Recordkeeping > Preservation > Products > Emulators "http://www-personal.si.umich.edu/~calz/ermlinks/prod_emu.htm" <2> Amazing <2> although, every link is broken <2> openwow is toast <2> wddg is gone <2> blackstorm is suspended <2> blizzhackers even forbids you to talk about server emulation <5> :_/ <6> i wonder if someone reversed the WoW protocol and related or if the source code was leaked <5> Later I can ask him which server he plays on. <2> I cannot possibly imagine why you wouldn't pay $15/month if you wanted to play <5> us$15/month is a lot to a 18yo guy from a third world country. <2> Right. And the zillions of chinese don't have a problem with it.. why? <5> I don't have idea. I'm not chinese. <5> My parents give me us$17/month, and I have to buy everything I need with that. <5> And I'm not poor. <2> Fair point <2> Personally, if I were a parent, I'd be more than happy to pay for an account <4> I got 100 per month, plus $25 for each As I make each 6 weeksl.. And I was a straight A student with 7 cl***es <4> :p <2> Keeps them off the streets and enslaved. <2> 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. <2> Hellsphreak is our newest star pupil. <2> Sorry, _exe... <5> Heh, internet a great mind control tool. <5> Haha <5> Where are you from, hellsphreak ? <4> My mom's uterus, I'm guessing <2> Well, if you go far enough back your dad's... <4> Even that is beyond my comprehension. I'll stick with what I can grasp. <4> :p <5> Heh, okey. <4> OK, fine... You win. Texas. <2> Land of the cow patties <4> Yadda yadda <2> Why is New Mexico so windy? <5> TCA's neighbor. <4> But it has one thing that your land does not...... <2> Because texas ****s, and arizona blows <4> ME! <2> Fair enough <1> 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? <1> 3 bits? <2> What do you mean by "had an addressability of 1 byte" ? <4> You just will not give up, eh? <1> meaning memory has an address space of 2^8 <1> locations that is <2> Right, well, you'll still need a 16-bit address <1> well actually addressability would be how many bits per location <2> If it can only see 256 bytes at a time, then you only need a byte pointer <2> But you'd need some way to tell you which bank you're looking at. <2> Otherwise your "total memory size of 64k bytes" is meaningless and you really mean to say "total memory size of 256 bytes" <1> but if it were 64k bytes of memory, how many bits would i need in the PC to address all of it if required? <2> 16 bites <2> 16-bits <2> Stupid fingers betraying me again <4> They should betray you in other ways <4> herslef <4> herself..... <4> *headdesk* <2> hahaha <4> hush. <1> if the instruction length were kept at 16-bits <1> would that post a problem? <2> Yes, that would be a problem if it was a fixed width instruction set, and they were fixed to 16-bits <2> Unless you're clever. Like me. <2> And then you'd just use two instructions. A prefix instruction (next instruction is the address) and then the address <4> I believe he wants to nib it down to just one instruction. <4> Now, as to why he wants to do this, is beyond me.
Return to
#asm or Go to some related
logs:
Appinines nokia e50 gentoo #c lebriçou kde loud clown car multicoloured WHICH OF THE PROFFESSIONALS WAS PLAYED BY MARTIN SHAW #linux #MissKitten help.kdfs.net
#AllNiteCafe
|
|