ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 28 May 2012 11:12 PM |
I am trying to learn lua asm from A No Frills Intro To Lua, but it just doesn't explain encoding a Instruction very well.
There are three instruction forms. iABC, iABx, IAsBx
iABC(B9, C9, A8, Op6) iABx(Bx18, A8, Op6) iABC(sBx18, A8, Op6)
SETGLOBAL(7) Write a register value into a global variable
SETGLOBAL A Bx Gbl[Kst(Bx)] := R(A)
Which means setGlobal would have to use iABx instruction form.
ADDR _= =_ DATA____ = Equivalence 0037 _= =_ 47400000 = setglobal 1 1
so... 07 1 1
A=1 Bx=1 Op = 07
Op is 6 bits Bx is 18 bits A is 8 bits
4740 0000 0100 0111 0100 0000 0000 0000 0000 0000
0100 01 is not equal to 7! and 00 0000 is not equal to 7! Where the heck does this come out to op code 7?!
|
|
|
| Report Abuse |
|
|
| |
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 28 May 2012 11:42 PM |
| I'm asking for help. I want to be able to decipher one simple instruction! |
|
|
| Report Abuse |
|
|
|
| 28 May 2012 11:45 PM |
| Calm down. I'm sure someone who knows Assembly will soon be here to help. |
|
|
| Report Abuse |
|
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 28 May 2012 11:51 PM |
| I know assembly. But the lua assembly confuses me or this guide has the wrong hexcode for this op example. |
|
|
| Report Abuse |
|
|
jrf2112
|
  |
| Joined: 29 Jun 2008 |
| Total Posts: 3354 |
|
|
| 29 May 2012 09:13 AM |
| You can google numbers-hexcode translator and get a correct hexcode. |
|
|
| Report Abuse |
|
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 29 May 2012 09:15 AM |
| Your not listening. I know how to convert binary->hex->decimal.... I am asking about instruction format! |
|
|
| Report Abuse |
|
|
jrf2112
|
  |
| Joined: 29 Jun 2008 |
| Total Posts: 3354 |
|
|
| 29 May 2012 09:19 AM |
| I think I get how it works, but I'm probably going to be wrong. Good luck. |
|
|
| Report Abuse |
|
|