Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void printString(char * str){
- asm {
- mov ah, 0x0e
- mov bh, 0 // BH=Display number to write to.
- les si, str // Load ES with segment and SI with offset stored at 'str'
- }
- nextchar:
- asm{
- mov al,[es:si] // Override the segment with ES to retrieve data from offset
- test al, al
- jz done
- int 0x10
- inc si
- jmp nextchar
- }
- done:
- }
- int main(){
- char* str = "hello world!";
- printString(str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement