Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 4,012 of 4,675    |
|    JJ to none    |
|    Re: Why does adding a 49 prefix to this     |
|    08 Mar 20 12:23:02    |
      XPost: comp.lang.forth       From: jj4public@nospicedham.vfemail.net              On 07 Mar 2020 10:39:51 GMT, none wrote:       > I have an 64 bits Forth system, and I can add a program that       > executes a single instruction, like so       > "       > WANT ASSEMBLERi86       >       > CODE PIET       > MOVI|X, AX| 2 IL,       > NEXT,       > END-CODE       > "       >       > And execute it like so       > PIET OK       >       > This program does nothing. It fills EAX with 2 which is inconsequential       > because EAX is a free register. [Only SP BP and SI are used in the       > virtual system.]       > Now let us prefix the instruction, such that the alternate register set       > is used. This should be likewise inconsequential.       >       > CODE PIET1       > $49 C, \ That is the way to do that in Forth       > MOVI|X, AX| 2 IL,       > NEXT,       > END-CODE       >       > Now PIET1 leads to a segfault.       > I've no clue what could cause this.       >       > I have been working with those prefixes for ages.       > My ciasdis has disassembled and reassembled a 64 bit elf program       > without problems.       > [ This is in the context of an optimiser, I seem to have used       > this R1 in optimised programs, that work. ]       >       > Groetjes Albert              Inserting that 0x49 opcode would change the instruction functionality from:               mov eax, <32-bit immediate value>              To:               mov r8, <64-bit immediate value>              As well as changing the instruction length from 5 bytes, to 10 bytes.              So, the 4 bytes following the `mov eax, |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca