回 帖 发 新 帖 刷新版面

主题:急急急。。。如何编译。。。

这是一段汇编代码。。但我怎么也过不了编译。。
我不知道用什么编译器。。。masm  nasm fasm 都试过。。。。可惜。。
代码来源。。。我想代码不会错
http://www.emu8086.com/dr/asm2html/assembler_source_code/
   
; 2_sample.asm 

name "add-sub"

org 100h

mov al, 5       ; bin=00000101b 
mov bl, 10      ; hex=0ah or bin=00001010b 

; 5 + 10 = 15 (decimal) or hex=0fh or bin=00001111b 
add bl, al

; 15 - 1 = 14 (decimal) or hex=0eh or bin=00001110b 
sub bl, 1

; print result in binary: 
mov cx, 8
print: mov ah, 2   ; print function. 
       mov dl, '0'
       test bl, 10000000b  ; test first bit. 
       jz zero
       mov dl, '1'
zero:  int 21h
       shl bl, 1
loop print

; print binary suffix: 
mov dl, 'b'
int 21h

; wait for any key press: 
mov ah, 0
int 16h

ret







; - other assembly language source codes - 




; - asm2html by emu8086 -

回复列表 (共2个回复)

沙发

我用RADASM编译了,一切正常

板凳

先问一下,你是用什么来编译的?
还有,你的数据段,代码段的声明那里去了?

我来回复

您尚未登录,请登录后再回复。点此登录或注册