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,133 +1,98 @@
.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 word ptr 2041
push offset zero push offset zero
push offset fixe push offset fixe
push word ptr 5 push 5
push word ptr 'i' push 'i'
push word ptr 'a' push 'a'
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 pushd 5041
push dword ptr 125645 pushd 125645
push offset message push offset message
call [print] call [print]
mov ax,0 xor ax,ax
int 16h int 16h
call [clearscreen]
mov ah,2 call [xchgpages]
int 47h call [clearscreen]
mov ah,30
int 47h
mov ah,2
int 47h
mov cx,200 mov cx,200
go1: go1:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo1
int 47
push offset textdemo1
call [print]
call put call put
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
dec cx dec cx
jnz go1 jnz go1
mov cx,200 mov cx,200
go2: go2:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo2
int 47h
push offset textdemo2
call [print]
call put call put
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
dec cx dec cx
jnz go2 jnz go2
mov cx,200 mov cx,200
go3: go3:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33 call [print],offset textdemo3
int 47h
push offset textdemo3
call [print]
call put call put
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
dec cx dec cx
jnz go3 jnz go3
call [xchgpages]
mov ah,30 call [clearscreen]
int 47h call [print],offset texte2
mov ah,2 call [xchgpages]
int 47h call [clearscreen]
push offset texte2 call [xchgpages]
call [print]
mov ah,30
int 47h
mov ah,2
int 47h
mov ah,30
int 47h
mov bp,255 mov bp,255
xor edx,edx xor edx,edx
go4: go4:
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
inc edx inc edx
push edx push edx
push offset texte3 push offset texte3
call [print] call [print]
mov ah,30 call [xchgpages]
int 47h call [waitretrace]
mov ah,33
int 47h
dec bp dec bp
jnz go4 jnz go4
push offset texte4 push offset texte4
call [print] call [print]
mov ax,0 mov ax,0
int 16h int 16h
mov ah,29h call [restorestate]
int 47h
retf retf
put: put:
call random call random
mov di,dx mov di,dx
@ -135,24 +100,21 @@ 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
@ -188,16 +150,20 @@ showstring2:
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