我要用汇编语言将十进制转换为2进制错在什么地方了?
program HelloWorld;
#include( "stdlib.hhf" )
static
a:int32;
procedure change;@noframe;
begin change;
push(ebp);
mov(esp,ebp);
sub(4,esp);
push(eax);
push(ecx);
push(edx);
push(esi);
mov([ebp+8],eax);
mov(0,edx);
mov(2,(type int32[ebp-4]));
L2: div((type int32[ebp-4]));
push(edx);
inc(ecx);
cmp(eax,0);
ja L2;
L3: pop(edx);
stdout.put(edx);
dec(ecx);
cmp(edx,0);
ja L3;
pop(eax);
pop(ecx);
pop(edx);
pop(esi);
mov(ebp,esp);
pop(ebp);
ret(4);
end change;
begin HelloWorld;
stdout.put( "请输入一个整数:", nl, nl );
stdin.get(a);
mov(a,ebx);
cmp(ebx,0);
jb L1;
mov(1,esi);
push(ebx);
L1: mov(-1,esi);
fabs();
call change;
stdout.put( "Press enter to continue: " );
stdin.readLn();
end HelloWorld;
//*****************************************************************************
program HelloWorld;
#include( "stdlib.hhf" )
static
a:int32;
procedure sort;@noframe;
begin sort;
push(ebp);
mov(esp,ebp);
push(eax);
push(ebx);
push(ecx);
push(edx);
mov(a,eax);
mov(2,(type uns32[ebp+8]));
L1: mov(0,edx);
div(ebx);
push(edx);
cmp(eax,0);
ja L1;
stdout.put(eax);
pop(edx);
pop(ecx);
pop(ebx);
pop(eax);
mov(ebp,esp);
pop(ebp);
ret(8);
end sort;
begin HelloWorld;
stdout.put( "Hello, World of Assembly Language:", nl, nl );
stdin.get(a);
mov(a,eax);
call sort;
stdout.put( "Press enter to continue: " );
stdin.readLn();
end HelloWorld;
/****************************************************************************/