Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Need help with DPMI function 301h (Developers)

posted by Japheth(R) Homepage, Germany (South), 24.08.2019, 17:52

>
> Why? It is valid code. It moves the value of variable r into edi.

Ok, there is no "official" assembler standard, so it's a bit vague here.

For the MASM family of assemblers, the line "mov edi,r" would indeed load the CONTENT of data label "r" into EDI. However, since these assemblers do size checks, they will report an error like "sizes don't match", because variable "r" has a size of 32h bytes.

For the NASM family of assemblers, the line "mov edi,r" usually will load the ADDRESS of data label "r" into EDI. To load the contents, you have to add square brackets: "mov edi,[r]". Since "mov edi,r" CANNOT load the address of a stack variable (because it is register related), nasm-style assemblers should also report an error in this case ( I haven't tried ).

---
MS-DOS forever!

 

Complete thread:

Back to the forum
Board view  Mix view
16017 Postings in 1483 Threads, 271 registered users, 5 users online (0 registered, 5 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum