first is 16bit DOS code
befor I use masm, and wannt to use nasm from now on.
I feel I can't write simple code use if/else do/while because I haven't read enough nasm code
hope some one show your code.

follow code is wrong, I don't know why, is someone know ?
if you can't see what's wrong, debug it! you will found !

segment data
BUF: db 45, 61, 70, 86, 75, 100, 69, 88, 81
n equ $ - BUF

RESULT: resb 2

segment stack
st resb 100

segment code
mov ax, stack
mov ss, ax
mov sp, 100

mov ax, data
mov ds, ax
mov cx, n
mov si, BUF
mov di, RESULT

mov ah, 0
mov bh, 0

mov al,
cmp al, 60
jb .1

inc ah
jmp .2

inc bh

inc si
dec cx
cmp cx, 0
jz .exit
jnz .0

mov , ah
mov , bh

mov ax, 0x4c00
int 0x21

next is win32 code, it is right.
but i found the envionment variables is not work, why ?
nasm don't search envionment variables?
you can change directory in %include line

hope for your answer..
sorry for my poor english..

%include 'd:\nasmx\inc\' ; change here
%include 'd:\nasmx\inc\win32\'      ; change here
%include 'd:\nasmx\inc\win32\'     ; change here
%include 'd:\nasmx\inc\win32\'    ;; change here

entry main

secction .text
proc main
invoke GetLogicalDrives
mov ebx ,eax

test ebx, 1
je .here
mov eax,
add eax, 'A'
invoke printf, szDriver, eax

shr ebx, 1
jne .count

invoke printf, szMsg,
invoke ExitProcess, 0

section .data
szDriver: db '%c:', 0xa, 0
szMsg: db 'there are %d driver(s)', 0
DiskCount: dd 1

Posted on 2009-01-11 21:27:30 by mnzn2530

GetLogicDriver.exe: GetLogicDriver.obj
golink /console /entry _main GetLogicDriver.obj kernel32.dll  msvcrt.dll

GetLogicDriver.obj: GetLogicDriver.asm
nasm GetLogicDriver.asm -o GetLogicDriver.obj -fwin32

del *.obj *.exe

here is makefile for win32
Posted on 2009-01-11 21:29:10 by mnzn2530
You can supply directories to include at the command line (-I), or include relative files from within the source, as is standard.
Posted on 2009-01-14 20:58:02 by SpooK