« オーボエ吹いて考え事。 | トップページ | smf2mml version 1.02 リリース »

2009/04/29

ちょ・・・

こういうコードをC++で書いたんだ。
*MMLは、ファイルの標準出力クラスを継承したクラス。


  *MML << "//--------------------------------------" << endl
    << "//    SMF2MML" << endl
    << "//--------------------------------------" << endl
    << "//MThd Infomation :" << endl
    << "//	Size = " << SMF_Header.size << endl
    << "//	Format = " << (unsigned int)SMF_Header.format << endl
    << "//	Track = " << (unsigned int)SMF_Header.track << endl
    << "//" << endl
    << "System.ControllerShift = 0;" << endl
    << "System.TimeBase = "<< SMF_Header.timebase << ";" << endl
    << endl << endl << endl;

したら、こんなコードはきやがった


  00009	8b 47 04	 mov	 eax, DWORD PTR [edi+4]
  0000c	85 c0		 test	 eax, eax
  0000e	74 05		 je	 SHORT $LN5@Header
  00010	83 c0 08	 add	 eax, 8
  00013	eb 02		 jmp	 SHORT $LN6@Header
$LN5@Header:
  00015	33 c0		 xor	 eax, eax
$LN6@Header:
  00017	8b 0d 00 00 00
	00		 mov	 ecx, DWORD PTR __imp_?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z
  0001d	51		 push	 ecx
  0001e	8b d1		 mov	 edx, ecx
  00020	52		 push	 edx
  00021	51		 push	 ecx
  00022	0f b7 4f 38	 movzx	 ecx, WORD PTR [edi+56]
  00026	52		 push	 edx
  00027	68 00 00 00 00	 push	 OFFSET $SG-4848
  0002c	51		 push	 ecx
  0002d	68 00 00 00 00	 push	 OFFSET $SG-4849
  00032	52		 push	 edx
  00033	68 00 00 00 00	 push	 OFFSET $SG-4850
  00038	8b ca		 mov	 ecx, edx
  0003a	51		 push	 ecx
  0003b	0f b7 4f 36	 movzx	 ecx, WORD PTR [edi+54]
  0003f	68 00 00 00 00	 push	 OFFSET $SG-4851
  00044	52		 push	 edx
  00045	51		 push	 ecx
  00046	51		 push	 ecx
  00047	0f b7 4f 34	 movzx	 ecx, WORD PTR [edi+52]
  0004b	68 00 00 00 00	 push	 OFFSET $SG-4852
  00050	52		 push	 edx
  00051	51		 push	 ecx
  00052	51		 push	 ecx
  00053	8b 4f 30	 mov	 ecx, DWORD PTR [edi+48]
  00056	68 00 00 00 00	 push	 OFFSET $SG-4853
  0005b	52		 push	 edx
  0005c	51		 push	 ecx
  0005d	51		 push	 ecx
  0005e	68 00 00 00 00	 push	 OFFSET $SG-4854
  00063	52		 push	 edx
  00064	68 00 00 00 00	 push	 OFFSET $SG-4855
  00069	8b ca		 mov	 ecx, edx
  0006b	51		 push	 ecx
  0006c	68 00 00 00 00	 push	 OFFSET $SG-4856
  00071	52		 push	 edx
  00072	68 00 00 00 00	 push	 OFFSET $SG-4857
  00077	51		 push	 ecx
  00078	68 00 00 00 00	 push	 OFFSET $SG-4858
  0007d	50		 push	 eax
  0007e	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  00083	83 c4 08	 add	 esp, 8
  00086	8b c8		 mov	 ecx, eax
  00088	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  0008e	50		 push	 eax
  0008f	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  00094	83 c4 08	 add	 esp, 8
  00097	8b c8		 mov	 ecx, eax
  00099	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  0009f	50		 push	 eax
  000a0	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  000a5	83 c4 08	 add	 esp, 8
  000a8	8b c8		 mov	 ecx, eax
  000aa	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  000b0	50		 push	 eax
  000b1	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  000b6	83 c4 08	 add	 esp, 8
  000b9	8b c8		 mov	 ecx, eax
  000bb	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  000c1	50		 push	 eax
  000c2	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  000c7	83 c4 0c	 add	 esp, 12			; 0000000cH
  000ca	8b c8		 mov	 ecx, eax
  000cc	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z
  000d2	8b c8		 mov	 ecx, eax
  000d4	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  000da	50		 push	 eax
  000db	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  000e0	83 c4 0c	 add	 esp, 12			; 0000000cH
  000e3	8b c8		 mov	 ecx, eax
  000e5	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z
  000eb	8b c8		 mov	 ecx, eax
  000ed	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  000f3	50		 push	 eax
  000f4	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  000f9	83 c4 0c	 add	 esp, 12			; 0000000cH
  000fc	8b c8		 mov	 ecx, eax
  000fe	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z
  00104	8b c8		 mov	 ecx, eax
  00106	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  0010c	50		 push	 eax
  0010d	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  00112	83 c4 08	 add	 esp, 8
  00115	8b c8		 mov	 ecx, eax
  00117	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  0011d	50		 push	 eax
  0011e	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  00123	83 c4 08	 add	 esp, 8
  00126	8b c8		 mov	 ecx, eax
  00128	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  0012e	50		 push	 eax
  0012f	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  00134	83 c4 08	 add	 esp, 8
  00137	8b c8		 mov	 ecx, eax
  00139	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z
  0013f	50		 push	 eax
  00140	e8 00 00 00 00	 call	 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<< >
  00145	83 c4 08	 add	 esp, 8
  00148	8b c8		 mov	 ecx, eax
  0014a	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  00150	8b c8		 mov	 ecx, eax
  00152	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  00158	8b c8		 mov	 ecx, eax
  0015a	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
  00160	8b c8		 mov	 ecx, eax
  00162	ff 15 00 00 00
	00		 call	 DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z


PUSHオオスギ。


Z80時代からアセンブリ言語さわってると、これで良いのか?とか思ってしまった。

|

« オーボエ吹いて考え事。 | トップページ | smf2mml version 1.02 リリース »

コメント

コメントを書く



(ウェブ上には掲載しません)




トラックバック

この記事のトラックバックURL:
http://app.cocolog-nifty.com/t/trackback/36969/44834113

この記事へのトラックバック一覧です: ちょ・・・:

« オーボエ吹いて考え事。 | トップページ | smf2mml version 1.02 リリース »