Machine code: Difference between revisions

Content added Content deleted
(added sbcl and clisp)
No edit summary
Line 30: Line 30:
NumPut("0x" . SubStr(hex, 2 * A_Index - 1, 2), code, A_Index - 1, "Char")
NumPut("0x" . SubStr(hex, 2 * A_Index - 1, 2), code, A_Index - 1, "Char")
}</lang>
}</lang>

=={{header|BBC BASIC}}==
{{works with|BBC BASIC for Windows}}
'''Note''' that ''BBC BASIC for Windows'' includes an 80386/80486 assembler as standard!

<lang bbcbasic> REM Claim 9 bytes of memory
SYS "GlobalAlloc",0,9 TO code%

REM Poke machine code into it
P%=code%
[OPT 0
mov EAX, [ESP+4]
add EAX, [ESP+8]
ret
]

REM Run code
SYS code%,7,12 TO result%
PRINT result%

REM Free memory
SYS "GlobalFree",code%
END</lang>


=={{header|C}}==
=={{header|C}}==