English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

請問大大組語算低階語言!我現在可以把vb轉成組語!
那我是不是可以把組語的程式碼經過組譯成為執行檔?那組譯成的執行檔和我用vb寫的功能是一樣的ㄋ?

2007-01-26 11:41:33 · 2 個解答 · 發問者 5 in 電腦與網際網路 程式設計

例如我用vb寫一個程序如下:
Private Sub Form_Load()
MsgBox "123"
End Sub

2007-01-26 11:42:09 · update #1

我編譯成組語為下:

2007-01-26 11:43:24 · update #2

(因為內容太長有300字的限制所以我分段)
TITLEC:\Documents and Settings\students\桌面\新資料夾 (2)\Form1.frm
.386P
include listing.inc
if @Version gt 510
.model FLAT
else

2007-01-26 11:45:43 · update #3

_TEXTSEGMENT PARA USE32 PUBLIC 'CODE'
_TEXTENDS
_DATASEGMENT DWORD USE32 PUBLIC 'DATA'
_DATAENDS
CONSTSEGMENT DWORD USE32 PUBLIC 'CONST'
CONSTENDS

2007-01-26 11:46:25 · update #4

_BSSSEGMENT DWORD USE32 PUBLIC 'BSS'
_BSSENDS
_TLSSEGMENT DWORD USE32 PUBLIC 'TLS'
_TLSENDS
text$1SEGMENT PARA USE32 PUBLIC ''
text$1ENDS
;COMDAT ?Form_Load@Form1@@AAGXXZ
text$1SEGMENT PARA USE32 PUBLIC ''
text$1ENDS

2007-01-26 11:46:47 · update #5

FLATGROUP _DATA, CONST, _BSS
ASSUMECS: FLAT, DS: FLAT, SS: FLAT
endif
PUBLIC?Form_Load@Form1@@AAGXXZ; Form1::Form_Load
EXTRN__imp____vba@001CF784:NEAR
EXTRN__imp_@__vbaVarDup:NEAR
EXTRN___vba@001DFB2C:BYTE
EXTRN__imp____vbaFreeVarList:NEAR

2007-01-26 11:47:44 · update #6

EXTRN___vbaExceptHandler:NEAR
EXTRN__except_list:DWORD
;COMDAT CONST
; File C:\Documents and Settings\students\桌面\新資料夾 (2)\Form1.frm
CONSTSEGMENT
$S32DB05H, 00H
DB08H, 00H
DDFLAT:$L31
DB00H, 00H, 00H, 00H
DDFLAT:$L30
CONSTENDS

2007-01-26 11:48:19 · update #7

;COMDAT ?Form_Load@Form1@@AAGXXZ
text$1SEGMENT
_Me$ = 8
_unnamed_var1$ = -36
_unnamed_var1$ = -52
_unnamed_var1$ = -68
_unnamed_var1$ = -84
_unnamed_var1$ = -100
__$SEHRec$ = -20
?Form_Load@Form1@@AAGXXZ PROC NEAR; Form1::Form_Load, COMDAT

2007-01-26 11:48:43 · update #8

; 20 : Private Sub Form_Load()

pushebp
movebp, esp
subesp, 12; 0000000cH
pushOFFSET FLAT:___vbaExceptHandler
moveax, DWORD PTR fs:__except_list
pusheax
movDWORD PTR fs:__except_list, esp
subesp, 136; 00000088H
pushebx

2007-01-26 11:49:54 · update #9

pushesi
pushedi
movDWORD PTR __$SEHRec$[ebp 8], esp
movDWORD PTR __$SEHRec$[ebp 12], OFFSET FLAT:$S32
moveax, DWORD PTR _Me$[ebp]
movecx, eax
andecx, 1
movDWORD PTR __$SEHRec$[ebp 16], ecx

2007-01-26 11:50:42 · update #10

andal, -2; fffffffeH
pusheax
movDWORD PTR _Me$[ebp], eax
movedx, DWORD PTR [eax]
callDWORD PTR [edx 4]

2007-01-26 11:50:56 · update #11

; 21 : MsgBox "123"

movecx, -2147352572; 80020004H
xoresi, esi
movDWORD PTR _unnamed_var1$[ebp 8], ecx
moveax, 10; 0000000aH
movDWORD PTR _unnamed_var1$[ebp 8], ecx
movDWORD PTR _unnamed_var1$[ebp 8], ecx
movDWORD PTR _unnamed_var1$[ebp], esi

