assembly - Poke opcodes into memory -


hi trying understand whether possible take instruction opcodes , 'poke' them memory or smehow convert them binary program. have found abandoned lisp project here: http://common-lisp.net/viewvc/cl-x86-asm/cl-x86-asm/ takes x86 asm instructions , converts them opcodes (please see example below). project not go further complete creation of binary executable. hence need 'manually' ideas can me. thanks.

 ;; assemble code in (cl-x86-asm::assemble-forms    '((.entry :push :eax)     (:sub :eax #xfffea)     (:mov :eax :ebx)     (:pop :eax)     (:push :eax)     (.exit :ret)) 

processing...

;; print assembled segment (cl-x86-asm::print-segment)  * segment type data-segment segment size 0000000c bytes 50 81 05 00 0f ff ea 89 03 58 50 c3 

clozure common lisp example has built-in. called lap, lisp assembly program.

see defx86lapfunction.

example:

(defx86lapfunction fast-mod ((number arg_y) (divisor arg_z))   (xorq (% imm1) (% imm1))   (mov (% number) (% imm0))   (div (% divisor))   (mov (% imm1) (% arg_z))   (single-value-return)) 

sbcl can similar vop (virtual operations).

http://g000001.cddddr.org/2011-12-08


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -