Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BOOT.ASM --
- [org 0x7c00]
- mov dx, 0x7c00
- call printhex
- mov bx, printthistoo
- call printaddr
- jmp $
- %include "print.asm"
- printthis:
- db 'Letters!', 0
- printthistoo:
- db ' Yes, all of these!', 0
- times 510-($-$$) db 0
- dw 0xaa55
- -- PRINT.ASM --
- printaddr:
- pusha
- mov ah, 0x0e
- lp:
- mov al, [bx]
- cmp al, 0
- jne printch
- jmp doneaddr
- printch:
- int 0x10
- add bx, 1
- jmp lp
- doneaddr:
- popa
- ret
- printhex:
- mov cx, 0x3
- mov ax, 0xF
- lph:
- mov bx, 0x0
- add bx, ax
- and bx, dx
- cmp bx, ax
- je log
- sub ax, 0x1
- jmp lph
- log:
- cmp ax, 0x9
- jle lognum
- jmp loglet
- finlog:
- cmp cx, 0x0
- je printnd
- mov ax, 0xF
- sub cx, 0x1
- shr dx, 4
- jmp lph
- lognum:
- mov bx, extemplate
- add bx, cx
- add bx, 0x2
- add ax, 48
- mov [bx], al
- jmp finlog
- loglet:
- mov bx, extemplate
- add bx, cx
- add bx, 0x2
- add ax, 0x7
- add ax, 48
- mov [bx], al
- jmp finlog
- printnd:
- mov bx, extemplate
- call printaddr
- ret
- extemplate:
- db '0x0000', 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement