Array: Difference between revisions
m
→Encoding an Array's End
Puppydrum64 (talk | contribs) m (→Encoding an Array's End: Fixed a mistake. The pointer wasn't getting incremented.) |
Puppydrum64 (talk | contribs) |
||
Line 139:
; input: [DS:SI] = string pointer
mov al,[ds:si]
inc si
cmp al,5Ch ;ascii for backslash, this is the escape character
;notice that the check for the escape character happens before the check for the terminator.
Line 149 ⟶ 150:
EscapeNextChar:
mov al,[ds:si] ;perform an additional read, except this read doesn't compare the fetched character to anything.
inc si
call PrintChar ;print that character as-is
jmp PrintString ;go back to the loop's beginning, skipping the terminator check entirely.
|