flat assembler
Message board for the users of flat assembler.
Index
> DOS > Compile for DOS on Windows? |
Author |
|
revolution 14 Oct 2016, 01:50
Yes you can assemble .com files. But you can't test DOS programs in 64-bit Windows natively. You'll need an emulator or VM to run the resulting DOS code.
|
|||
14 Oct 2016, 01:50 |
|
cld 14 Oct 2016, 04:16
Thanks for the info. Yes, I understand I'll need a DOS environment in order to run the DOS code.
|
|||
14 Oct 2016, 04:16 |
|
revolution 14 Oct 2016, 04:30
The multiseg.asm example file shows some basic syntax for DOS .exe files:
Code: ; fasm example of writing multi-segment EXE program format MZ entry main:start ; program entry point stack 100h ; stack size segment main ; main program segment start: mov ax,text mov ds,ax mov dx,hello call extra:write_text mov ax,4C00h int 21h segment text hello db 'Hello world!',24h segment extra write_text: mov ah,9 int 21h retf Code: ; fasm example of writing 16-bit COM program org 100h ; code starts at offset 100h use16 ; use 16-bit code display_text = 9 mov ah,display_text mov dx,hello int 21h int 20h hello db 'Hello world!',24h |
|||
14 Oct 2016, 04:30 |
|
cld 15 Oct 2016, 04:37
revolution, thanks. I will study these examples. Last night I assembled my first little program, to print all 256 Ascii chars to the screen.
Code: use16 org 100h ; mov cx,ffh ; put 255 in reg CX [counter] <== next line fixes this mov cx,100h ; put 256 in reg CX [counter] mov dl,0 ; put 0 in DL prints: mov ah,2 ; print char to screen int 21h ; execute inc dl ; increment DL loop prints ; loop back ;finish mov dl,0ah ; put line feed in DL mov ah,2 ; print it to screen int 21h ; execute int 20h ; exit _________________ cld -- rank amateur Last edited by cld on 15 Oct 2016, 20:23; edited 1 time in total |
|||
15 Oct 2016, 04:37 |
|
revolution 15 Oct 2016, 04:54
cld wrote: ... print all 256 Ascii chars to the screen. |
|||
15 Oct 2016, 04:54 |
|
cld 15 Oct 2016, 20:24
Pesky edge case! Fixed -- thanks!
|
|||
15 Oct 2016, 20:24 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.