2007-01-26 11:51:35 · update #12

movDWORD PTR _unnamed_var1$[ebp], esi
movDWORD PTR _unnamed_var1$[ebp], esi
movDWORD PTR _unnamed_var1$[ebp], esi
leaedx, DWORD PTR _unnamed_var1$[ebp]
leaecx, DWORD PTR _unnamed_var1$[ebp]
movDWORD PTR _unnamed_var1$[ebp], esi
movDWORD PTR _unnamed_var1$[ebp], eax

2007-01-26 11:52:02 · update #13

movDWORD PTR _unnamed_var1$[ebp], eax
movDWORD PTR _unnamed_var1$[ebp], eax
movDWORD PTR _unnamed_var1$[ebp 8], OFFSET FLAT:___vba@001DFB2C
movDWORD PTR _unnamed_var1$[ebp], 8
callDWORD PTR __imp_@__vbaVarDup
leaeax, DWORD PTR _unnamed_var1$[ebp]

2007-01-26 11:52:39 · update #14

leaecx, DWORD PTR _unnamed_var1$[ebp]
pusheax
leaedx, DWORD PTR _unnamed_var1$[ebp]
pushecx
pushedx
leaeax, DWORD PTR _unnamed_var1$[ebp]
pushesi

2007-01-26 11:52:55 · update #15

pusheax
callDWORD PTR __imp____vba@001CF784
leaecx, DWORD PTR _unnamed_var1$[ebp]
leaedx, DWORD PTR _unnamed_var1$[ebp]
pushecx
leaeax, DWORD PTR _unnamed_var1$[ebp]
pushedx
leaecx, DWORD PTR _unnamed_var1$[ebp]
pusheax
pushecx
push4

2007-01-26 11:53:09 · update #16

callDWORD PTR __imp____vbaFreeVarList
addesp, 20; 00000014H

; 22 : End Sub

movDWORD PTR __$SEHRec$[ebp 16], esi
$L31:
push$L49
jmpSHORT $L44

2007-01-26 11:53:45 · update #17

$L30:
leaedx, DWORD PTR _unnamed_var1$[ebp]
leaeax, DWORD PTR _unnamed_var1$[ebp]
pushedx
leaecx, DWORD PTR _unnamed_var1$[ebp]
pusheax
leaedx, DWORD PTR _unnamed_var1$[ebp]
pushecx

2007-01-26 11:54:03 · update #18

pushedx
push4
callDWORD PTR __imp____vbaFreeVarList
addesp, 20; 00000014H
ret0

2007-01-26 11:54:28 · update #19

2 個解答

兩者執行的内容是一定要一樣,不然那解譯後的組合語言(Native code,俗稱機械碼)就應該算是錯誤的結果
兩者的差別在於執行的速度

VB的執行也是要用到Native code,過程大概是
VB指令翻譯成虛擬碼(pseudo code)
虛擬碼 由各作業平臺轉成對應的 native code
native code 送到 cpu執行

你所看到的組合語言只是先變成native code,省去VB執行啓動後的轉譯過程

那為什麽不先編譯成組合語言的碼,原因在於跨平臺的考慮
在不同的cpu或作業平臺,如果想執行編譯成組合語言的碼,那就會有不相容的問題,所以不同的平臺只需要給不同的轉譯程式就可以了

而且那組合語言也不完全能獨立執行,因為它還要有VB的 runtime library(執行VB時的程式庫)配合,用以提供必要的平臺功能

我認爲除非您程式的執行不能滿足速度或容量的要求,否則是沒必要再去研究它的組合語言

但如果你對組合語言有興趣,那就另當別論了,可能由C++的路會好一點

再如果你是在破譯某軟体,那對於語言的編譯連結(link)的研究是免不了的

2007-02-05 16:48:32 · answer #1 · answered by OriginRain 4 · 0 0

要看你將VB反組譯的軟體是否有能力再組譯回去?

通常VB編譯過後的碼是 "虛" 的,不是真正的機械碼。

另外,這些碼有很多是虛擬指令 ( 試試用MASM編譯 ) ,得再整理過CPU才肯吃哦。

2007-02-09 01:34:31 · answer #2 · answered by 詹姆士龐德 5 · 0 0

fedest.com, questions and answers