Skip to content

Instantly share code, notes, and snippets.

@yutopp
Created May 24, 2012 17:29
Show Gist options
  • Save yutopp/2782938 to your computer and use it in GitHub Desktop.
Save yutopp/2782938 to your computer and use it in GitHub Desktop.
こんなインターフェースにしたのは誰だ?
#include <vector>
#include <ytl/assembler.hpp>
int main() {
namespace x86 = ytl::assembler::ia_32;
std::vector<char> binary_buffer;
auto asm_gen = ytl::assembler::make_generator<x86::engine>( binary_buffer );
YTL_ASM_BEGIN( asm_gen )
{
push( reg::cs );
pop( reg::ds );
mov( reg::dx, 0x0e );
mov( reg::ah, 0x09 );
int_( 0x21 );
mov( reg::ax, 0x4c01 );
int_( 0x21 );
}
YTL_ASM_END
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment