Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;esi - Pointer to text
- ;ax - X Pos.
- ;bx - Y Pos.
- ;cl - Attrib.
- placeText:
- mov [tempattrib], cl
- mov [tempx], ax
- mov ax, bx
- mov bx, 160
- mul bx
- mov [tempy], ax
- mov ax, [tempx]
- mov bx, 2
- mul bx
- mov bx, ax
- mov ax, [tempy]
- add eax, ebx
- mov ecx, 0B8000h
- add ecx, eax
- .placeTextLoop:
- lodsb
- cmp al, 00h
- je .donePlacingText
- mov [ecx], BYTE al
- add ecx, 1h
- mov dx, [tempattrib]
- mov [ecx], dx
- add ecx, 1h
- jmp .placeTextLoop
- .donePlacingText:
- ret
- tempVal: dd 0
- andVal: dd 0
- shiftVal: db 0
- counter: dd 0
- tempX: dw 0
- tempY: dw 0
- hexString: db "00000000H", 0
- ;ax - X Pos.
- ;bx - Y Pos.
- ;ecx - Value to print
- print32Bit:
- mov [tempX], ax
- mov [tempY], bx
- mov [tempVal], ecx
- mov [shiftVal], BYTE 28
- mov [andVal], DWORD 0F0000000h
- mov [counter], BYTE 00h
- .copyToStringLoop:
- mov eax, [tempVal]
- and eax, [andVal]
- mov cl, [shiftVal]
- shr DWORD eax, cl
- mov ebx, hexTable
- add ebx, eax
- mov ecx, hexString
- mov edx, [counter]
- add ecx, edx
- mov dl, [ebx]
- mov [ecx], dl
- sub [shiftVal], BYTE 4
- shr DWORD [andVal], BYTE 4
- add [counter], DWORD 1
- cmp [counter], DWORD 8
- jne .copyToStringLoop
- mov ax, [tempX]
- mov bx, [tempY]
- mov cl, 0Fh
- mov si, hexString
- call placeText
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement