Thursday 15 August 2013

assembly x86 coding with a data segment and loop -


The code below prints '1' from some data data segments. Then it prints from 1 to 5. I want to use mov eax, instead of 1 to 1 set, '1' from the data segment. Not sure how to do this when I use the '1' character, I think I can add it to add and add to it to get the next number instead of al registering.

  including Irvine32.inc. Data some data byte "1", 0h, 0h, 0. Exit the code Main Proxy call test Main EDP Test Process mov ADX, offset some data; This call is for callstring testing; Just for the mov ecx test, 5 mov eax, 1 l1: writedec call; EX is a counter call, CRLF Inc. al; Next letter Loop L1 Rate Test ENDP END Main  

Checking your code, I think That you are using al (ink al), not ex So you can add some data directly to the AL. Or you can clear it earlier and use eX. I modify my code for this change:

  .stack 100h Data is some data byte "1", 0dh, 0ah, 0 Code Main Proxy Call Test Moment Ax, 4c00h int 21h Main ENDP Test Procc Mov dx, OFFSET someData; This is just for the mov ah test, 9 to 21 hours; Display SOMEDATA mov ecx, 5 mov eax, 0; Clearing EACA, now SODDATA mov al, someData; The entire eX has L1: call the callcard; EX is a counter call, CRLF Inc. al;  

Due to some data type BYTE, you have to use AL with EX, but if you want to use EX, size is DWORD, just clear it already So, all its bytes are zero, and the value of AL in EX will be.

By the way, you are using ASCII characters, I mean, you are not counting 1, 2, 3 ... but "1", "2", "3". .. this is not the problem if you want to stop 9, but if you want to go to 10, 11 ..., then you need to convert some data from "1" to 1. In that case, to display some data on the screen, you will have to make a process of converting from number to letter, what might be WriteDec.


No comments:

Post a Comment