First commit

This commit is contained in:
Alberto Venturini 2014-01-27 10:02:18 +01:00
commit 7d6d50e432
50 changed files with 5737 additions and 0 deletions

115
PROGRAMS/ALBLUR/ALBLUR.ASM Normal file
View file

@ -0,0 +1,115 @@
;Coded by: Albe
;-albe-@libero.it
;"Al-blur" written for #asm 128 bytes competition
;
;2/11/2000
;
org 0h
main:
mov al,13h ;set vga mode 13h
int 10h
mov dx,3c9h ;palette register
;this palette routine only affects color >= 13, but i don't care...
palette3:
dec dx ;dec and inc save some bytes instead of
;"mov dx,3c9h", "mov dx,3c8h"
out dx,al
inc dx
push ax ;saves ax
xor al,al
out dx,al ;don't set red...
out dx,al ;don't set green!
pop ax
push ax
cmp al,210 ;the first 210 colors are the same (dark blu)
ja pal5
mov al,15 ;set dark blu (15)
pal5:
out dx,al ;set blu
pop ax
inc al
jnz palette3
mov ah,00h
mov dx,64
int 23h ;allocate memory
push es
pop ds
mov ax,0a000h
mov es,ax
mov bp,317 ;we need to add 317 to SI 2 times, and using
;lea si,[si+bp] is better (saves 1 byte)
a2:
cbw ;AL here is always 0, so cbw will set AX to 0
cwd ;AX here is always 0, so cwd will set DX to 0
push si ;save current position
sub si,321
call loadsb
lea si,[si+bp]
lodsb
add dx,ax
inc si
lodsb
add dx,ax
lea si,[si+bp]
call loadsb
pop si
shr dx,3 ;calculate the average of pixels around
inc dx ;2 "inc"s save 1 byte (instead of add dx,2)
inc dx
a4:
mov byte ptr ds:[si],dl ;store the pixel
inc si
jnz a2
mov dx,3dah ;this is waitretrace
l1:
in al,dx
and al,08h
jnz l1
l2:
in al,dx
and al,08h
jz l2
mov cx,0ffffh/2+1
rep movsw ;copy mem to mem
mov ah,11h
int 16h ;key pressed?
jz a2
mov ah,00h
int 16h
push ds ;free mem
pop es
mov dx,64
mov ah,01h
int 23h
mov ax,0003h
int 10h
mov ah,02h
mov bl,0
int 20h
loadsb proc
lodsb
add dx,ax
lodsb
add dx,ax
lodsb
add dx,ax
ret
loadsb endp

BIN
PROGRAMS/ALBLUR/ALBLUR.BIN Normal file

Binary file not shown.

BIN
PROGRAMS/ALBLUR/ALBLUR.SYM Normal file

Binary file not shown.

BIN
PROGRAMS/FIRE/ELINK.EXE Normal file

Binary file not shown.

53
PROGRAMS/FIRE/GRAPH32.ASM Normal file
View file

@ -0,0 +1,53 @@
.386
Code segment
assume cs:Code
Main proc
mov ah,03h
mov dx,64
int 2fh
xor ax,ax
mov es,ax
mov ax,0401h
mov cx,32768
push edi
Main1:
mov es:[edi],ax
add edi,2
loop Main1
pop edi
mov ax,0013h
int 10h
mov esi,0a0000h
mov cx,32768
Main2:
mov ax,es:[edi]
mov es:[esi],ax
add edi,2
add esi,2
loop Main2
mov ah,00h
int 25h
mov ax,0003h
int 10h
mov ah,02h
mov bl,0
int 20h
Main endp
Code ends
end

BIN
PROGRAMS/FIRE/GRAPH32.BIN Normal file

Binary file not shown.

191
PROGRAMS/FIRE/MYFIRE.ASM Normal file
View file

