feat: mise à jour du code pour compilation sur LZASM en stdcall

This commit is contained in:
Nicolas Hordé 2007-03-24 19:39:03 +00:00
parent 35af9ebbed
commit 1742c77553
1 changed files with 129 additions and 163 deletions

View File

@ -1,160 +1,122 @@
.model tiny model tiny,stdcall
.486 p586N
smart locals
.code jumps
codeseg
option procalign:byte
include "..\include\mem.h"
include "..\include\divers.h"
org 0h org 0h
include ..\include\mem.h
start: start:
header exe <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
mov ah,28h call [savestate]
int 47h push 0FFFFh
pushd 652201
push word ptr 0FFFFh pushd 1545454545
push dword ptr 652201 push 1523
push dword ptr 1545454545 push 2041
push word ptr 1523 push offset zero
push word ptr 2041 push offset fixe
push offset zero push 5
push offset fixe push 'i'
push word ptr 5 push 'a'
push word ptr 'i' pushd 5041
push word ptr 'a' pushd 125645
push dword ptr 5041 pushd 5041
push dword ptr 125645 pushd 125645
push dword ptr 5041 pushd 5041
push dword ptr 125645 pushd 125645
push dword ptr 5041 push offset message
push dword ptr 125645 call [print]
push offset message xor ax,ax
call [print] int 16h
mov ax,0 call [clearscreen]
int 16h call [xchgpages]
call [clearscreen]
mov ah,2 mov cx,200
int 47h
mov ah,30
int 47h
mov ah,2
int 47h
mov cx,200
go1: go1:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo1
int 47 call put
push offset textdemo1 call [xchgpages]
call [print] call [waitretrace]
call put dec cx
mov ah,30 jnz go1
int 47h mov cx,200
mov ah,33
int 47h
dec cx
jnz go1
mov cx,200
go2: go2:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo2
int 47h call put
push offset textdemo2 call [xchgpages]
call [print] call [waitretrace]
call put dec cx
mov ah,30 jnz go2
int 47h mov cx,200
mov ah,33
int 47h
dec cx
jnz go2
mov cx,200
go3: go3:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo3
int 47h call put
push offset textdemo3 call [xchgpages]
call [print] call [waitretrace]
call put dec cx
mov ah,30 jnz go3
int 47h call [xchgpages]
mov ah,33 call [clearscreen]
int 47h call [print],offset texte2
dec cx call [xchgpages]
jnz go3 call [clearscreen]
call [xchgpages]
mov ah,30 mov bp,255
int 47h xor edx,edx
mov ah,2
int 47h
push offset texte2
call [print]
mov ah,30
int 47h
mov ah,2
int 47h
mov ah,30
int 47h
mov bp,255
xor edx,edx
go4: go4:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 inc edx
int 47h push edx
inc edx push offset texte3
push edx call [print]
push offset texte3 call [xchgpages]
call [print] call [waitretrace]
mov ah,30 dec bp
int 47h jnz go4
mov ah,33 push offset texte4
int 47h call [print]
dec bp mov ax,0
jnz go4 int 16h
push offset texte4 call [restorestate]
call [print] retf
mov ax,0
int 16h
mov ah,29h
int 47h
retf
put: put:
call random call random
mov di,dx mov di,dx
and di,4096-2 and di,4096-2
mov si,offset fond mov si,offset fond
call showstring2 call showstring2
ret ret
random:
Random: push ax
push ax MOV AX,[cs:randseed]
MOV AX,cs:[RandSeed] MOV DX,8405h
MOV DX,8405h MUL DX
MUL DX INC AX
INC AX MOV [cs:randseed],AX
MOV cs:[RandSeed],AX pop ax
pop ax ret
ret
randseed dw 1234h randseed dw 1234h
Randomize: Randomize:
push ax cx dx push ax cx dx
mov ah,0 mov ah,0
int 1ah int 1ah
mov cs:randseed,dx mov [cs:randseed],dx
pop dx cx ax pop dx cx ax
ret ret
zero db 'Chaine a zro terminal',0 zero db 'Chaine a zro terminal',0
fixe db 20,'Chaine a taille fixe' fixe db 20,'Chaine a taille fixe'
@ -179,25 +141,29 @@ texte3 db '\c04%bD\l',0
texte4 db '\g01,00Sauvegarde et restauration de l''ecran (%%s/%%r)',0 texte4 db '\g01,00Sauvegarde et restauration de l''ecran (%%s/%%r)',0
showstring2: showstring2:
push es bx cx si di push es bx cx si di
add di,4000 add di,4000
mov bx,0B800h mov bx,0B800h
mov es,bx mov es,bx
mov bl,[si] mov bl,[si]
mov ch,3 mov ch,3
strinaize4: strinaize4:
inc si inc si
mov cl,[si] mov cl,[si]
mov es:[di],cx mov [es:di],cx
add di,2 add di,2
dec bl dec bl
jnz strinaize4 jnz strinaize4
pop di si cx bx es pop di si cx bx es
ret ret
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start importing
use VIDEO.LIB,print
use VIDEO,xchgpages
use VIDEO,setvideomode
use VIDEO,clearscreen
use VIDEO,savestate
use VIDEO,restorestate
use VIDEO,waitretrace
endi