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

This commit is contained in:
Nicolas Hordé 2007-03-23 16:52:46 +00:00
parent 85ea3e1514
commit c83c7cf1fe
1 changed files with 63 additions and 68 deletions

View File

@ -1,82 +1,77 @@
.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
include ..\include\divers.h
start: start:
header exe <,1,0,,,offset imports,,> header exe <"CE",1,0,0,,offset imports,,offset realstart>
realstart: realstart:
push offset msg call [cs:print],offset msg
call [print] xor ebx,ebx
xor cx,cx
xor cx,cx
listmcb: listmcb:
mov ah,4 call [cs:mbget],cx
int 49h jc fino
jc fino dec ax
inc cx dec ax
mov gs,ax
;placement mémoire inc cx
mov dx,gs mov dx,gs
inc dx push edx ;Emplacement memoire hex 2
inc dx
push edx
;parent ;parent
cmp gs:[MB.Reference],0 cmp [gs:mb.reference],0
je next jne next
mov dx,gs:[MB.Reference] push cs
dec dx push offset none ;parent lstr0 2x2
dec dx add bx,[gs:mb.sizes]
push dx jmp suitemn
push offset MB.Names
jmp suitemn
next: next:
push cs mov dx,[gs:mb.reference]
push offset none dec dx
dec dx
push dx ;parent lstr0 2x2
push offset (mb).names
suitemn: suitemn:
cmp [gs: mb.isresident],true
;Resident jne notresident
cmp gs:[MB.IsResident],true push offset resident ;resident str0 2
jne notresident jmp suitelistmcb
push offset resident
jmp suitelistmcb
notresident: notresident:
push offset nonresident push offset nonresident ;resident str0 2
suitelistmcb: suitelistmcb:
xor edx,edx
;taille memoire mov dx,[gs: mb.sizes]
xor edx,edx shl edx,4
mov dx,gs:[MB.Sizes] push 6 ;decimal 4 + type 2
shl edx,4 push edx
push 6 push gs ;nom lstr0 2x2
push edx push offset (mb).names
push offset line2 ;ligne
;nom call [cs:print]
push gs jmp listmcb
push offset MB.Names
push offset line
call [print]
jmp listmcb
fino: fino:
db 0CBh shl ebx,4
push ebx
push offset fin
call [cs:print]
retf
resident db "oui",0 resident db "oui",0
nonresident db "non",0 nonresident db "non",0
line db "%0P\h15%w\h24%0\h30%0P\h46%hW\l",0 line2 db "%0P\h15|%w\h25|%0\h30|%0P\h46|%hW\l",0
msg db "Memory manager V1.5\lNom Taille Res Parent Mem\l",0 fin db "\l\l\c02%u octets de memoire disponible\l\c07",0
msg db "Plan de la memoire\l\lNom | Taille |Res |Parent |Mem\l",0
none db ".",0 none db ".",0
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start importing
use VIDEO.LIB,print
use SYSTEME,mbget
endi