flat assembler
Message board for the users of flat assembler.
Index
> DOS > made my first Code [resolved] |
Author |
|
bitRAKE 03 Nov 2007, 01:55
Some brief comments:
Code: startl: mov eax,[ecx] ; Ary is bytes, but you load DWORD! cmp eax,0 je quit cmp ebx,eax ; what is in EBX the first time?! jle startl ; this will loop, but ECX hasn't been changed mov ebx,eax inc ecx ; this should be in innerloop jmp startl quit: mov ax,4C00h int 21h |
|||
03 Nov 2007, 01:55 |
|
packet_50071 03 Nov 2007, 16:06
Code: mov eax,[ecx] ; Ary is bytes, but you load DWORD! How do I load the byte ! Should I repost this in DOS ! |
|||
03 Nov 2007, 16:06 |
|
vid 03 Nov 2007, 16:30
use byte-sized register:
Code: mov al, [ecx] mov bh, [ecx] |
|||
03 Nov 2007, 16:30 |
|
bitRAKE 03 Nov 2007, 17:40
I used DEBUG from DOS when I first moved to Intel land. Hopefully, there are better debuggers in DOS, but I don't know what is availible in that regard. A good debugger will allow you to program in memory and test as you go - interactively. I piped instruction from a batch file to 'compile' my programs.
Ollydbg works well for this in Windows. In a debugger you will see a representation of internal machine state to better understand what is happening with each instruction. This is a good start. |
|||
03 Nov 2007, 17:40 |
|
packet_50071 03 Nov 2007, 18:50
Thx for the help
I will stick with fasm for now - when I move to Windows I will use Visual studio its a good debugger for Windows My working code Code: org 100h mov ah,2 lea ecx,[Ary] mov dl,0 startl: mov al,[ecx] cmp al,0 je quit inc ecx cmp al,dl jle startl mov dl,al jmp startl quit: int 21h mov ax,4C00h int 21h Ary db 109,108,102,0 |
|||
03 Nov 2007, 18:50 |
|
bitRAKE 03 Nov 2007, 19:47
Here are some DOS tools:
http://www.japheth.de/ |
|||
03 Nov 2007, 19:47 |
|
Japheth 04 Nov 2007, 08:36
For such a simple program DEBUG is good enough:
http://www.japheth.de/Download/debug107.zip David Lindauer has coded GRDB, which also has the nice and superior DEBUG interface + some goodies: http://members.tripod.com/~ladsoft/grdb.htm For those loving warm showers, there are fullscreen debuggers available as well: http://www.bttr-software.de/products/insight/ http://www.programmersheaven.com/download/21643/download.aspx |
|||
04 Nov 2007, 08:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.