NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: mik3ca on January 16, 2021, 07:17:03 PM
-
My goal is to allocate at least 64KB conventional memory from DOS to use with my program and for me to try to achieve that I'm writing my own TSR since Int 21h function 48h (allocate memory) doesn't give me much despite dos reporting 500+KB free.
I'm using nasm and writing code as follows to follow the DOS COM format:
org 100h
mov SI,80h
lodsb
;result in AL
Documents everywhere state that offset 80h in the DOS program segment prefix will reveal the number of bytes used on the command line after the program name but this does not seem to be the case because AL never returns the correct value.
What could I be doing wrong here?
-
Have you set the value of DS? You can't assume it will be the same as CS. Try
org 100h
push cs
pop ds
mov si,80h
lodsb
-
ok ill look into that