here's code that finds the maximum value in an array
of bytes.
bits 16
org 100h
start:
Mov bx, arr
mov al, [bx]
xor di, di
inc di
start_l:
Cmp byte [bx+di], 0
jz exit
cmp al, [bx+di]
jb swap
return:
Inc di
jmp start_l
swap:
Mov al, [bx+di]
jmp return
exit:
Xor ah, ah
call disphex
int 0x20
arr db 2, 3, 1, 0
disphex:
Push ax
shr ax, 8
call dispbyte
pop ax
push ax
and ax, 0xff
call dispbyte
pop ax
ret
dispbyte:
Push ax
shr al, 4
call dispasc
pop ax
push ax
and al, 0xf
call dispasc
pop ax
ret
dispasc:
Push ax
push dx
add al, 0x30
cmp al, 0x39
jle dispasc_e
add al, 0x7
dispasc_e:
Mov dl, al
mov ah, 2
int 0x21
pop dx
pop ax
ret
heres a dos debug prog which makes a fractal.
N fractal.com
a
xor ax,ax
mov ax,0002
int 12
mov ah,00
mov al,13
int 10
xor ax,ax
mov ax,4f02
mov bx,0100
int 10
mov ax,a000
mov es,ax
loop 011c
xor di,di
xor dx,dx
wait
finit
fld dword ptr [01ae]
fstp dword ptr [01be]
xor bx,bx
fld dword ptr [01aa]
fstp dword ptr [01ba]
wait
finit
fldz
fldz
mov cx,0040
fld st(0)
fmul st,st(0)
fxch st(1)
fmul st,st(2)
fadd st,st(0)
fxch st(2)
fmul st,st(0)
fsubp st(1),st
fxch st(1)
fadd dword ptr [01be]
fxch st(1)
fadd dword ptr [01ba]
fld st(1)
fmul st,st(0)
fld st(1)
fmul st,st(0)
faddp st(1),st
fsqrt
fistp word ptr [01c2]
cmp word ptr [01c2],+02
ja 0176
loop 0141
mov al,cl
stosb
fld dword ptr [01ba]
fadd dword ptr [01b2]
fstp dword ptr [01ba]
inc bx
cmp bx,0140
jb 0137
fld dword ptr [01be]
fsub dword ptr [01b6]
fstp dword ptr [01be]
inc dx
cmp dx,00c8
jb 012d
xor ah,ah
int 16
mov ax,0003
int 10
int 20
int cc
or al,c0
add [bx+si],al
mov al,[9a3f]
cwd
sbb [si],di
int cc
dec sp
cmp al,8b
r cx
100
w
q
i have a problem though. I want only one on the screen in the same resolution which it is currently? Any suggestions?
Thank you very much if you can help, and also for trying...
Also, how do you get your posted code in those funky colors?
Much appreciated.