November 12th, 2009, 07:22 PM
MASM Programming reading a single char from a given string.
How do you go about reading a single character from a given string at a time? For example given the string 139*2-5/+ starting from left to right I want to read '1' and stick it into var1.
March 26th, 2010, 09:45 AM
Without knowing what var1 is ...
Some assembler psuedo code:
LD pointerRegister1, #String
LD reg, [pointerRegister2]
TEST reg,terminatorCharacter ; 0?
LD [var1], reg ; store the character
There are also special instructions that can do all this in one go, just set up the source and destination registers and the count and off you go.