@ -0,0 +1,191 @@
;Fire effect for NXOS
org 0h
main:
mov al,13h
int 10h
xor cx,cx
p1:
mov ah,cl
mov bh,cl
shr bh,2
call setpal
inc cx
cmp cx,11
jne p1
p2:
mov ah,cl
mov bh,4
call setpal
inc cx
cmp cx,21
jne p2
p3:
mov ah,cl
mov bl,cl
sub bl,20
mov bh,4
call setpal
inc cx
cmp cx,64
jne p3
p4:
mov ah,63
mov bl,cl
sub bl,20
mov bh,2
call setpal
inc cx
cmp cx,84
jne p4
p5:
mov bl,63
xor bh,bh
call setpal
inc cx
cmp cx,101
jne p5
p6:
mov bh,63
call setpal
inc cl
test cl,cl
jne p6
setseg:
; mov ax,8000h ;some free memory...somewhere...
; mov es,ax
; mov cx,32000 ;let's free this mem!
mov dx,64 ;allocate memory
mov ah,00h
int 23h
xor di,di
mov ch,7dh
xor ax,ax
rep stosw ;free it
push es
pop ds
mov ax,0a000h
mov es,ax
l0:
mov cx,220
l1:
push cx
mov bx,320
call random
pop cx
l2:
add ax,64320
mov si,ax
mov al,255
mov ds:[si],al
dec cx
jnz l1
xor si,si
fireup: ;the fire algorythm
xor ax,ax
; cwd
xor dx,dx ;xor is faster...
mov al,byte ptr ds:[si-640]
add dx,ax
mov al,byte ptr ds:[si-1]
add dx,ax
mov al,byte ptr ds:[si+1]
add dx,ax
mov al,byte ptr ds:[si+320]
add dx,ax
shr dx,2
mov byte ptr ds:[si-320],dl
mov byte ptr ds:[si-640],dl
inc si
jnz fireup
mov cx,((64000-960)/2)
f1:
mov ax,word ptr ds:[si]
mov word ptr es:[si],ax
add si,2
dec cx
jnz f1
mov ah,11h
int 16h
jz l0
mov ah,00h
int 16h
mov ah,01h
mov dx,64
push ds
pop es
int 23h
mov ax,0003h
int 10h
mov ah,02h
mov bl,0
int 20h
;------------------------------------------------------------------------------
setpal:
;input cl=color
;ah=red
;bl=green
;bh=blu
mov dx,3c8h
mov al,cl
out dx,al
inc dx
mov al,ah
out dx,al
mov al,bl
out dx,al
mov al,bh
out dx,al
ret
;------------------------------------------------------------------------------
random:
;input BX=max num
push es
xor ax,ax
mov es,ax
mov ax,cs:cont
mov cx,cs:a1
mov dx,cs:a2
add ax,dx
add cx,es:[3083]
sub dx,es:[3083]
add dx,cx
mov cs:cont,ax
mov cs:a1,cx
mov cs:a2,dx
and ax,11111111111b
l1_r:
cmp ax,bx
jbe fine_r
sub ax,bx
jmp l1_r
fine_r:
pop es
ret
;------------------------------------------------------------------------------
a1 dw 10001
a2 dw 101
cont dw 23923

BIN
PROGRAMS/FIRE/MYFIRE.BIN Normal file

Binary file not shown.

BIN
PROGRAMS/FIRE/MYFIRE.SYM Normal file

Binary file not shown.

229
PROGRAMS/FIRE/MYFIRE32.ASM Normal file
View file

@ -0,0 +1,229 @@
.386
;Fire effect for NXOS
Code segment
assume cs:Code
org 0h
main proc
mov al,13h
int 10h
xor cx,cx
p1:
mov ah,cl
mov bh,cl
shr bh,2
call setpal
inc cx
cmp cx,11
jne p1
p2:
mov ah,cl
mov bh,4
call setpal
inc cx
cmp cx,21
jne p2
p3:
mov ah,cl
mov bl,cl
sub bl,20
mov bh,4
call setpal
inc cx
cmp cx,64
jne p3
p4:
mov ah,63
mov bl,cl
sub bl,20
mov bh,2
call setpal
inc cx
cmp cx,84
jne p4
p5:
mov bl,63
xor bh,bh
call setpal
inc cx
cmp cx,101
jne p5
p6:
mov bh,63
call setpal
inc cl
test cl,cl
jne p6
setseg:
; mov ax,8000h ;some free memory...somewhere...
; mov es,ax
; mov cx,32000 ;let's free this mem!
; mov dx,64 ;allocate memory
; mov ah,00h
; int 23h
mov ah,03h
mov dx,64
int 2fh
; xor di,di
;
; mov ch,7dh
; xor ax,ax
; rep stosw ;free it
; push es
; pop ds
mov cs:[BaseOfst],edi
xor ax,ax
mov es,ax
mov ds,ax
mov cx,32768
freemem1:
mov es:[edi],ax
add edi,2
loop freemem1
mov ax,0a000h
mov es,ax
xor eax,eax
l0:
mov esi,cs:[BaseOfst]
xor edi,edi
mov cx,220
l1:
push cx
mov bx,320
call random
pop cx
l2:
add ax,64320
; mov esi,eax
push esi
add esi,eax
mov al,255
mov ds:[esi],al
pop esi
dec cx
jnz l1
xor esi,esi
fireup: ;the fire algorythm
xor ax,ax
; cwd
xor dx,dx ;xor is faster...
mov al,byte ptr ds:[esi-640]
add dx,ax
mov al,byte ptr ds:[esi-1]
add dx,ax
mov al,byte ptr ds:[esi+1]
add dx,ax
mov al,byte ptr ds:[esi+320]
add dx,ax
shr dx,2
mov byte ptr ds:[esi-320],dl
mov byte ptr ds:[esi-640],dl
inc esi
jnz fireup
mov cx,((64000-960)/2)
f1:
mov ax,word ptr ds:[esi]
mov word ptr es:[di],ax
add esi,2
add di,2
dec cx
jnz f1
mov ah,11h
int 16h
jz l0
mov ah,00h
int 16h
; mov ah,01h
; mov dx,64
; push ds
; pop es
; int 23h
mov ax,0003h
int 10h
mov ah,02h
mov bl,0
int 20h
main endp
;------------------------------------------------------------------------------
setpal:
;input cl=color
;ah=red
;bl=green
;bh=blu
mov dx,3c8h
mov al,cl
out dx,al
inc dx
mov al,ah
out dx,al
mov al,bl
out dx,al
mov al,bh
out dx,al
ret
;------------------------------------------------------------------------------
random:
;input BX=max num
push es
xor ax,ax
mov es,ax
mov ax,cs:cont
mov cx,cs:a1
mov dx,cs:a2
add ax,dx
add cx,es:[3083]
sub dx,es:[3083]
add dx,cx
mov cs:cont,ax
mov cs:a1,cx
mov cs:a2,dx
and ax,11111111111b
l1_r:
cmp ax,bx
jbe fine_r
sub ax,bx
jmp l1_r
fine_r:
pop es
ret
;------------------------------------------------------------------------------
a1 dw 10001
a2 dw 101
cont dw 23923
BaseOfst dd ?
code ends
end

BIN
PROGRAMS/FIRE/MYFIRE32.BIN Normal file

Binary file not shown.

BIN
PROGRAMS/FIRE/graph32.OBJ Normal file

Binary file not shown.

BIN
PROGRAMS/FIRE/myfire32.OBJ Normal file

Binary file not shown.

View file

@ -0,0 +1,103 @@
;Screen saver per NXOS
;---------------------
org 0h
Main:
call Randomize
Loop1:
mov bx,79
mov ax,11111111b
call Random
mov dl,al
mov bx,24
mov ax,111111b
call Random
mov dh,al
mov ah,03h
int 20h
mov bx,si
shl bx,8
mov ah,02h
int 10h
mov bx,255
mov ax,00ffh
call Random
push ax
mov bx,15
mov ax,11111b
call Random
mov bl,al
pop ax
mov ah,00h
int 24h
mov ah,01h
int 25h
jz Loop1
mov ah,00h
int 25h
mov ah,02h
mov bl,0
int 20h
;------------------------------------------------------------------------------
randomize:
push dx
mov dx,40h
in ax,dx
mov [cont],ax
pop dx
ret
;------------------------------------------------------------------------------
random:
;input bx=limitation
; ax=bit limitation
;output ax=random num
;(uses ax bx cx)
push ax
mov ax,[cont]
rol ax,3
sub ax,7
xor ax,2
ror ax,1
mov cx,[a1]
add ax,cx
inc cx
mov [a1],cx
mov cx,[a2]
sub ax,cx
sub cx,2
mov [a2],cx
mov [cont],ax
pop cx
and ax,cx
l1_r2:
cmp ax,bx
jbe fine_r2
sub ax,bx
jmp l1_r2
fine_r2:
ret
;------------------------------------------------------------------------------
cont dw ?
a1 dw ?
a2 dw ?

