self-modifying

Is there any self-improving compiler around?

假装没事ソ 提交于 2019-11-27 02:12:45
问题 I am not aware of any self-improving compiler, but then again I am not much of a compiler-guy. Is there ANY self-improving compiler out there? Please note that I am talking about a compiler that improves itself - not a compiler that improves the code it compiles . Any pointers appreciated! Side-note : in case you're wondering why I am asking have a look at this post. Even if I agree with most of the arguments I am not too sure about the following: We have programs that can improve their code

What are the uses of self modifying code?

谁说胖子不能爱 提交于 2019-11-27 00:01:50
问题 Is there any real use for self modifying code ? I know that they can be used to build worms/viruses, but I was wondering whether there is some good reason that a programmer may have to use self modifying code. Any ideas? Hypothetical situations are welcome too. 回答1: Turns out that the Wikipedia entry on "self-modifying code" has a great list: Semi-automatic optimization of a state dependent loop. Runtime code generation , or specialization of an algorithm in runtime or loadtime (which is

Self modifying code always segmentation faults on Linux

落爺英雄遲暮 提交于 2019-11-26 17:43:01
问题 i found an article about self modifying code and tried to do some examples, but i get always segmentation faults. As fas as i can understand, there is a violation in memory permissions. The code segment is (r)ead/e(x)ecute and so the attempt of writting results to this fault. Is there a way to test the program either by changing the memory permissions at runtime or before? I'm using linux and the example is written in GAS assembly. .extern memcpy .section .data string: .asciz "whatever"

How to write self-modifying code in x86 assembly

喜欢而已 提交于 2019-11-26 10:07:54
问题 I\'m looking at writing a JIT compiler for a hobby virtual machine I\'ve been working on recently. I know a bit of assembly, (I\'m mainly a C programmer. I can read most assembly with reference for opcodes I don\'t understand, and write some simple programs.) but I\'m having a hard time understanding the few examples of self-modifying code I\'ve found online. This is one such example: http://asm.sourceforge.net/articles/smc.html The example program provided does about four different

Edit, save, self-modifying HTML document; format generated HTML, JavaScript

烈酒焚心 提交于 2019-11-26 01:47:52
问题 Motivation: https://stackoverflow.com/questions/28120689/create-self-modifying-html-page-on-box Bug: String escaping , formatting html , js generated by initial edited , saved html , js e.g., a) if open \"saveFile.html\" at local browser ; b) type \"abc\" into textarea ; c) click save file button ; d) click Save at Save File dialog ; e) file-*[date according to universal time].html saved to disk ; f) open file-*[date according to universal time].html in browser ; g) type \"def\" into textarea

Edit, save, self-modifying HTML document; format generated HTML, JavaScript

眉间皱痕 提交于 2019-11-25 22:58:03
Motivation: https://stackoverflow.com/questions/28120689/create-self-modifying-html-page-on-box Bug: String escaping , formatting html , js generated by initial edited , saved html , js e.g., a) if open "saveFile.html" at local browser ; b) type "abc" into textarea ; c) click save file button ; d) click Save at Save File dialog ; e) file-*[date according to universal time].html saved to disk ; f) open file-*[date according to universal time].html in browser ; g) type "def" into textarea ; h) repeat d) , e) , f) ; i) Bug: result at second file-*[date according to universal time].html does