Anonymous user
Printing To Screen: Difference between revisions
→Printing Strings
[unchecked revision] | [unchecked revision] |
Line 54:
Main:
mov dx, 0xb800 ; put address into data register
mov es, dx ; data register into extra segment
mov si, msg ; our message
mov cx, 0
Print:
lodsb ; loads a char from si to al
cmp al, 0 ; are we done? reached the null terminator?
je Done ; if yes, jump
mov di, cx
Line 79:
msg db 'Hello World!', 0
</source>
This does the same as the example in C. It simply cycles through each character in the string.
==Printing Integers==
|