Binary file not shown.

Binary file not shown.

238
PROGRAMS/SHELL/SHELL.ASM Normal file
View file

@ -0,0 +1,238 @@
;NXOS shell
;----------
;Written by: Alberto Venturini (Alb) - 2001
;Email address: -albe-@libero.it
org 0h
cld
Main1:
mov si,offset Prompt ;shows the prompt
mov ah,01h
mov bl,07h
int 24h
mov di,offset Command
xor cx,cx
GetCommand: ;Get a string from the keyboard
mov si,offset Command
mov ah,07h
int 25h
dec si
ToUpCase: ;Turns everything upcase
inc si
mov al,ds:[si]
cmp al,13
je EndCommand
cmp al,90
jbe ToUpCase
sub al,32
mov ds:[si],al
jmp ToUpCase
EndCommand:
test cx,cx ;If only CR was pressed, just re-write the prompt
jz Main1
push cx
mov di,offset Command
Test4Extension: ;tests if file extension is available
mov al,es:[di]
cmp al,'.'
je ExtensionOk
inc di
dec cx
jnz Test4Extension
NoExtension: ;there's no extension...assume it's an internal
;shell command
pop cx
mov di,offset Command
mov cx,3
mov si,offset ClsCmd
push di
rep cmpsb
pop di
je ShellCommand_Cls
mov cx,4
mov si,offset HelpCmd
push di
rep cmpsb
pop di
je ShellCommand_Help
mov ah,01h
mov si,offset Error3
mov bl,7
int 24h
jmp ClearCommandBuffer
ShellCommand_Cls: ;executes the "CLS" command
mov ah,04h
int 24h
jmp ClearCommandBuffer
ShellCommand_Help:
mov si,offset HelpTxt
mov ah,01h
mov bl,7
int 24h
jmp ClearCommandBuffer
ExtensionOk: ;there's the extension
pop cx
StoreExtension: ;store the extension in a buffer ("Extension")
push di
inc di
mov si,di
mov di,offset Extension
movsb
movsb
movsb
pop di
push di
sub di,offset Command
cmp di,8
jb StoreExtension2
pop di ;file name must be <= 8
mov di,offset Command
add di,8
jmp StoreExtension3
StoreExtension2:
mov cx,8
sub cx,di
mov al,' '
pop di
rep stosb
StoreExtension3:
mov si,offset Extension
movsb
movsb
movsb
ExecuteProgram:
mov di,offset Extension
mov si,offset BinExtension
mov cx,3
push di
rep cmpsb ;tests if the extension is "BIN"
pop di
je ExecuteBinProgram
mov si,offset ComExtension
mov cx,3
push di
rep cmpsb
pop di
je ExecuteComProgram
mov ah,01h
mov si,offset Error2
mov bl,7
int 24h
jmp Main1
ExecuteBinProgram:
push es
mov si,offset Command
mov ah,00h
int 20h
test dx,dx
jz FileNotFound
mov bl,0
mov ah,01h
int 20h
pop es
jmp ClearCommandBuffer
ExecuteComProgram:
push es
mov si,offset Command
mov ah,07h
int 20h
test dx,dx
jz FileNotFound
mov bl,0
mov ah,01h
int 20h
pop es
jmp ClearCommandBuffer
FileNotFound:
pop es
mov si,offset Error1
mov ah,01h
mov bl,7
int 24h
ClearCommandBuffer:
mov di,offset Command
mov al,' '
mov cx,95
ClearCommandBuffer2:
mov byte ptr cs:[di],al
inc di
loop ClearCommandBuffer2
jmp Main1
;------------------------------------------------------------------------------
Command db 100 dup (32)
Prompt db 13,10,'Ready:',0
Error1 db 13,10,'File not found',13,10,0
Error2 db 13,10,'Invalid file name',13,10,0
Error3 db 13,10,'Invalid command',13,10,0
NextLine db 13,10,0
Extension db 3 dup (?)
BinExtension db 'BIN',0
ComExtension db 'COM',0
ClsCmd db 'CLS'
HelpCmd db 'HELP'
;------------------------------------------------------------------------------
;Help text
HelpTxt db 13,10,'NXOS shell',13,10
db '-------------',13,10
db 13,10
db 'How to use this shell:',13,10
db 'if you want to execute an external program, just type the',13,10
db 'file name, with his extension.',13,10
db 13,10
db 'Available shell commands:',13,10
db ' CLS: clears the screen',13,10
db ' HELP: shows this screen',13,10,0

BIN
PROGRAMS/SHELL/SHELL.BIN Normal file

Binary file not shown.

BIN
PROGRAMS/SHELL/SHELL.SYM Normal file

Binary file not shown.

BIN
PROGRAMS/SHELL/SHELL2.BIN Normal file

Binary file not shown.

182
PROGRAMS/SHELL/SHELL2.OLD Normal file
View file

@ -0,0 +1,182 @@
;NXOS shell
;----------
;Written by: Alberto Venturini (Alb) - 2001
;Email address: -albe-@libero.it
org 0h
cld
Main1:
mov si,offset Prompt ;shows the prompt
mov ah,01h
mov bl,07h
int 24h
mov di,offset Command
xor cx,cx
GetCommand: ;Get a string from the keyboard
mov si,offset Command
mov ah,07h
int 25h
dec si
ToUpCase: ;Turns everything upcase
inc si
mov al,ds:[si]
cmp al,13
je EndCommand
cmp al,90
jbe ToUpCase
sub al,32
mov ds:[si],al
jmp ToUpCase
EndCommand:
test cx,cx ;If only CR was pressed, just re-write the prompt
jz ClearCommandBuffer
push cx
mov di,offset Command
Test4Extension: ;tests if file extension is available
mov al,es:[di]
cmp al,'.'
je ExtensionOk
inc di
dec cx
jnz Test4Extension
NoExtension: ;there's no extension...assume it's an internal
;shell command
pop cx
mov di,offset Command
mov cx,3
mov si,offset ClsCmd
rep cmpsb
je ShellCommand_Cls
mov ah,01h
mov si,offset Error3
mov bl,7
int 24h
jmp ClearCommandBuffer
ShellCommand_Cls: ;executes the "CLS" command
mov ah,04h
int 24h
jmp ClearCommandBuffer
;[...]
ExtensionOk: ;there's the extension
pop cx
StoreExtension: ;store the extension in a buffer ("Extension")
push di
inc di
mov si,di
mov di,offset Extension
movsb
movsb
movsb
pop di
push di
sub di,offset Command
cmp di,8
jb StoreExtension2
pop di ;file name must be <= 8
mov di,offset Command
add di,8
jmp StoreExtension3
StoreExtension2:
mov cx,8
sub cx,di
mov al,' '
pop di
rep stosb
StoreExtension3:
mov si,offset Extension
movsb
movsb
movsb
ExecuteProgram:
mov di,offset Extension
mov si,offset BinExtension
mov cx,3
rep cmpsb ;tests if the extension is "BIN"
je ExecuteBinProgram
mov ah,01h
mov si,offset Error2
mov bl,7
int 24h
jmp Main1
ExecuteBinProgram:
push es
mov si,offset Command
mov ah,00h
int 20h
test dx,dx
jz FileNotFound
mov bl,0
mov ah,01h
int 20h
pop es
jmp ClearCommandBuffer
FileNotFound:
pop es
mov si,offset Error1
mov ah,01h
mov bl,7
int 24h
ClearCommandBuffer:
mov di,offset Command
mov al,' '
mov cx,95
ClearCommandBuffer2:
mov byte ptr cs:[di],al
inc di
loop ClearCommandBuffer2
jmp Main1
;------------------------------------------------------------------------------
Command db 100 dup (32)
Prompt db 13,10,'Ready:',0
Error1 db 13,10,'File not found',13,10,0
Error2 db 13,10,'Invalid file name',13,10,0
Error3 db 13,10,'Invalid command',13,10,0
NextLine db 13,10,0
Extension db 3 dup (?)
BinExtension db 'BIN',0
ClsCmd db 'CLS'
;------------------------------------------------------------------------------

BIN
PROGRAMS/SHELL/SHELL2.SYM Normal file

Binary file not shown.

View file

@ -0,0 +1 @@
CLEARCOMMAND in shell2.asm